IR Flame sensor 2 pin (With Arduino)
IR Flame sensor 2 pin (With Arduino)
Introduction
The IR Flame sensor is often overlooked and is rarely acknowledged, but it plays a big role in keeping people and equipment safe. It is used a lot in nuclear facilities, gas pipelines, and oil pipelines. It is always good to know how they work and operate. Just like the Photoresistor, it is very easy to wire up and code them.
A quick history of flame sensor
The Flame sensor was invented by Francis Robbins Upton back in 1890. It sets off an alarm when heat is detected in a room. The Flame sensor we are talking about in this article uses the infrared light found in gasses that are released from fires. For over 130 years fire protection has played a big role in the safety industry by allowing us to automatically detect a fire and, prevent it from spreading further.
What you will need
- 1x Arduino UNO
- 1x Breadboard
- 3x Jumper wires
- 1x 10K ohm resistor
- 1x IR Flame sensor
Steps
1. Wire up the circuit according to the diagram. The longer pin of the 2 pin is the positive pin, also known as the Anode, and the shorter pin is the negative pin also known as the Cathode. connect the 5-volt pin of the Arduino to the Anode of the Flame sensor, place a 10K ohm resistor between the Cathode of the Flame sensor and the GND of the Arduino then lastly connect the Cathode to the A0 pin of the Arduino. (NOTE: A resistor has to be added else the circuit might not work or get damaged. In this case, a 10K ohm resistor would work. See Ohm's law)
2. Code
int Flame_Sensor = A0;
void setup()
{
Serial.begin(9600);
pinMode(Flame_Sensor, INPUT);
}
void loop()
{
// if the value is 0 the is no fire and if larger than 0 there is no fire
int Flame_Value = analogRead(Flame_Sensor);
Serial.println(Flame_Value);
delay(100);
}
3. int Flame_Sensor = A0;
Assign a name to the Analog pin A0 to make the code easier to understand and change.
4. void setup() {
Start the serial monitor with Serial.begin(9600); this will allow you to send and receive data to and from the Arduino the number 9600 is the default baud rate the Arduino transmits this can be changed.
With pinMode(Flame_Sensor, INPUT); you tell the Arduino that the analog pin A0 is an input pin.
5. void loop(){
Create a variable that stores the data that Arduino collects on analog pin A0 with this line
int Flame_Value = analogRead(Flame_Sensor);. This is optional but makes the code look better and it makes the code easier to read and understand. Serial.println(Flame_Value) allows you to write the value the Arduino receives from the analog pin to the serial monitor. delay(100); allows you to have a pause in the code for a specified amount of time, in this case, 100 milliseconds.
Useful links
- Github - https://github.com/ITTechne/IR-flame-sensor
- Amazon Links (non-affiliate)
- Arduino UNO
- Breadboard
- Jumper wires
- 10K ohm resistor
- IR Flame sensor (Can't find an Amazon link for an IR Flame sensor with 2 pins)
Comments
Post a Comment