Select Page

In this project, we were originally supposed to use a temperature sensor to detect a fire and then signal to a relay to turn on a fan, but the temperature sensor only worked when in contact with the heat source so we jury-rigged the temperature sensor into an IR sensor.

 

Our original sensors looked like this, (Image source).

KY-028 Digital Temperature Sensor Module - ArduinoModulesInfo

Mine currently looks like this

With the newly modified sensor, I used this code to read the output from the sensor and use that to switch a relay when it senses infrared light.

The relay is normally closed, which means there isn’t power running out of it unless it is switched. In other words, there isn’t power running to the fan from the relay unless there is a signal from pin 13 on the Arduino. So if the IR sensor picks up a certain level of infrared light, it signals the normally closed relay to switch and allow power to run through it to the fan. This is demonstrated in the following YouTube video.