Thursday, November 26, 2020

REMOT LAMPU ARDUINO

simak videonya  :      Di sini     

Untuk belajar elektronik dasar :        Di sini     

     Ini adalah scetch untuk lampu remot arduino:

/* sketch ini menggunakan relay aktif "LOW"
 *  bila teman" menggunakan relay aktif "HIGH"
 *  ganti "HIGH" yang ada di scetch dengan "LOW"
 *  dan yang "LOW" ganti dengan "HIGH"
 */
#include <SoftwareSerial.h>
SoftwareSerial module_bluetooth(0, 1);
char data;
void setup() {
  Serial.begin(9600);
  pinMode(2,OUTPUT);
  pinMode(3,OUTPUT);
  pinMode(4,OUTPUT);
  pinMode(5,OUTPUT);
  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(5, HIGH);
 }

void loop() {
if( Serial.available()>0 )
    data = Serial.read();
    Serial.println(data);
    Serial.print("\n");

if( data == '1' ) {
    digitalWrite(2,LOW); }  //lampu 1 on
  else if( data == 'A' ) {
    digitalWrite(2,HIGH);}     //lampu 1 off
  else if( data == '2' ){
    digitalWrite(3,LOW); }   //lampu 2 on
  else if( data == 'B' ) {
    digitalWrite(3,HIGH);}     //lampu 2 off
    
  else if( data == '3' ) {
    digitalWrite(4,LOW); }   //lampu 3 on
     else if( data == 'C' ) {
    digitalWrite(4,HIGH);}     //lampu 3 off
  else if( data == '4' ){
    digitalWrite(5,LOW); }   //lampu 4 on
  else if( data == 'D' ) {
    digitalWrite(5,HIGH);}     //lampu 4 off
    
  if( data == '5' ) {
    digitalWrite(2,LOW);  
    digitalWrite(3,LOW);
    digitalWrite(4,LOW);
    digitalWrite(5,LOW);}     //lampu all on

 if( data == 'E' ) {
    digitalWrite(2,HIGH);  
    digitalWrite(3,HIGH);
    digitalWrite(4,HIGH);
    digitalWrite(5,HIGH);}     //lampu all off
}

Friday, April 24, 2020

Tespen non contact


Untuk belajar elektronik dasar :        Di sini     

                         
  Kali ini kita akan belajar membuart tespen non contact
       Komponen yang kita perlukan :
  1. Transistor c 945
  2. led
  3. buzzer 3 volt
  4. baterai 3v ~ 3,7 v
  5. kabel isi kawat atau kawat email sekitar 30 cm


          untuk cara buatnya simak  :      Di sini     

ini adalah skemanya       

         

  Untuk belajar elektronik dasar :        Di sini     

Thursday, April 23, 2020

Jam suhu arduino




     Link CHANNEL YOUTUBE disini     




ini adalah wiring diagramnya


     Link video disini     





  1. #include <Wire.h>
  2. #include <DHT.h>
  3. #include <RTClib.h>
  4. #include <LiquidCrystal_I2C.h>
  5. #define DHTPIN  A0   
  6. #define DHTTYPE DHT11  
  7. DHT dht(DHTPIN, DHTTYPE);
  8. LiquidCrystal_I2C lcd = LiquidCrystal_I2C(0x3F, 20, 4);
  9. RTC_DS3231 rtc;
  10. char namaHari[7][12] = {"Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"};
  11. byte sd  = B11011111 ;
  12. void setup() {
  13.  Serial.begin(9600);
  14.  lcd.begin();
  15.  rtc.begin();
  16.  lcd.backlight();
  17.  dht.begin();

  18. }

  19. void loop() {
  20.    delay(1000);
  21.   float h = dht.readHumidity();
  22.   float t = dht.readTemperature();
  23.   if (isnan(h) || isnan(t))
  24.     {
  25.      Serial.println("Tidak menemukan sensor DTH");
  26.      lcd.print("Tidak menemukan sensor DTH");
  27.      return;
  28.     }
  29.   Serial.print("Kelembapan: ");
  30.   Serial.print(h);
  31.   Serial.print(" %\t");
  32.   Serial.print("Temperature: ");
  33.   Serial.print(t);
  34.   Serial.println(" *C ");
  35.  
  36. DateTime now = rtc.now ();
  37. lcd.setCursor(0,0);
  38.   lcd.print("Jam   :");
  39. if(now.hour()< 10) {lcd.print ("0");
  40.   lcd.print(now.hour());}
  41.  else
  42.   {lcd.print(now.hour());}
  43.   lcd.print(":");
  44. if(now.minute()< 10) {lcd.print ("0");
  45.   lcd.print(now.minute());}
  46.  else
  47.   {lcd.print(now.minute());}
  48.   lcd.print(":");
  49. if(now.second()< 10)
  50.   {lcd.print("0");
  51.   lcd.print(now.second());
  52.  }
  53. else
  54.   {lcd.print(now.second());
  55.  }
  56. lcd.setCursor(0,1);
  57.   lcd.print("Tgl   :");
  58.   lcd.print(namaHari[now.dayOfTheWeek()]);
  59.   lcd.print(",");
  60.   lcd.print(now.day());
  61.   lcd.print("/");
  62.   lcd.print(now.month());
  63.   lcd.print("/");
  64.   lcd.print(now.year());

  65.  lcd.setCursor(0,2);
  66.    lcd.print("Suhu  :");
  67.    lcd.print (t);
  68.    lcd.write(sd);
  69.    lcd.print("C");
  70.  
  71.  lcd.setCursor(0,3);
  72.    lcd.print("Lembab:");
  73.    lcd.print (h);
  74.    lcd.print("%");
  75.    }

Friday, April 17, 2020

Kran otomatis

Kali ini kita akan membuat project yang cukup simple dan semoga bermanfaat bagi kita semua , untuk komponen yang kita butuhkan :

Sketch yang mesti di upload pada arduino :

  1. #include <LiquidCrystal_I2C.h>
  2. LiquidCrystal_I2C lcd(0x3F , 16, 2);
  3. const int pinTrig = 8;
  4. const int pinEcho = 9;
  5. const int kran = 13;
  6. int jarak;

  7. void setup() {
  8.  lcd.begin();
  9.  Serial.begin(9600);
  10.  pinMode(pinTrig, OUTPUT);
  11.  pinMode(pinEcho, INPUT);
  12.  pinMode(kran,OUTPUT);
  13.  digitalWrite(kran,LOW);
  14.   lcd.setCursor(00,00);
  15.   lcd.print(" BELAJAR LISTRIK ");
  16.   lcd.setCursor(00,01);
  17.   lcd.print ("dan ELEKTRONIK");
  18.   delay (1500);
  19.    lcd.clear();
  20. }
  21. void loop() {
  22.  
  23. digitalWrite(pinTrig, HIGH);
  24. delayMicroseconds(10);
  25. digitalWrite(pinTrig, LOW);
  26. float durasi = pulseIn(pinEcho, HIGH);
  27. jarak =(durasi *0.034)/2;
  28. Serial.println (jarak );

  29. if (jarak < 40) {
  30.   digitalWrite(kran,HIGH);
  31.   lcd.setCursor(00,00);
  32.   lcd.print("  TERUS   JAGA    ");
  33.   lcd.setCursor(00,01);
  34.   lcd.print ("   KEBERSIHAN    " );
  35. }
  36. else {
  37.   digitalWrite(kran,LOW);
  38.   lcd.setCursor(00,00);
  39.   lcd.print("READY , DEKATKAN  ");
  40.   lcd.setCursor(00,01);
  41.   lcd.print ("  TANGAN  ANDA   ");
  42. }
  43. }

     Link CHANNEL YOUTUBE disini     

Wednesday, April 15, 2020

Sketch meter hc04

 Sketch meter hc 04 :

#include <LiquidCrystal_I2C.h>LiquidCrystal_I2C lcd(0x3B , 16, 2);  // 0x3B ganti dengan alamat i2C teman"
const int pinEcho = 4; // pin echo pada pin 4
const int pinTrig = 5; // pin triger pada pin 5
int jarak;

void setup() {
 lcd.begin();
 Serial.begin(9600);
pinMode(pinTrig, OUTPUT);
pinMode(pinEcho, INPUT);
  lcd.setCursor(00,00);
  lcd.print(" BELAJAR LISTRIK ");
  lcd.setCursor(00,01);
  lcd.print ("dan ELEKTRONIK");
  delay (1500);
   lcd.clear();
   delay (500);
}
void loop() {
digitalWrite(pinTrig, HIGH);
delayMicroseconds(10);
digitalWrite(pinTrig, LOW);
float durasi = pulseIn(pinEcho, HIGH);
jarak =(durasi *0.034)/2;
Serial.println (jarak );
if (jarak > 350) {
  lcd.setCursor(00,00);
  lcd.print(" Project HC-SR04");
  lcd.setCursor(00,01);
  lcd.print ("Jarak :");
  lcd.print (" No range " );
}

else {
lcd.setCursor(00,00);
lcd.print(" Project HC-SR04");
lcd.setCursor(00,01);
lcd.print ("Jarak : ");
lcd.print ( jarak ) ;
lcd.print (" cm");

}
delay (500);
lcd.clear();
}