A smoke detector is a device that senses smoke, typically as an indicator of fire. Commercial security devices issue a signal to a fire alarm control panel as part of a fire alarm system, while household smoke detectors, also known as smoke alarms, generally issue a local audible or visual alarm from the detector itself or several detectors if there are multiple smoke detectors interlinked.
CIRCUIT DIAGRAM
CODE
//import LiquidCrystal library
#include<LiquidCrystal.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
int gasSensorA = A5;
int sensorValue = 0;
void setup()
{
pinMode(A5, INPUT);
Serial.begin(9600);
pinMode(7, OUTPUT);
lcd.begin(16, 2);
}
void loop()
{
sensorValue = analogRead(gasSensorA);
Serial.println(sensorValue, DEC);
if (sensorValue > 20)
{
sensorValue = analogRead(A5);
Serial.println(sensorValue);
digitalWrite(7, HIGH);
{
lcd.begin(16, 2);
lcd.print(" DONT PANIC ");
lcd.setCursor(0,1);
lcd.print(" DIAL 101 ");
delay(200);
}
for(int PositionCount=0;PositionCount<16; PositionCount++)
{
lcd.scrollDisplayLeft();
delay(150);
}
}
else
{
lcd.begin(16, 2);
lcd.print(" HELLO ");
lcd.setCursor(0,1);
lcd.print(" HAVE A GREAT DAY ");
digitalWrite(4, HIGH);
}
for(int PositionCount=0;PositionCount<16; PositionCount++)
{
lcd.scrollDisplayLeft();
delay(150);
}
}
Comments