Flame Sensor Interfacing with LPC2148

In this tutorial we are going discuss Flame Sensor Interfacing with LPC2148.


Before start this tutorial we should know below topics. If you know already, please go further.

Components Required

  • LPC2148 Development Board
  • Flame Sensor
  • LCD Module (To print the Sensor output)


Fire is one of the most dangerous events possible; somewhere in the world, one occurs every minute of every day. While fire can be our friend in some instances, it can be our worst enemy when it’s uncontrolled and allowed to continue through a building. Fire is, of course, destructive, and the smoke from a fire creates a toxic, dangerous atmosphere. The rapid detection of a fire and its control can save several thousand lives, thousands of injuries, and millions of dollars in property loss each year.

The flame is the visible portion of the fire. So if we find the flame, then we can also find the fire.

Characteristics of flame

All flames have certain characteristics in common that include:

  • Production of heat
  • Expansion of gases
  • Production of by-product of combustion
  • Emission of light (infrared or ultraviolet)
  • Ionization of the atmosphere in and around the flame

Flame detection systems have been developed to incorporate several of these characteristics.

Flame Detector

flame detector is a sensor designed to detect and respond to the presence of a flame or fire, allowing flame detection.

Today’s flame detectors utilize optical technologies to detect flames. Flames are known to emit electromagnetic radiation in the infrared (IR), visible light, and ultraviolet (UV) wavelengths depending on the fuel source.

Optical flame sensors are divided into many groups depending on which range of the total radiation band they are designed to detect:

  • Ultraviolet detector
  • Near IR array
  • Infrared
  • Infrared thermal cameras
  • UV/IR
  • IR/IR flame detection
  • IR3 flame detection
  • Visible sensors

Flame detector using Infrared

Since more than 90% of the flame’s total radiation is infrared, these detectors receive ample radiation of quite high intensity and will operate with either very weak or very hot flames. So in this tutorial we are going to use IR flame detector.

Flame sensors are available in the market in two types one having three pins and the other having four pins respectively. Both of the sensors can be easily interfaced to any micro-controller. I am using three pin flame sensor in this tutorial.

Note : If you are using 4-Pin sensor, you need to use D0 Pin to work with this example.

Flame sensor can detect fire or any other light sources whose wavelength is in the range of 760nm to 1100nm. This device consists of and IR sensor, an LED for indication, operational amplifier circuit and a potentio-meter. The device is sensitive to flame so when it detects the flame it turns on its LED to show an indication. The sensitivity of the flame sensor can be adjusted according to the requirements. It can be used at different places e.g. in offices, home, institutions, industrial applications.

Flame Sensor Interfacing with LPC2148


Flame Sensor

  • Vcc – 5v
  • Gnd – Ground
  • D0 – P1.24


  • RS – P0.8
  • RW – P0.9
  • EN – P0.10
  • Data Lines – P0.0 – P0.7

Flame Sensor Interfacing with LPC2148

Source Code

If it is detecting any flame in front of this sensor, LCD will display “Flame Detected”.

#define bit(x) (1<<x)
#define delay for(i=0;i<7000;i++);
#define FLAME (IO1PIN & (1<<24))
unsigned int i;
void lcd_int();
void dat(unsigned char);
void cmd(unsigned char);
void string(unsigned char *);
void main()
    IO0DIR =0XFFF;
    IO1DIR = 0x0;
    string("EMBETRONICX.COM ");
    while(1) {
            if(FLAME) {
                    string("Flame Detected");
void lcd_int()
void cmd(unsigned char a)
    IO0CLR|=bit(8);                //rs=0
    IO0CLR|=bit(9);                //rw=0
    IO0SET|=bit(10);               //en=1
    IO0CLR|=bit(10);               //en=0
void dat(unsigned char b)
    IO0SET|=bit(8);                //rs=1
    IO0CLR|=bit(9);                //rw=0
    IO0SET|=bit(10);               //en=1
    IO0CLR|=bit(10);               //en=0
void string(unsigned char *p)
    while(*p!='\0') {

Note: In our tutorial we are using 3-pin sensor. Only Digital output is available in this sensor. If you want to use 4-pin sensor, you can use 4-pin sensor’s D0 Pin. But somebody may want to use A0 pin in 4-pin sensor. In that case you cannot use this example. You need to use ADC for that case since it is not digital output.

0 0 votes
Article Rating
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x
Ads Blocker Image Powered by Code Help Pro
Ad Blocker Detected!!!

Dear User,

Thanks for visiting the site. Unfortunately, we have noticed that you are using an Ad Blocker extension in your browser.

We charge advertisers instead of the audience. We depend on Ad revenue to keep creating quality content for you. We guarantee clean ads. 


Click the AdBlock icon on your browser and click Enabled on this site to Disable AdBlock in embetronicx.com or whitelist our website.

If you still want to hide the ads, please become a Premium member. If you are a premium member already, then please log in.

Thank you for understanding.

If you are seeing this even after disabling all the ad blockers, Please report us the False Positive to [email protected]