mq9 notes

Active today
Viewed 36 times

I already have bmp180 sensor connected to raspberry pi 3b+, now I want to add MQ9 sensor like this https://e-radionica.com/en/mq9-gas-sensor.html

  1. Is connection straight forward like the bmp180?
  2. Second question is how to wire mq9 to rpi with already connected bmp180?
  • “Precision” won’t matter much since you will be using the binary HIGH/LOW output as the Pi has no analog input — but in any case discussions about the precision of specific sensors is more appropriate to our larger sibling site, Electrical Engineering (so I have edited that out). – goldilocks 18 hours ago
  • Do you maybe know how high/low outputs are differentiated? – PostarLakogSna 18 hours ago
  • I believe the screw dial (gray circle w/ philips head “X”) controls this, but I could be wrong. – goldilocks 18 hours ago
  • @PostarLakogSna, Ah, let me see. Here is my quick and dirty MQ9 Rpi interface summary: (1) MQ9 is a digital guy, can be adjusted by the heating/timing and loading/sensitivity pots/resistors to trigger High logical alarm signal when gas (CO or flammable) leaking, (2) It is not connected to SPI or I2C bus like BMP180 or other sensors, so, no conflict between BMP and MQ work same time, (3) It is easy to connect MQ9 output pin (directly or after logical level shifting, or adding a chip Schmitt trigger chip to prevent false alarm) to Rpi GPIO pin in input mode. In short, – No worries at all! 🙂 – tlfong01 12 hours ago   
  • @PostarLakogSna, Please let me know if your MQ9 module is similar to mine: imgur.com/gallery/MqXE3CH. or give me the link of yours (same as in your question?). Perhaps I can try to do some engineering experimentation for. MQ9 is a life critical thing, and I am just a friendly home automation hobbyist, so do ask for a professional opinion! 🙂 – tlfong01 12 hours ago    
  • @PostarLakogSna, You might also like to let me know if you wish to measure (1) Digital, (2) Analog, (3) PPM, (4) All above three together. To do analog or ppm, you need an ADC。 For, analog measurement, you can do early warning risk analysis before the red alarm alert trigger level is reached. For ppm, you can also recognize which type of gas is present, and send messages to you android smart phone, indicating level of risk etc. Below is my engineering experimentation log entry: penzu.com/p/93aaa16e This linked engineering experimentation report keeps updating, so stay “tuned” 🙂 – tlfong01 11 hours ago   
  • @PostarLakogSna, PPM measurement is interesting. The circuit is not that complicated. You can use the very popular Rpi friendly MCP3008 10 bit SPI ADC (Google AdaFruit or SparkFun for newbie friendly tutorials): Connect MQ9 Load resistor analog output to MCP3008, which in turn is connected to Rpi SPI. You can use colourful LEDs connected Rpi GPIO pins to indicate which type of gas is detected, or LED bars to indicate gas intensity etc . The ppm measurement tutorial: “How to Choose GAS sensor?” – theorycircuit.com. theorycircuit.com/choose-gas-sensor, Happy reading. Cheers! 🙂 – tlfong01 10 hours ago    
  • @PostarLakogSna, Now I have skimmed a Gas Detector Hnadbook and got a rough idea of all the detectors work. Now I am coming back the MQ9, a MOS detector. Next step is doing a Rp MQ9 PPM Circuit Analysis and Design. See update of my log book for more details. – tlfong01 7 hours ago   
  • @tlfong01 sensor is identical to one in the link. What I want to measure is the limit above which I want to trigger some signal. How can I configure this? I mean, having exact value would be nice but I am looking for minimum effort here with minimum additional components needed. I have already connected my temp/press/hum sensor to 5V pin, so there will be some double use. Generally, I would be grateful if you could answer me what I need in order to trigger signal when CO exceeds limit, and what if I measure exact values – PostarLakogSna 6 hours ago
  • @PostarLakogSna, This tutorial might help: “MQ2 for Rpi” tutorials-raspberrypi.com/…. I have updated my development notes to V0.3 with this tutorial reference. You can read the tutorial and let me know anything you are confused, and I can explain it as an appendix in my develop notes. Tutorial + comments has example code for MCP3008 and ADS1115, also level shifting to 5V. If you are not familiar with them, you might search “MCP3008”, in this forum. I could not find updated refs for Rpi + MQ9. Let me know if you find any. – tlfong01 6 hours ago   
  • @PostarLakogSna, Yes, if what you want is a High or Low signal, then you don’t need any ADC. You only need to calibrate the sensor, using the adj pot so that it trigger alarm HIgh level signal when the gas. CO, say, reaches a certain level. MQ9 is for CO, Coal, and Liquefied Gas. I don’t feel like to experiment with coal or liquid gas. What I can try is CO. Let me see, I can place the MQ9 in a gas jar, and light a candle to see if O2 decreases, CO increases, MQ9 shows anything. I know plenty of physics, but too little chemistry to do such experiments. Perhaps you can suggest anything. – tlfong01 5 hours ago   
  • @tlfong01 thanks, what do you mean by adj pot? so in this case I don’t need any resistors? My intention is to monitor CO only, so no problem about it. I will check all this later and let you know what bothers me – PostarLakogSna 5 hours ago
  • @PostarLakogSna, Ah, “adj pot” means “adjusting potentiometer” (the blue square pot which you can adjust with a small screw driver). For MQ9, it the the variable resistor Rp to adjust the reference voltage of the operational amplifier (OP AMP) comparator producing the digital output. The sensor resistor Rl is another thing. You need to read this tutorial to clarify things: “MQ137 Ammonia Gas Sensor Measuring PPM using Arduino – Aswinth Raj 2018feb09” circuitdigest.com/microcontroller-projects/…. – tlfong01 56 mins ago   
  • MQ9 schematic: imgur.com/gallery/YLEo8tq. For digital output, what you need to do are: (1) Set the gas (CO) density level to trigger alarm, (2) Turn 10k trim pot CW and CCW to find the trig point. Blue square trim pot sets the reference voltage for the comparator. But you don’t need to understand the details, if you are like me, a huge fan of Oliver Heavyside who says: “Should I refuse a good dinner simply because I do not understand the process of digestion?” (Criticized for using formal mathematical manipulations, without understanding how they worked). Bed time. See you tomorrow. – tlfong01 1 min ago   Edit   

2 Answers


The BMP180 is a digital device and connects via the I2C bus.

The MQ9 is an analogue device and produces a variable voltage. It can not be directly connected to the Pi.

You need to connect the MQ9 to an ADC (Analogue to Digital Converter) and connect the ADC to the Pi.

ADCs tend to have an I2C or a SPI interface. The choice is yours.


You can use a Arduino NANO for taking the MQ9 reading. Raspberry pi has no ADC inside so you have to get the value like this. Or use some sort of voltage detector(detects voltage and give us a certain value) that can digitise the values.

Your Answer

Categories: Uncategorized

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: