Smoke Detector

SRJT10202

Jugaadu and Chandu are good friends. Chandu is a science enthusiast. He conducts science experiments using lighter, matchsticks and burners. Once while performing experiments, the fire broke out in his lab. Due to this incident, he had stopped experimenting altogether. He has confessed his fears to Jugaadu. Jugaadu being his close friend wants to help Chandu. Can you help Jugaadu to create a safe environment for Chandu?

  1. Arduino UNO UNO
  2. Precision Screwdriver
  3. Motor Driver IC
  4. USB Cable
  5. Jumper cables
  6. Water Pump
  7. A plastic container
  8. Glue gun
  9. Tape
  10. 12V Battery
  11. Cutter
  12. Pipes
  13. MQ135
We can make a fire alarm and safety device together. With the help of the smoke sensor, that can sense the fire. If fire breaks out, we can start water sprinkling to control the situation.

    int r=3;
int g=5;
int b=6;
int pumpp=11;
int pumpn=10;

void setup() {
// put your setup code here, to run once:
pinMode(r,OUTPUT);
pinMode(g,OUTPUT);
pinMode(b,OUTPUT);
analogWrite(4,255);
digitalWrite(8,1);
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:

Serial.println(analogRead(A0));
if(analogRead(A0)>160){
analogWrite(r,0);
analogWrite(g,255);
analogWrite(b,255);
digitalWrite(pumpp,1);
digitalWrite(pumpn,0);
}else{
analogWrite(r,255);
analogWrite(g,0);
analogWrite(b,255); 
digitalWrite(pumpp,0);
digitalWrite(pumpn,0);
}
}
                                    

You might be interested in/Similar Items