articles
GrovePi Project 3: Temperature/ Humidity Alarm Sensor With Light Warning
Tuesday, September 13, 2016Instead of printing distance, we are printing temperature/ humidity so we write
[temp,hum]=dht (dht_sensor-port,dht_sensor_type)
print ("temp =", temp, "C\thumidity =", hum, "%")
t=str(temp)
h=str(hum)
The digital high temperature sensor is set to turn the blue LED on when the temperature is less than 20 degrees centigrade. When the temperature becomes greater or equal than 20 degrees centigrade, the red LED turns on instead and the buzzer will buzz.
In the video below, I set the temperature alarm triggering at 25 degrees centigrade. I use a blow dryer to set off the alarm
If instead of temperature you want to measure high humidity, simply replace if temp with if hum from the code below:
0 comments