As requirement of Sanjay who is the DBRT (agriculture)
student. I have made a small simple project of temperature and humidity sensor
for hydroponic. I did proper connections of arduino, temperature humidity
sensor and relay driver.
[Target: If the temperature less than 250C then bulb will automatic start]
Material:
Sr. No.
|
Material
Name
|
Qty.
|
1
|
Arduino board
|
1
|
2
|
Temperature and humidity sensor
|
1
|
3
|
Relay driver
|
1
|
4
|
Socket (plug)
|
1
|
5
|
2 pin
|
1
|
6
|
Wires
|
|
7
|
MDF Sheet
|
|
- Testing connections and Code :
- Programming code :
#include "DHT.h"
DHT dht;
void setup()
{
Serial.begin(9600);
Serial.println();
Serial.println("Status\tHumidity (%)\tTemperature (C)\t(F)");
pinMode(9,OUTPUT);
dht.setup(2); // data pin 2
}
void loop()
{
delay(dht.getMinimumSamplingPeriod());
float humidity = dht.getHumidity();
float temperature = dht.getTemperature();
Serial.print(dht.getStatusString());
Serial.print("\t");
Serial.print(humidity, 1);
Serial.print("\t\t");
Serial.print(temperature, 1);
Serial.print("\t\t");
Serial.println(dht.toFahrenheit(temperature), 1);
if(temperature<25)
{
digitalWrite(9,LOW);
}
else
{
digitalWrite(9,HIGH);
}
}