Editor Version ×
Standard

1.Easy to use and quick to get started

2.The process supports design scales of 300 devices or 1000 pads

3.Supports simple circuit simulation

4.For students, teachers, creators

Profession

1.Brand new interactions and interfaces

2.Smooth support for design sizes of over 5,000 devices or 10,000 pads

3.More rigorous design constraints, more standardized processes

4.For enterprises, more professional users

Ongoing

STD Smoke Detector with Arduino

License: Public Domain

Mode: Editors' pick

  • 336
  • 0
  • 0
Update time: 2022-07-06 19:46:35
Creation time: 2022-07-05 03:28:25
Description

In many homes, accidents with cooking gas occur because people forget to close the valve. The gas leaks and can generate two major accidents: explosion or death by aspiration in large quantities during sleep.

One of the ways to avoid this is through a gas presence monitoring system. This is done through the use of sensors.

In this article we will build a system to monitor the presence of cooking gas. We will develop an electronic control board and an enclosure to store the circuit structure. See some images of this project.

IMG_9847.JPG

The 3D enclosure design was developed with JLC3D. The entire structure was designed to be manufactured with the resin material to obtain a better finish and surface quality of the structure.

This enclosure costs approximately $6.50. However, JLC3D offers a $5 discount coupon for you to print this or another project. Use the JLC3D coupon and receive the 3D enclosure in your home.

image.png

Download all project files through this link.

Below we will explain the complete development of the project.

Flammable Gas and Smoke monitor development

The following structure represents the electronics that were the gas sensor:

GasDetector.png

As you can see, you will use 4 electronic elements:

  • Control board with ATMEGA328P-AU CHIP;
  • MQ-2 Gas Sensor;
  • Female Jack connector for 9V power supply;
  • Enclosure.

The project is divided into two parts: the electronic structure and the enclosure. Next, we will see the operation of the electronic circuit.

Project Electronic Circuit

We developed an electronic board with an ATMEGA328P-AU CHIP. This circuit was developed to facilitate development and testing for several prototypes that use few digital inputs and outputs and occupy a small space. Below we have the structure of the electronic board.

PlacaSensor2.png

The electronic board has pins for in-circuit recording (+5V, GND, TX, RX and DTR). In addition to them, we put access to other digital and I2C pins. The latter allow, for example, the use of an LCD with I2C.

Below we have the complete schematic of the electronic circuit.

Schematic.png

The electronic design of this board is available for download. You can download and win 5 free JLCPCB units. To do this, just follow the steps below.

The board with the ATMEGA328P is designed to receive the connection of the MQ-2 sensor and the buzzer.

The MQ-2 sensor is responsible for reading the environment and detecting possible particles of butane gas. This sensor is powered with 5V and has two forms of signals: one analog and one digital.

See its structure in the figure below.

image.png

The sensor is installed in the internal structure of the enclosure.

GasDetector v3.png

In addition to the sensor and the electronic board, we have a Jack connector to facilitate powering the internal circuit.

Next, we have the enclosure structure developed for the project.

3D Development of the Project Enclosure

Enclosure was developed to facilitate the installation of the electronic circuit and to better present the quality of the prototype.

555.png

The prototype structure was developed with several holes in the upper region and cuts in the lateral regions. This facilitates the entry of gas into the sensor region.

The enclosure structure is divided into two parts: top cover and base.

Below is the base figure.

BaseCircuito.png

It has all the holes for fixing the electronic control board and the sensor. In addition to the fixing holes for the plates, we have 4 holes at the ends fixing the base with the cover. See the figure below.

baseinvertida.png

The base frame has a fifth hole to allow the user to adjust the sensitivity of the sensor.

 

Finally, we have the enclosure lid. As already mentioned, its structure has several cuts to facilitate the entry of gas into the internal region of the circuit. See the figure below.

Tampa_Enclosure_Gas_Detector.png

The internal structure of the lid has 4 holes. Insert nuts will be installed in each hole to allow the fixing of the base screws. The figure below shows the side view of the internal structure of each hole.

Corte_lateral.png

The front hole shown in the figure above was created for fixing the Jack connector. This connector is used for external power with a 9V supply. See the figure below.

Enclosure_gas_detector_jack.png

 

Now we will talk about the structure of programming logic for gas monitoring.

How to produce 3D Enclosure with JLC3D

Firstly, you need access the JLC3D Website through this link and click in Add 3D files button to upload each file of your project.

After, all files will be presented and you need to select 3D Techonology, Material and other parameters to produce your 3D print project.

This project, for example, was selected to be produced with SLA Technology, LEDO 6060 Resin, Natural White color and will be produced in 48 hours.

The total to produce two pieces will be an amount of $6.26. It's very cheap!

Enjoy and access JLC3D to create any prototype!

Now, we'll understand the programming logic of the project.

Development of programming logic

The programming logic for the project consists of reading the sensor and monitoring the level of gas present in the environment. If this value exceeds a defined threshold, then the system will trigger a buzzer to alert users.

There are two ways to perform the sensor reading. The first is through reading the analog signal, and the second is through the digital output. In this second option, we must adjust the threshold through the potentiometer. Whenever the analog signal exceeds the set value, then the digital output will be at 5V. Otherwise, the output will have the value 0V.

In this project we will use the digital output of the MQ-2 sensor. Next, we will present the project control code.

void setup()
{    

pinMode(12, INPUT);    
pinMode(13, OUTPUT);

}

void loop()
{    

sensor = digitalRead(12);
    
if(sensor == 0)    
{        
   digitalWrite(13, HIGH);    

}        

if(sensor == 1)    
{        
   digitalWrite(13, LOW);    
}

}

The code is very simple. The Arduino will read the digital input that the sensor is connected to. If the amount of gas/smoke is above the value configured in the sensor trimpot, then the sensor output will be high logic level (5V). In this situation, the Arduino will activate the output (D12) and trigger the buzzer.

Otherwise, the Buzzer will be turned off.

See some images of the structure that was printed.

IMG_9852.JPG

The enclosure is available for download and you can download it and use it in different electronic projects.

Go to this link and download all the files.

Conclusions

The above project was developed and is available to be applied for the study and development of electronic projects with the MQ-2 sensor.

The Enclosure has internal dimensions of 62 mm x 62 mm and can be used in numerous electronic projects. Soon we will present the result of this case printed in resin with the JLC3D and we will make a comparison with the FDM technology.

Thanks to JLC3D for providing free samples of enclosure for further testing. Access JLC3D and use the $5 discount coupon JLC3D.

 

Design Drawing
schematic diagram
1 /
PCB
1 /
The preview image was not generated, please save it again in the editor.
Project Attachments
Empty
Project Members
Related Projects
Change a batch
Loading...
Add to album ×

Loading...

reminder ×

Do you need to add this project to the album?

服务时间

周一至周五 9:00~18:00
  • 0755 - 2382 4495
  • 153 6159 2675

服务时间

周一至周五 9:00~18:00
  • 立创EDA微信号

    easyeda

  • QQ交流群

    664186054

  • 立创EDA公众号

    lceda-cn