Introduction: Handheld Propane (LPG) Sensor

We heat our house with a propane forced air furnace and have always wondered if any of the propane was leaking into our living space. The propane leak tool couldn't answer this question, so we needed a purpose-built sensor.

I need to mention right at the start that the MQ-6 sensor is designed to measure LPG concentrations of over 200PPM. The propane concentration in a house heated by a central furnace will be below that, unless there is a major propane leak in the system. However, the sensor will provide some indications of propane presence even below 200PPM, we just won't be able to determine exact concentration.

Please be aware that this is not a professionally designed and commercially built device. Do not base decisions impacting your safety and wellbeing on the values you get from it. If you suspect a gas problem of any sort, get help immediately, regardless of what you measure!

All the files for this project are available in my GitHub repository, both ones uploaded here and those that are not supported by the Instructables.

Supplies

Supplies

Selected tools

  • 3D printer
  • Soldering iron

Step 1: MQ-6 Gas Sensor

MQ-6 is one of a series of gas detection sensors. The gas concentration is measured indirectly: sensor contains a resistor plate that, when heated, changes resistance depending on the gas concentration - the higher the concentration, the lower the resistance.

Both the heater and the resistor use 5V. Heater needs up to 750mW, too much for the Nano voltage regulator. We use CUI Inc VXO7805-500-M non-isolated DC switching regulator to drive the heater, since it provides up to 2.5W.

MQ-6 is sensitive to a range of gases. In addition to LPG (liquid petroleum gas), propane, iso-butane and LNG, it also detects H2, CH4, CO and alcohol. If your target space is exposed to gases other than LPG, you will need a more complex system: other MQ series sensors are sensitive to other gases and runing several sensors would enable you to analyze different detected concentrations and better infer the concentration of each component gas. People have built such "artificial noses", but they lie beyond the scope of this Instructable. Would be a cool project, though.

MQ-6 spec refers to "LPG in clear air", meaning that the other detectable gases are not present. The conversion from the measured sensor resistance to gas concentration is given for air temperature of 20C and relative humidity of 65%. We use DHT 20 relative humidity and temperature sensor and use the curves provided in the spec to correct the MQ-6 measurements.

My experience indicates that the temperature and humidity correction may not be quite accurate if the temperature is very low - when I was building this project, the outside temperature was below freezing. This seemed to give a bit too high of a reading, even with correction.

When the device is turned on, MQ-6 has to be warmed up in calibrated. Calibration must be done in clear air, with none of the gases that are detectable by the sensor present. We wait for 30 seconds, which I found is enough for the sensor to heat up and the measurements to settle down.

Once we have the resistance in clear air, the base resistance Ro is given as 1/10 of the clear air resistance. This is resistance for 1000PPM. Note that the graph for the PPM conversion has a curve labeled "air" that is pegged at 10, which supplies this ratio.

To obtain the LPG concentration, we measure the resistance, correct for the temperature and humidity, divide by Ro and look up the PPM using the LPG line in the graph. The correlation is only valid above 200PPM (ratio a bitover 1.4), but looking at the ratio will give us at least some indication of LPG presence - the lower the ratio, the higher the concentration.

SparkFun sells a breakout board for the sensor. It's not really necessary, since you can just solder the wires to sensor contacts. However, I found it useful for mounting the sensor in the housing. You can use a piece of PCB prototype board instead.

Attachments

Step 2: DHT 20 Humidity and Temperature Sensor

DHT 20 communicates with Arduino using I2C protocol. It takes a little while to respond to the changing environment, especially to the large swings in temperature. I2C implementation is compatible with Arduino, with DHT 20 using a 7 bit address.

Step 3: The Circuit

I used Fritzing to design the circuit. In addition to the attached Fritzing file, you will need custom parts for VXO7805 and DHT 20, both from the GitHub. We use the available part for the gas sensor breakout board to stand for MQ-6.

Since I wanted a small device that would fit nicely in hand, I didn't mount all the components onto a single PCB. We have a small piece of prototype board to attach the voltage regulator and headers for ground and 5V. This piece is hardest to fit into the enclosure - it would probably be easier if the regulator and headers were put on separate boards. You will need 5 ground and 4 5V connectors. My board has 5 5V connectors, just in case I miscounted.

Separate voltage regulator powers only the heater, so we don't need to put in the extra components to dampen any voltage fluctuations. The rest of the components are powered by the Nano voltage regulator. The remote on/off connector on the voltage regulator is left unconnected.

A switch turns on the power from the 9V battery. If Nano is connected to USB, the device will turn on, but the readings will not be accurate unless the battery power is turned on, since the heater will remain off. Note that the heater has to be turned on immediately, since the sensor must warm up before calibration ends.

Leads to the battery are soldered to two short pieces of compression string. Battery compartment is designed in such a way that the door won't close unless the battery is put in the right way.

Step 4: 3D Printed Housing

The housing is printed in four pieces. The two major pieces are top and bottom halves. We also have the battery cover and a strut that is friction-fit to hold the display in place.

The battery box has supports above and below, but some of the supports in the top half of the housing have to be removed to make space for the display. See pictures.

Two screws hold the housing together. The screw holes are tight enough that M3 machine screws will hold without a need for any nuts.

I used PLA to print the housing, but any hard filament will work fine.

I used OpenScad to design the housing. You will find the main module, housing.scad in GitHub. You will also need the components directory that contains my library files for the 9V battery housing. You only need these files if you want to make changes to the housing.

Step 5: Arduino Sketch

We use Wire library for I2C communication and Adafruit GPX Library to drive the display. If you changed the resistor for measuring the MQ-6 resistance, you need to change the ref_resistance variable from 33 to whatever your resistor is in kilo ohms. Otherwise, you can use the sketch as is.

There is a bit of code to manage various items we display on the LCD, center where needed and update as values change without too much of a flicker.

If Nano is connected via USB, more detailed output is available via the serial connection.

If you look at the code, you'll notice that there is no much output or error handling if DHT 20 doesn't initialize, or MQ-6 takes a really long time to settle down at start. I haven't found this to be a problem but, if the device doesn't start, attach the serial port and the output in serial monitor will tell you what's going on.

Step 6: Assembly

Make sure that DHT 20 faces away from MQ-6. They are far enough that the MQ-6 heater shouldn't impact the temperature measurement, but better safe than sorry.

Springs should protrude into battery space just past the divider between the contact cavities. This will make sure that there is good contact and the springs don't have to compress too much when the battery is pushed in to close the door. Springs will stay in place without gluing.

Nano fit is very tight and will take patience to get it in place, but once there it won't wiggle. I found it better to attach the wires to Nano before putting the Nano in. I used Nano with headers, but a Nano with wires soldered in should fit fine into the slot.

While the LCD comes with a header that can be soldered in, there is no space in the housing for the header - solder the wires directly to contacts. I used 8 wires from a Cat5 cable, since that made it easier to track which wire is which.

There is not quite enough space for the wires plugged into bottom headers of the MQ-6 breakout plate. It would have been better to solder the one of the two sets of connectors directly so it will fit, but if you bend the connections a little, it will fit.

I used shrink tubing where needed to insulate bare wire. Shrink tubing DHT 20 connectors will additionally make the sensor fit into housing without moving.

Fitting in all the wires is finicky. Wires can't be too short, since display and the on/off switch are in top half of the housing. As mentioned before, getting everything together would have been easier if I separated the headers to a separate piece of PCB from the voltage regulator. A thin screwdriver comes in handy to push various wires into place.

Step 7: Usage

To use the sensor, go outdoors, or someplace you know the air is clear of propane. Wait a bit until the sensor adjusts to the ambient temperature and turn the device on.

The device counts down 30 seconds while it warms up. Ambient relative humidity (RH, in %) is displayed on the bottom of the display, as well as the current temperature (T, in C). When the sensor warms up, it should display "< 200" on the PPM line and a number near 10 on the line below, marked "r" for ratio. Since the sensor oscilates a bit, the ratio may climb a smidge over 10.

Once you get to a space that you want to check for propane, wait until the displayed temperature gets to be the actual temperature (small differences don't matter).

But be aware that any reading is not from a reliable device designed and built by professionals. If you have any suspicion that there is a gas problem in your space, get help quickly and don't rely on this sensor to decide all is well.

I am really reluctant to say anything about interpreting the numbers you see. I'd be worried if the concentration is not "< 200", but I can't speak to what values of "r" are reason for concern. Use your judgement!