Shop OBEX P1 Docs P2 Docs Learn Events
HSW signal on MQ7 CO gas sensor (27931) — Parallax Forums

HSW signal on MQ7 CO gas sensor (27931)

mizzardmizzard Posts: 5
edited 2012-04-02 11:01 in Accessories
Hello everybody, I have bought CO gas sensor module (27931) and after read all information, I know that there are 2 phases, heating and sensing.

The first one is turn to low state HSW pin about 60 seconds and watching schema I can see that it means to put MQ7 sensor to 5 V. And the second one is using a PWM signal to reach 1.4 V RMS about 90 seconds.

To test this sensor I use a microchip (PIC18LF2550) with 2n3904 transistor (http://www.parallax.com/Portals/0/Downloads/docs/prod/sens/27904_27930-1-2-GasSensor-v2.2.pdf), so, HIGH level in my HSW pin means to turn on the heating.

In this PDF we can see a BASIC Stamp 2 code (last page). Well, I want to program in other language the 2 main routines (heating and sensing) but I have these questions:

- When I turn on my HSW pin (heating phase) I can see (using a voltimeter) 4.83 V and 190 mA (total current consumption) on H pin (MQ7 sensor) instead 5.0 +-0.1 V that appears in sensor datasheet. So I suppose this is ok, or no?

- Watching the proposed code for sensing phase, I guess that the period of the signal is about 18 ms (15 ms HSW on, remember 2n3904 transistor, and 3 ms HSW off). The code does that 1710 times, about 90 seconds, but if I multiply 18 ms x 1710 its only aprox 30 seconds instead 90. What am I doing wrong?

- What characteristics are recommended for PWM signal to reach 1.4 V on H gas sensor pin? (period or frequency, duty cycle for HSW pin)

I hope your answer, thank you very much.
PS: If you have any question I'll try to explain it again using other words.

Comments

  • Tracy AllenTracy Allen Posts: 6,656
    edited 2012-04-02 08:33
    In the BASIC Stamp code there is a lot of testing of the alarm status and printing out to the debug screen at 9600 baud, and that eats up far more than the 3 millisecond pause. I count 40 characters being sent, so that is at least 40ms right there. Longer even than that, because of all the PBASIC code. My guess is that the author of the program timed it empirically.

    The main thing is the average temperature of the heater. My feeling is that a shorter PWM cycle might be better, but that depends on the time-constant of the heater itself.

    The Hanwei MQ-7 data sheet does say 5 +/- 0.1 V and also 1.4V +/-0.1 V. The data sheet is not good about details. For example, they show the graph of up and down response as the temperature of the heater cycles, but they don't really say where on that cycle you should make the measurement. Maybe an average instead of just one point? All I can say is, experiment. You will have many options on the PIC. There is a test point on the 27931 where you can tap into the analog output signal, which is far more interesting to look at than the alarm output.

    An interesting sidelight. There is a project seeking funding on Kickstarter called the Air Quality Egg that proposes a low cost module that will provide a home interface, the "Egg" and also networking via Pachube. It has already exceeded its funding goal. Follow the link to their wiki, and then to hardware/sensors, and you will fine three each of the Parallax gas sensors as well as quite a few others. By far the weak point in a system like this is the sensors, wherein by and large you get what you pay for!
  • mizzardmizzard Posts: 5
    edited 2012-04-02 09:04
    Thank you for the information Tracy Allen!
    As I can see is better to make my tests to find which duty cycle reaches 1.4V RMS in sensing phase.


    Another question is if I select a fixed value from R3 potentiometer, and then I read TP1 test point using ADC and the following equation:
    Rs\RL = (Vc-VRL) / VRL
    I can know the sensor resistor value Rs (when readings are stable). But if I want to translate this information into ppm, I don’t know how to obtain Ro from figure 3.
    How could I simulate this condition to obtain Rs = Ro?
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2012-04-02 11:01
    You can't know Ro quantitatively without recourse to a calibration gas or a reference meter. Until then, qualitatively, you can see that it goes up and down. The data sheet gives a wide unit to unit variation, for 2kΩ to 20kΩ in 100ppm CO, typically 10kΩ.

    The data sheets suggest using a butane hair curler, but that is crude because the amount of CO will depend critically on how oxygen starved it runs, and the sensor is also responsive to the water vapor and to temperature which are big factors in a combustion source like that.
    Possible butane combustion reactions:
    2C4H10 + 13O2 ==> 10H2O + 8CO2 complete combusion lots of water and heat
    C4H10 + 5O2 ==> 5H2O + 2CO2 + CO + C incomplete,
    C4H10 + 3O2 ==> 5H2O + CO + 3C flame is more yellow when C is present as soot
    There may also be reactions involving nitrogen and also butane left in the exhaust.
Sign In or Register to comment.