For this assignment I was tasked with creating a system that uses a flame sensor, relay, and Arduino board to turn on a fan once a flame or UV light is detected.
The Arduino uses the relay as a switch that turns the fan on and off. Once a flame or UV light is detected, the flame sensor sends a signal to the Arduino which then sends a signal to the relay that tells the relay to turn on the switch. Once this switch has been turned on the fan will begin to run. When the flame or UV light is no longer detected, the flame sensor then sends a signal to the Arduino which then tells the relay to turn the switch off and the fan will stop running.
The video below demonstrates how the system works when the UV light of a flashlight is detected by the flame sensor.
My partner and I had to first create the code that would run the system. The code we used to run this system is below.

After we had our code, we had to wire up our system. The Arduino was connected to the relay as well as the flame sensor. It also had a 5-volt connection on the breadboard to give power to the relay and flame sensor. From there we connected the fan to the relay and the Arduino ground.
A diagram of the correctly wired system are shown below.
Recent Comments