Pages: [1]   Go Down
Author Topic: about the mq2 / mq7 sensor  (Read 4441 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi, i hope i got the right place asking a question here,

so, recently, i have a school project about arduino, and i want to create a simple gas driven project,

so, i follow this link to connect the mq2 / mq7 gas sensor,
http://nootropicdesign.com/projectlab/2010/09/17/arduino-breathalyzer/

yet, no matter how many times i tried, the readings are so strange and i have no idea of what i could deal with the problem

here is some readings
23
0
0
0
0
1023
1023
1023
0
0
0
0
1023
1023
1023
0
0
0
285
1023
1023
327
0
0
1023
1023
1023
0
0
0
622
1023

anyone could help??
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Post your code please?
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

int sensorValue = 0;
int sensorPin = 9;

void setup()
{
  Serial.begin(9600);      // sets the serial port to 9600
  pinMode(sensorPin, INPUT);
}

void loop()
{
  sensorValue = analogRead(sensorPin);     // read analog input pin 9
  Serial.print(sensorValue);  // prints the value read
  Serial.print(" ");      // prints a space between the numbers
  delay(1000);              // wait 100ms for next reading
}

Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8706
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

pinMode(9, INPUT)  will set Digital I/O pin 9 to be a digital input.
analogRead(9) will read Analog Input pin 9 ?!?  Do you have an Arduino that has more than the usual 6 analog input pins (0-5)?!?
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thx for reply first,

actually, i have try to connect into analogue A0 at the bottom right of the arduino,
yet, the outcome is also almost the same, strange readings
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8706
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

From the readings it appears that you may have a bad connection somewhere or some bad noise in the input.  When you hook a multimeter between the input pin and ground do you get a nice steady voltage reading? 
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thx again, and i have checked immediately, i have gaineded steady voltage reading, and i have also checked the data sheet, http://www.winsensor.com/english/products/sms/jsq.asp?filename=MQ7.pdf, so, i am sure i am supplying 5.2 - 5.4 voltage to the circuit correctly, and the readings are still not ok ...

btw, is it necessary to pre-heat this sensor? i have found one point in the datasheet saying that it takes 2 days to re-heat the sensor,
so does it mean i have to supply 5 volt to the circuit for 2 days for reasonable readings?


sorry, i have a fairly ok knowledge only, thx for your patience, thxthxthx
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
btw, is it necessary to pre-heat this sensor? i have found one point in the datasheet saying that it takes 2 days to re-heat the sensor,
so does it mean i have to supply 5 volt to the circuit for 2 days for reasonable readings?

IIRC it is needed for calibration (only once). To use this sensor you have to apply 60sec 5Volts and then 90sec 1.4 Volts. Can be done with PWM. Measure at the end of a 1.4V cycle. So one reading every 2.5 minutes is possible.

This thread may be helpfull - http://arduino.cc/forum/index.php/topic,55780.0.html - Contact cronus as you learn about the same sensor.


Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sorry... i am still clueless of what i could do after i have tried several times...

so, now, how to wiring the sensor to give it a 60sec 5Volts and then 90sec 1.4 Volts?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sorry... i am still clueless of what i could do after i have tried several times...

so, now, how to wiring the sensor to give it a 60sec 5Volts and then 90sec 1.4 Volts?

since i don't have the breakout kit.. i don't have TOG Pin from sensor board, but six PINs AHA, BHA............

omg
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys.. anyone knows how to convert the analog input of mq-7 to ppm?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello all,
I have exact the same problem, and readings as you. Did you managed to make it work? or does anyone has a solution for this?
Logged

Pages: [1]   Go Up
Jump to: