Gas Sensors

Since I’m addicted to cheap ebay electronics, I had to pickup an assortment of these MQ Gas sensor modules. I got an MQ-5, 9, and 135. I initially thought that these would all measure different levels of different types of gasses, but after more reading and experimenting it seems like they all seem to measure the same gasses just with different sensitivities. So my board with three of them on it might be overkill but they’re so cheap!

Anyhow, I made use of an arduino nano to serve as a USB ADC. The super basic sketch running on it simply waits on the serial port for “get_aX” command and returns the value read from X analog input as an integer. The connections to these things are dead simple, just provide VCC and GND and then connect the A0 pins to the Ain pins of the arduino. The only catch I found was that they draw about 100-200mA each, which means that if you feed them and the arduino from the USB 5V it can be too much for the USB port. I’m planning on plugging mine into a raspberry pi that doesn’t have much to spare, so I feed the Vcc of the sensors from a separate 5V supply.



The idea is to hook this up to the Raspberry Pi in my basement, that’s already operating as my thermostat/data logger, and have it start logging what it sees….I’m not sure what that’ll be, but I’m curious to see if it can detect any leakage from the water heater or furnace exhaust. After I get some bulk data I might be able to even set it up with an email notification for higher than normal levels of CO or natural gas detected, not that it’ll ever be a replacement for the real CO alarms that’re installed throughout the house.

It works pretty well so far. Tested on the bench it could definitely detect the gases coming off a little butane torch. We’ll see what it shows after spending a week in the basement, I don’t expect to see many gas leaks but it might be able to tell me when it’s time to change the litter box…


It’ll connect up to my thermostat project board via USB. A small python application will be running on the Pi to pull the values off the arduino and log them to the mysql database. Code’s up at for anyone interested


Tags: , , ,

Trackbacks / Pingbacks

  1. Red River Thermostat 2.0 | Ryan's Notes - April 23, 2016

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: