Arduino with Fire Sensor, LED and Buzzer
Hello everyone! Today I will show you how to use a fire sensor with arduino. The required kits are :
- An arduino and its adapter
- Few jumper Wires
- A fire sensor
- A led
- A breadboard
- A buzzer
- A lighter
- AO-Analog pin
- GND-Ground pin
- VCC-positive power pin
- DO-digital output pin
- Connect "VCC" pin of the sensor to 5V pin on the arduino.
- Connect "GND" ground pin to GND pin on the arduino.
- Connect "AO" analog output pin to any analog or digital pins on the arduino.In this tutorial I connected it with A2
- Connect longer LED leg to pin 13 on the arduino. If you want to use anyother pin on the arduino, you need to use a 220 ohm resistor.
- Connect shorter LED leg to GND pin on the arduino.
- FIx buzzer on the breadboard.
- Connect longer buzzer leg to pin 11(or any other pin) on the arduino.
- Connect shorter buzzer leg to GND pin on the arduino.
const int ledpin=13; // ledpin,flamepin and buzpin are not changed throughout the process
const int flamepin=A2;
const int buzpin=11;
const int threshold=200;// sets threshold value for flame sensor
int flamesensvalue=0; // initialize flamesensor reading
void setup() {
Serial.begin(9600);
pinMode(ledpin,OUTPUT);
pinMode(flamepin,INPUT);
pinMode(buzpin,OUTPUT);
}
void loop() {
flamesensvalue=analogRead(flamepin); // reads analog data from flame sensor
if (flamesensvalue<=threshold) { // compares reading from flame sensor with the threshold value
digitalWrite(ledpin,HIGH); //turns on led and buzzer
tone(buzpin,100);
delay(1000); //stops program for 1 second
}
else{
digitalWrite(ledpin,LOW); //turns led off led and buzzer
noTone(buzpin);
}
}
What type of sensor it is? If it's a 5 way flame sensor will that work the same way??
ReplyDeleteYOU GIVE CIRCUT DIAGRAM
ReplyDeletethanks a lot
DeleteSir will you give that for purchase ...
ReplyDeletewhy does it detect other than fire like sun light etc....
ReplyDeletewhat is the problem
ReplyDeleteThese LED Street Lighting System are Incredible! The LED Technology is comparatively new into the world which comes with a added benefit of collecting the data which can be used for analyzing the traffic pollution
ReplyDeleteWhere to write code in proteus
ReplyDeleteNo tune what
ReplyDeleteJumpers kon si leni hain
ReplyDelete