martyr
Posts: 11
Joined: Tue Apr 14, 2015 5:59 pm

MQ-4 Gas Sensor with Raspberry

Fri Apr 17, 2015 11:32 am

Hello everyone,
I have just ordered my Raspberry and i want to build a gas sensor.

I have found MQ-4 is available on my local store.
However, is that possible to use MQ-4 sensor with Raspberry?

I did some research and many others says that i need an ADC converter.
Is that really necessary?

May you take a look the datasheet and product?
https://www.pololu.com/file/0J311/MQ4.pdf

http://www.robotistan.com/Metan-Gaz-Sen ... R-681.html

I want to build something similiar https://www.youtube.com/watch?v=Yv8-mPuJaQ0

But it uses Ardunio.
I want to implement same thing with Raspberry.

Thanks.

User avatar
joan
Posts: 14960
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: MQ-4 Gas Sensor with Raspberry

Fri Apr 17, 2015 11:38 am

The Pi only has digital gpios. The MQ-4 outputs its reading as an analogue voltage. You need an ADC if you want to use it on the Pi.

martyr
Posts: 11
Joined: Tue Apr 14, 2015 5:59 pm

Re: MQ-4 Gas Sensor with Raspberry

Fri Apr 17, 2015 11:41 am

Hello joan,
I am new to electronics, Is there any alternative to instead of using ADC?
A digital sensor maybe?
Thanks.

User avatar
joan
Posts: 14960
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: MQ-4 Gas Sensor with Raspberry

Fri Apr 17, 2015 1:59 pm

martyr wrote:Hello joan,
I am new to electronics, Is there any alternative to instead of using ADC?
A digital sensor maybe?
Thanks.
I guess so. Look for a sensor which give serial, I2C, or SPI outputs.

Why are you not keen on an ADC? Is it just the inconvenience or are there other reasons?

martyr
Posts: 11
Joined: Tue Apr 14, 2015 5:59 pm

Re: MQ-4 Gas Sensor with Raspberry

Fri Apr 17, 2015 4:10 pm

Hello,
Just wanted to keep it simple.
I am not sure if i m able to connect ADC. Not much skills on electronics :)
And one last thing, in case if i got a sensor, how can i provide power to it?
Thanks.

rioevolved
Posts: 3
Joined: Sun Feb 08, 2015 1:00 pm

Re: MQ-4 Gas Sensor with Raspberry

Sun May 03, 2015 5:23 am

you can use the example from these links.
http://www.learningaboutelectronics.com ... rry-pi.php
http://raspberry.io/projects/view/readi ... converter/

these helped me build my smoke detector using mq2 and raspberry pi. But you need mcp3002 ADC first.

Is anybody know how to connect two or more mq sensors to raspberry Pi?? because one mq sensor can only show one value at a time and I need to detect several types of gas.

User avatar
joan
Posts: 14960
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: MQ-4 Gas Sensor with Raspberry

Sun May 03, 2015 8:01 am

rioevolved wrote: ...
Is anybody know how to connect two or more mq sensors to raspberry Pi?? because one mq sensor can only show one value at a time and I need to detect several types of gas.
Using an ADC with more than one channel is the simplest way.

A MCP3002 has two channels (two sensors).
A MCP3004 has four channels (four sensors).
A MCP3008 has eight channels (eight sensors).

Return to “Automation, sensing and robotics”