Lesson 13 – Flame Sensor
Setup
- Before you start working with any of the tutorials in this series please make sure you have completed the following tasks –
- Downloaded and installed the Arduino IDE.
- Are able to connect to the Arduino IDE from your computer
- Have been successful in uploading a simple (e.g. Blink LED’s) example programs (that comes with the Arduino IDE) onto your Arduino UNO board
- If you haven’t installed the Arduino IDE please head back to the first tutorial and make sure you’ve gone through each of the steps involved.
- Once you’ve sorted all of the above you are ready to move onto the next tutorial.
Tutorial
Flame sensor (Infrared receiving triode) is specially used on robots to find the fire source. This sensor is of high sensitivity to flame.
Working Principle:
Flame sensor is based on the principle that infrared ray is highly sensitive to flame. It has an infrared receiving tube specially designed to detect fire, and then convert the flame brightness into fluctuating level signal. The signals are then input into the central processor and be dealt with accordingly.
Sensor Connection:
The shorter lead of the receiving triode is for negative, the other one for positive. Connect negative to 5V pin, positive to resistor; connect the other end of the resistor to GND, connect one end of a jumper wire to a clip which is electrically connected to sensor positive, the other end to analog pin. As shown below:
Here’s the hardware you will need for the tutorials –
- Arduino Board x1
- Flame sensor*1
- Buzzer*1
- 10K resistor*1
- Breadboard jumper wire *6
Experiment Connection:
- Connecting buzzer: Connect the controller board, prototype board, breadboard and USB cable according to the Arduino tutorial. Connect the buzzer to digital pin 8.
- Connecting flame sensor: Connect the sensor to analog pin 0.
You will find fritzing diagrams below outlining circuit connections for both the Arduino Uno and the Arduino Mega 2560.
Here’s what your project should look like once it’s finished.
Experiment Principle:
When it’s approaching a fire, the voltage value the analog port reads differs. If you use a multimeter, when there is no fire approaching, the voltage it reads is around 0.3V; when there is fire approaching, the voltage it reads is around 1.0V. The nearer the fire is, the higher the voltage is. So in the beginning of the program, you can initialize voltage value i (no fire value); Then, continuously read the analog voltage value j and obtain difference value k=j-i; compare k with 0.6V (123 in binary) to determine whether there is a fire approaching or not; if yes, the buzzer will buzz.
Let’s have a look at the code for the tutorial.
int flame=0;// select analog pin 0 for the sensor int Beep=9;// select digital pin 9 for the buzzer int val=0;// initialize variable void setup() { pinMode(Beep,OUTPUT);// set LED pin as “output” pinMode(flame,INPUT);// set buzzer pin as “input” Serial.begin(9600);// set baud rate at “9600” } void loop() { val=analogRead(flame);// read the analog value of the sensor Serial.println(val);// output and display the analog value if(val>=600)// when the analog value is larger than 600, the buzzer will buzz { digitalWrite(Beep,HIGH); }else { digitalWrite(Beep,LOW); } delay(500); }
This program can simulate an alarm when there is a fire. Everything is normal when there is no fire; when there is fire, the alarm will be set off immediately.
Prerequisites
This development track requires an investment a bit of hardware. See below for details –
- Arduino IDE –
- You will need to download and install the Arduino development IDE.
- The approach to installation, configuration, setup of the Arduino IDE is covered in our tutorials.
- Arduino Uno, Sensors, etc. –
- You will need to purchase the Super Learning Kit for Arduino from OzToyLib.
- The Arduino Advent kit has all the sensors you need to perform the tutorials covered in this development track.
- If you do not have an Arduino Uno or Arduino Mega 2560 you might want to head over to Arduino boards and pick one up now.
The Super Learning Kit for the Arduino kit has all the sensors you need to perform the tutorials covered in this development track.
About the Super Learning Kit for Arduino
The Super Learning Starter Kit for Arduino comes packed with ~35+ different electronic bits (Sensors, LEDs, switches, LCD, servo, etc.) and can be purchased with either the Keyestudio UNO R3 or the Keyestudio Mega 2560 board. The Keyestudio Arduino boards can be used to interface with the different electronic bits i.e. sensors, LED’s, switches, servos, etc. included in the starter kit. The starter kit for the Keyestudio Uno R3 offers a great opportunity to explore the world of electronics using the Arduino Development Platform. Interact with the real world through the various sensors, create innovative projects, learn how to program the micro:bit to read data from the sensors and perform certain actions. The starter kit for the Arduino is a great way to dive into the awesome world of electronics and get started with your own STEM (Science, Technology, Engineering, Math) learning journey.
The Arduino advanced study kit walks you through the basics of using the Arduino in a hands-on way. You’ll learn the fundamentals of electronics and working on the Arduino through building several creative projects. The kit includes a selection of the most common and useful electronic components with a book of 32 projects. Starting the basics of electronics, to more complex projects, the kit will get you interacting with the physical world using sensor and actuators. Along with the kit you get access to detailed tutorials and wiring diagrams.
You can purchase the Super Learning Kit for Arduino from OzToyLib.
About the Arduino UNO
The Arduino UNO is the most used and documented board of the whole Arduino family and very easy to setup, play with. The Arduino UNO is a microcontroller board based on the ATmega328 . The Arduino UNO has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button. Here’s a listing of the some of the features of the Arduino UNO –
- Microcontroller: ATmega328
- Operating Voltage: 5V
- Input Voltage (recommended): 7-12V
- Input Voltage (limits): 6-20V
- Digital I/O Pins: 14 (of which 6 provide PWM output)
- Analog Input Pins: 6
- DC Current per I/O Pin: 40 mA
- DC Current for 3.3V Pin: 50 mA
- Flash Memory: 32 KB of which 0.5 KB used by bootloader
- SRAM: 2 KB (ATmega328)
- EEPROM: 1 KB (ATmega328)
- Clock Speed: 16 MHz
Arduino is an open-source, prototyping platform and its simplicity makes it ideal for hobbyists to use as well as professionals. The Arduino UNO contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. The Arduino UNO differs from all preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it features the Atmega8U2 microcontroller chip programmed as a USB-to-serial converter. “Uno” means one in Italian and is named to mark the upcoming release of Arduino 1.0. The Arduino Uno and version 1.0 will be the reference versions of Arduno, moving forward. The Uno is the latest in a series of USB Arduino boards, and the reference model for the Arduino platform.
You can read more about the Arduino here – www.arduino.cc.