Sensor Pendeteksi Kekeruhan Air Berbasis Arduino

Project Untuk Kelompok 6




Komponen yang dibutuhkan :
  • Arduino (Versi apapun) >> 1 Buah.
  • LDR >> 1 Buah.
  • LED ukuran 5mm warna putih terang >> 3 Buah.
  • Resistor 1K >> 2 Buah.
  • Kabel >> Seperlunya.

Wiring :

Source Code :
     /*  
      * Generated Code by Kang Kamal  
      * kangkamal.blogspot.com  
      */  
     int led1 = 10;  
     int led2 = 11;  
     int led3 = 12;  
     int pinLDR = A0;  
     int data = 0;  
     void setup() {  
      // put your setup code here, to run once:  
      Serial.begin(9600);  
      pinMode(led1, OUTPUT);  
      pinMode(led2, OUTPUT);  
      pinMode(led3, OUTPUT);  
      digitalWrite(led1, LOW); //Matikan LED  
      digitalWrite(led2, LOW); //Matikan LED  
      digitalWrite(led3, LOW); //Matikan LED  
      delay(1000);  
     }  
     void loop() {  
      // put your main code here, to run repeatedly:  
      digitalWrite(led1, HIGH); //Nyalakan LED  
      digitalWrite(led2, HIGH); //Nyalakan LED  
      digitalWrite(led3, HIGH); //Nyalakan LED  
      data = analogRead(pinLDR);  
      Serial.print("Nilai : ");  
      Serial.println(data);  
      if (data < 150){  
       Serial.println("Air Bening");  
      }  
      if (data > 150 && data < 300){  
       Serial.println("Keruh");  
      }  
      if (data > 300){  
       Serial.println("Sangat Keruh");  
      }  
     }  
    

    comment 2 comments:

    Maruf Djudan on July 9, 2018 at 9:39 PM said...

    Saya minta dibuatkan 1 set komplit bisa kang? Kalo bisa hub saya di marufdjudan@gmail.com atau wa 081381915545 terima kasih kanh

    Maruf Djudan on July 9, 2018 at 9:40 PM said...

    Saya minta dibuatkan 1 set komplit bisa kang? Kalo bisa hub saya di marufdjudan@gmail.com atau wa 081381915545 terima kasih kanh

    Post a Comment

    CNC Tutorial Cetak si SAM Assistant

     
    © All 4 You... | Design by Blog template in collaboration with Concert Tickets, and Menopause symptoms
    Powered by Blogger