Maker Pro

Simple Smoke Detector using ATtiny85

August 31, 2022 by AFZAL REHMANI

In this Tutorial We are Going To Make a Simple Smoke Detector using ATtiny85


In this tutorial, we are going to make a Simple "Smoke Detector" Alarm using an ATtiny85 microcontroller. In a world with so much instability, we are always in danger of being caught by a fire, which may be harmful to both the environment and individuals. If we don't take any safety precautions, the odds of being caught in a fire are substantially higher. As a result, a smoke detector should always be present to alert people to the presence of a fire, allowing them to take appropriate action to avoid any loss or damage. This circuit is simple and quick to construct, and it includes an MQ2 smoke that can sense any fire, smoke, or gas. For output, the buzzer is used as an indicator.

PCBWay commits to meeting the needs of its customers from different industries in terms of quality, delivery, cost-effectiveness, and any other demanding requests. As one of the most experienced PCB manufacturers in China. They pride themselves to be your best business partners as well as good friends in every aspect of your PCB needs.

Hardware Components

Smoke Detector Circuit

Arduino Code

#define MQ2pin (2)  // PB2 Of ATtiny85
float sensorValue;  // variable to store sensor value
int Buzzer = 3;     // PB3 Output Buzzer

void setup()
  pinMode(Buzzer, OUTPUT);
  delay(20000); // allow the MQ-6 to warm up

void loop()
  sensorValue = analogRead(MQ2pin); // read analog input pin 0

  if(sensorValue > 300) // Smoke Detected
  delay(2000); // wait 2s for next reading

Working Explanation

Connect and interface the MQ2 Gas Smoke Sensor with Arduino UNO using the schematic given above. Please copy the code mentioned above and paste it into your Arduino IDE. After that, upload the code in Arduino UNO. observe the readings on the Serial monitor. To examine the drastic changes in the readings, take the device to some smoky place. As a result, you can see the changes happening on the serial monitor. 

Application and Uses

  • It can be utilized in systems that monitor air quality.
  • It can also be used in gas leak detection equipment.
  • Also in the equipment that detects fires.
  • This circuit can also be used by gas leak detectors in the home.
  • This circuit might be used in an industrial combustible detector.
  • One of its uses is portable gas detectors.
  • You can use it in safety maintenance equipment.
  • It may be employed in any safety-related equipment

Related Content



You May Also Like