Arduino Final Project Incubator Eggs
Arduino Final Project Incubator Eggs
h"
#include <LiquidCrystal.h>
#define DHTPIN 2 // digital pin we're connected to pin 2
#define RELAYPIN 3
LiquidCrystal lcd(12, 11, 7, 6, 5, 4);
// pin vss to gnd
// pin vdd to +5vdc
// pin v0 t0 middle potensiometer 10k
// potensiometer 10k pin left to +5vdc
// potensiometer 10k pin right to GND
// pin rs to arduino pin 12
// pin rw to gnd
// pin E to arduino pin 11
// pin D4 to arduino pin 7
// pin D5 to arduino pin 6
// pin D6 to arduino pin 5
// pin D7 to arduino pin 4
// pin A to resistor (red, red, brown, gold)
// resistor (red, red, brown, gold) to +5vdc
// pin K to gnd
// arduino pin 3 to relay In1
// DHT pin 1 in right side to +5vdc
// DHT pin 2 to resistor (red, red, brown, gold)
// resistor (red, red, brown, gold) to arduino pin 2
// DHT pin 4 to GND
void setup() {
Serial.begin(9600);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.print("Home Made Musa");
lcd.setCursor(0,1);
lcd.print("incubator EGGS");
// Setup relay
pinMode(RELAYPIN, OUTPUT);
}
void loop() {
// Wait a few seconds between measurements.
delay(2000);
// Check if any reads failed and exit early (to try again).
if (isnan(humidity) || isnan(temp)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
lcd.setCursor(0,0);
lcd.print("Humi: ");
lcd.print(humidity);
lcd.print(" % ");
lcd.setCursor(0,1);
lcd.print("Temp: ");
lcd.print(temp);
lcd.print(" C ");
}