How to Make a Flame Detector
By Robin Mitchell
Smoke detectors are great for detecting smoke, and carbon monoxide detectors are great for detecting carbon monoxide. But what about a smokeless flame? Or what about an oil fire? In this DIY Hacking project, we will make a flame alarm that functions just like a typical commercial smoke alarm!
- 1K Resistor (R1, R2)
- 4.7K Resistor (R3, R4, R5)
- 100nF Capacitor (C1, C3, C4)
- 10uF Capacitor (C2)
- Green 3mm LED (D1)
- Red 3mm LED (D2)
- 1N5817 (D3, D4)
- 2N3904 (Q1)
- Buzzer (BZ1)
- PIC16F819 or PIC16F 84, 88, 818 (U1)
- 7805 (U2)
- PICKIT3 (J1)
See the full-size version
How the Flame Detector Works
The goal of this project is to make an alarm that signals when a flame is present. This is achieved with three main components:
- A flame detector module
- The controller circuit
- Firmware coded into the main controller
The flame detector module is a simple op amp comparator with an IR diode. Flames emit large quantities of IR radiation, and this radiation can be detected with an IR diode. The module compares the voltage drop over an IR diode to a reference voltage and outputs a signal, depending which one is greater. When a flame is detected, the output switches low, and when a flame is not detected, the output switches high. The potentiometer on the module can be used to adjust the sensitivity so daylight can’t trip the system.
The controller circuit is simple, with the core of the circuit being the PIC16F819. A switch is used for resetting/testing, a buzzer for alerting those nearby, one green LED to indicate that the module is functioning correctly, and a red LED for indicating that the detector is taking readings from the flame module. The circuit also has a small power management sub-circuit, which uses a 7805 IC in an SOT-89 package for power regulation.
The real magic in this project lies in the firmware on the PIC16F819. The code itself is written in XC8 and is only 100 lines long, with many of the lines being empty space, braces, or comments. When executed, the PIC goes through setup procedures, including setting the TRIS bits, disabling the ADC, and configuring the oscillator. Once done, the PIC enters an infinite loop that probes the module to see if the output is low or high. If low, then a flame has been detected and the alarm routine is triggered. This routine makes the buzzer beep indefinitely until the test button has been pressed and held. If no flame has been detected, the program makes the red LED blink to indicate that measurements are being taken, and also looks to see if the test button has been pressed. If it has, the buzzer is sounded to prove that the unit (or at least the main circuit) is, in fact, working.
This project can be built using many different circuit construction techniques, including stripboard, breadboard, matrix board, and PCB. However, if not using a PCB, the 7805 you use should be a through-hole type, as the surface mount 7805 is very small and only suitable for PCBs. This project is the first project to use the new PCB production line I have set up for future projects, and these PCBs include a neat silkscreen and soldermask, which makes building the projects a lot easier. A CNC is still used to drill the holes, but the traces are now done with ferric chloride and photoresist.
- Building a Circuit to Detect High Frequencies: The Bat Detector!
- Do-It-Yourself Insect Detector with an Electret Microphone and PIC18F1220
- Use LaunchPad to Make a Laser Tripwire Alarm
- Laser Diode Tripwire Alarm… A Launchpad Security System
- Build Your Own Alarm System with an LM386 Amplifier and an NPN Transistor