Tugas Pendahuluan

             Bila suhu yang terbaca pada lcd menunnjukkan suhu kisaran 25-30 derajat celsius maka 2 led berwarna merah dan hijau akan hidup

2. Gambar Rangkaian Simulasi [Kembali]

3. Flowchart [Kembali]


 

4. Listing Program [Kembali]

#include <LiquidCrystal.h>
#define LM35 A0                             
LiquidCrystal lcd(2,3,4,5,6,7);             
int nilaiSuhu;                            
int LED1 = 8;
int LED2 = 9;
                   
void setup() {    
pinMode(A0, INPUT);                      
lcd.begin(16,2);                 
pinMode (LED1,OUTPUT);
pinMode (LED2,OUTPUT);
}

void loop()                                 
{

nilaiSuhu=((5*analogRead(LM35)*100.00)/1024);
                        

if (nilaiSuhu > 25 && nilaiSuhu <30) {
digitalWrite (LED1,HIGH);
digitalWrite (LED2,HIGH);
lcd.clear();                   
lcd.setCursor(0,0);                    
lcd.print("LM35 Sensor Suhu");         
lcd.setCursor(0,1);         
lcd.print(nilaiSuhu);                 
delay(100);  
}
else {
digitalWrite (LED1,LOW);
digitalWrite (LED2,LOW);
lcd.clear();                         
lcd.setCursor(0,0);                 
lcd.print("LM35 Sensor Suhu");         
lcd.setCursor(0,1);                   
lcd.print(nilaiSuhu);                    
delay(100);                             
}
}

5. Video Simulasi [Kembali]


6. Link Download [Kembali]

       1. Video Simulasi
       2. Gambar Rangkaian
       4. Listing Program

 

Tidak ada komentar:

Posting Komentar