Hi Everyone!
Im having troubles to understand the analog output mq7 module monoxide sensor. And the datasheet doesnt help at all.
So here is my question:
According to the datasheet this module detects between 10-1000ppm, so if i put the sensor inside of a upside down glass with a candle, this mean that the higher analog value would be match with 1000ppm? I kwon that is a rough approximation, but I dont have any other idea.
Have you googled "MQ7 Arduino" - I am sure you are not the first. Also it is worthwhile getting the datasheet for the MQ7 - try "MQ7 datasheet pdf" in google.
You can only do a linear interpolation if the sensor is linear. The response curve will be on the datasheet information. It looks pretty linear and they also give good ideas on the responsiveness, etc
Lowest analog value (0) will be the lowest value for the voltage and the highest (1023) will be the highest value. Not sure where you get 50 and 170.
Also the sensor is for CO, not CO2 (my mistake), so soft drink will not work.
But my problem is the module, im not sure how it works.
Do i need to connect the vcc pin to an analog pin in the arduino and do something like this?
A0 -> AOUT
A1 -> VCC
GND -> GND
int sensorValue;
int pulsewidth;
void setup()
{
Serial.begin(9600); // sets the serial port to 9600
}
void loop()
{
pulsewidth=255; //set to 5 V
analogWrite(A1, pulsewidth);
delay(60*1000);
pulsewidth=71.4; //set to 1.4 V
analogWrite(A1, pulsewidth);
delay(90*1000);
sensorValue = analogRead(A0);
Serial.println(sensorValue);
}
Vcc is generally connected to the 5V (or 3.3V) supply. Datasheet says Vc for this sensor is 5V. Most sensor breakout boards will have pins for GND, Voltage and Signal (GVS).
As the data sheet shows, the module heater has a low resistance and therefore requires quite a bit of current, so it can't be powered from an Arduino pin. You will need external circuitry to control the heater power. Calibration is only useful if it is done with a known standard. Mr. Google will be glad to help.
The LM393 is a voltage comparator and cannot control the heater power. You should connect Vcc on the module to a +5V source capable of supplying 150 mA -- the current required by the 33 ohm heating element. I would guess from the module description that the LM393 is there to provide a TTL output to turn on a buzzer, indicating high CO concentration.
Without proper documentation, the only way to figure out what the analog output means is to expose the sensor to known concentrations of CO, and measure the output voltage.
How can i do the power clicle of the sensor with my arduino mega? I kown that the 5v pin suply 200 mA, but i dont know how to down and up that from the board.
I'm not sure what you mean by "power clicle" -- are you referring to the heater voltage switching or do you just want to switch the module on and off?
According to the datasheet, while sampling you need to continuously change the heater voltage between 1.4 and 5 volts. There are various ways of doing that, for example, use a relay or transistor to switch a resistor in and out of the heater circuit. Here is one discussion of how others have accomplished that (and you can probably find others): https://forum.sparkfun.com/viewtopic.php?t=18447