BackgroundThis project evolved one weekend after "experimenting" with an alcohol sensor and my Arduino UNO. I was surprised at how easy it was to set up. After showing a friend the different types of sensors available we agreed that a gas leak detector would be a worthy project. In Costa Rica we don't have that many accidents due to gas leaks but they do happen. EDIT: I guess they happen more than I thought. Once my housekeeper was cleaning the stove and accidentally left a gas burner open. When I arrived home at night all the gas in the cylinder was gone. Luckily our houses in Costa Rica are well ventilated and there was no explosion. The idea of this alarm is to beep and flash a LED when butane/propane (LPG) is detected.The sensorThe LPG Gas Sensor MQ-6 is very easy to connect to your Arduino. Here are instructions how to wire it up and test with some quick code. Basically, there are two parts to the sensor. The first circuit is a heating coil that connects to 5VDC. This uses about 150mA of current and keeps the sensor element warm. The second circuit is a variable resistor that varies according to the detection of butane/propane. So all we have to do it read the voltage using one of the analog pins on the Arduino and alarm when the voltage gets to a specific set point. The schematicFor this circuit I wanted to keep the costs down. Using an Arduino UNO in any project adds $30 so I decided to try my luck using the ATmega328p microcontroller directly. Here is the schematic for the circuit. Note that I am not using a crystal for the microcontroller but instead am using the internal clock set to 8MHz. The schematic says ATMEGA168 but it really is the 328. The Fritzing part says 168.
Circuit DescriptionUp in the upper left corner we have a basic DC regulator circuit using an LM7805 purchased at RadioShack. The input should be between 7 and 12 VDC, however I recommend not going over 9VDC as the regulator heats up quite a bit and will need a heatsink. The output of the regulator gives us 5VDC. In the upper right hand side of the schematic we see the stylized representation of the sensor circuit. The heater element connects directly to 5VDC and GND.
|
|
Home >