About Parallax CO gas sensor.
Joe
Posts: 184
Hi,
Some hours ago I posted a question but not here in this sensor forum.
The question is about a CO sensor :
Parallax code = 27931
I need to take the information from the sensor using a Basic Stamp and display
it with the Parallax 2x16 LCD.
The problem I have is that I don't understand how to take the information from
the sensor. Even I don't understand if it is possible.
Could you help me ?
Thanks, Joe
Some hours ago I posted a question but not here in this sensor forum.
The question is about a CO sensor :
Parallax code = 27931
I need to take the information from the sensor using a Basic Stamp and display
it with the Parallax 2x16 LCD.
The problem I have is that I don't understand how to take the information from
the sensor. Even I don't understand if it is possible.
Could you help me ?
Thanks, Joe
Comments
Downloads & Resources:
CO Gas Sensor Module Docs v2.2 (.pdf)
CO Gas Sensor Module Example Code (.zip)
CO Gas Sensor Module SchematicDocumentation (.pdf)
MQ-7 Datasheet (.pdf)
It's not an analog measurement sensor, but a digital sensor that signals whether or not a gas is sensed at or above a preset threshold concentration. The sample code listed is short & sweet:
' =========================================================================
'
' File...... CO Gas Sensor.bs2
' Purpose... Runs the CO Gas Sensor Module Heater
' Author.... Parallax, Inc.
' E-mail.... support@parallax.com
' Started... 02-09-2009
' Updated...
'
' {$STAMP BS2}
' {$PBASIC 2.5}
'
' =========================================================================
'
[ Program Description ]
' This program runs the Gas Sensor Heater through two phases (voltages) as
' recommended by the manufacturer datasheet. The sensor should run for at
' least 10 minutes in clean air before any calibration is done.
' The first phase is the PURGE phase where the heater element is turned on
' at a full 5V. This clears the sensor and no checking for an alarm
' condition is done here. The DEBUG screen will count down the 60 seconds
' of this phase.
' The second phase is the SENSE phase where the heater element is run at
' ~1.4V for 90 seconds. It is during this phase that the sensor can be
' calibrated or that the sensor is checked for alarm conditions.
'
[ I/O Definitions ]
HSW PIN 0 ' Heater Switch Control
ALR PIN 1 ' Alarm Input Sense
'
[ Variables ]
index VAR Word ' Counter Variable
'
[ Program Code ]
Main:
DO
LOW HSW ' Turn Heater ON
FOR index = 59 TO 0 ' Count Down 60 Seconds
DEBUG HOME, "PURGE MODE...", DEC2 index, " "
PAUSE 1000 ' 1 Second Pause
NEXT
index = 1710 ' Approximately 90 Seconds
DO ' Of Iterations On BS2
DEBUG HOME, "SENSE MODE...", DEC2 index / 19
LOW HSW ' Turn Heater ON
PAUSE 15 ' For 15 mS
INPUT HSW ' Turn Heater OFF
PAUSE 3 ' For 3 mS
index = index - 1 ' Decrement Counter
IF ALR = 1 THEN ' Check For Alarm Condition
DEBUG " ***ALARM***" ' Display Alarm Condition
ELSE
DEBUG " " ' Clear Alarm Condition
ENDIF
LOOP UNTIL index = 0 ' End Of Sense Mode Loop
LOOP
I tried the code from Parallax PDF but I insist that the sensor sends 1 or 0 and
I need to show the amount of CO gas.
It seems that the sensor is not capable to send more than a 0 or a 1 to the microcontroller.
Could you confirm please ?
Thanks , Joe
Any way , the other problem I have is that each time I turn off and on the
sensor resets and I must calibrate again.
Do you know how can I avoid the calibration each time I turn it off ?
Thanks , Joe
Per that doc, the sensitivity level is adjustable by carefully adjusting the onboard pot.