FLAME SENSOR(with LED)

FLAME SENSOR
ARDUINO CONNECTION WITH FLAME SENSOR

HOW TO CONNECT IT TO ARDUINO?


Steps to connect the sensor to Arduino-:

1- Connect the VCC pin of the sensor to the 5V pin of Arduino.

2- Connect the AO or DO pins to any of the ANALOG or DIGITAL pins on the Arduino. In this setup I have connected the DO pin of sensor to the 8th DO pin on Arduino.

3-Connect the GND pin of sensor to the GND pin of the Arduino.

HOW TO CODE?

After establishing the connection given below we have to connect the Arduino to any device to type the respective code mentioned below.

 int led_pin = 13 ;// initializing the pin 13 as the led pin
int flame_sensor_pin = 8 ;// initializing pin 8 as the sensor output pin
int flame_pin = HIGH ; // state of sensor
void setup ( )
{
Serial.begin ( 9600 );// setting baud rate at 9600
pinMode ( led_pin , OUTPUT ); // declaring led pin as output pin
pinMode ( flame_sensor_pin , INPUT ); // declaring sensor pin as input pin for Arduino
}
void loop ( ) {
flame_pin = digitalRead ( flame_sensor_pin ) ; // reading from the sensor
if (flame_pin == LOW ) // applying condition
{
Serial.println ( " FLAME , FLAME , FLAME " ) ;
digitalWrite ( led_pin , HIGH ) ;// if state is high, then turn high the led
}
else
{
Serial.println ( " no flame " ) ;
digitalWrite ( led_pin , LOW ) ; // otherwise turn it low
}
}
DONT FORGET TO LIKE AND SUBSCRIBE AND PLS DO COMMENT YOUR SUGGESTIONS BELOW…
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s