Help Driving Auto Guage
Tom86951
Posts: 14
I have·a needle gauge in my car that·reads air pressure (boost)·from·0 to 12psi.· It is driven by the car's engine computer -- it reads 0psi at ground and 12psi at about 2v.· From what I've been told, the car's computer uses pulse width modulation to generate the 0-2v to drive the gauge.·
I have a sensor to measure the air pressure (boost) from 0·to 25psi, which generates a linear 0 to 5v.· I figured I could make a little A/D circuit to sample that sensor with the BS2, and then generate the corresponding gauge voltage using the PWM feature of the BS2.·
I'm a total newbie at all this and I am trying to figure out how to use the PWM to drive the gauge.· I've been playing with the capacitor/resistor arrangement described in the stamp manual.· I suspect I need a very small cap -- otherwise the gauge·won't go down·as fast as the sensor voltage -- but it needs to be big enough to hold the charge while the program·loops to sample the sensor and reset the PWM.···Any tips?
·
I have a sensor to measure the air pressure (boost) from 0·to 25psi, which generates a linear 0 to 5v.· I figured I could make a little A/D circuit to sample that sensor with the BS2, and then generate the corresponding gauge voltage using the PWM feature of the BS2.·
I'm a total newbie at all this and I am trying to figure out how to use the PWM to drive the gauge.· I've been playing with the capacitor/resistor arrangement described in the stamp manual.· I suspect I need a very small cap -- otherwise the gauge·won't go down·as fast as the sensor voltage -- but it needs to be big enough to hold the charge while the program·loops to sample the sensor and reset the PWM.···Any tips?
·
Comments
·· Since the BASIC Stamp is a single-tasking controller it will execute the PWM statement and then move on to process other commands.· So yes, while it is generating PWM it will be unable to do anything else.· We do have the PWMPAL, however, which allows you to program up to 4 PWM channels which will continue while the BASIC Stamp processes other information.· Optionally, you could create a small co-processor from an SX Chip.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
there is a discussion group in this forum starting to discuss this new device. Look on the 'forum quick jump' above.
Cheers,
Chris