GrovePi Project 3: Temperature/ Humidity Alarm Sensor With Light WarningTuesday, September 13, 2016
Instead of printing distance, we are printing temperature/ humidity so we write
print ("temp =", temp, "C\thumidity =", 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: