In this project, we designed a practical and low-cost gas detection system using the MQ-2 gas sensor and the ATtiny13 microcontroller. The circuit is capable of detecting smoke and various combustible gases, and when the sensor output reaches a defined threshold, the microcontroller activates its output automatically. This project is ideal for electronics enthusiasts, embedded system learners, robotics developers, and anyone interested in sensor interfacing and microcontroller programming.
The MQ-2 sensor is one of the most popular gas and smoke sensors because of its simplicity, low price, and high sensitivity. It can detect gases such as LPG, methane, propane, hydrogen, and smoke. In this project, the analog output of the MQ-2 sensor is monitored by the ATtiny13 microcontroller. When the gas concentration increases and reaches the configured sensitivity level, the microcontroller activates an output signal. An LED is connected to the output to visually demonstrate the activation status of the system.
One of the useful features of this circuit is the adjustable sensitivity control. A potentiometer is included in the design so users can easily adjust the sensitivity of the gas detection system according to their environment and application. This makes the project flexible and suitable for different scenarios such as home safety systems, gas leakage alarms, smart automation projects, laboratory experiments, and educational electronics projects.
The firmware for this project is written in CodeVisionAVR and is fully editable. Developers and students can easily modify the source code, improve the algorithm, or add new features to the system. In the project explanation, suggestions are also provided for increasing detection accuracy and improving overall circuit performance. This makes the project not only useful as a ready-to-build circuit but also an excellent learning platform for AVR programming and sensor interfacing.
Make sure to listen to the instructions carefully (Important ).👇
The circuit design and electronic layout are optimized for practical implementation and easy use in simulation. The project can be further expanded by adding buzzers, relays, wireless modules, displays, or IoT connectivity. Because the ATtiny13 is compact and energy efficient, this design is also suitable for portable and battery-powered applications.
If you are looking for a simple but powerful electronics project involving gas sensing, embedded programming, and circuit simulation, this project can be a great choice for learning and development. It is beginner-friendly while still offering enough flexibility for advanced users to customize and upgrade the system.
You can download all project files for free from the link below, including:
-
Circuit schematic
-
CodeVisionAVR source code
-
HEX file
-
Project documentation
Enter your email address to receive the download link

