Simple Q: How do I capture 0-5v input voltages?
Hello Parallax,
I am sure this is rather simple but after reading a ton of sensor pdf files on this site I have been unsuccessful at finding an example that applies to me.
The sensor programs I've seen use sensor devices that have a differing resistance (photocell) or some pulsein or pulseout or use serin serial stuff.
What I have is a very simple automotive pressure sensor with the following 3 terminals:
a- Ground
b- Output (positive 0-5 v)
c- +5 volts
All I want to do is read the output signal of this device with my stamp. The signal will vary from 0 - 5.0 volts lineally based on a pressure input port.
I am using my old BS2 HomeWork board.
So what I have is the ground connected to Vss and the +5 volts connected to Vdd.
I connected the sensor's output to P1 using a 330 ohm resistor.
All I need to know if what is the code used to read a positive input value ?
I already have a 4 line blue LCD screen that I am using to print the value out to, so the value needs to be stored as a variable.
Thank you very much in advance!!!!
BigMike
I am sure this is rather simple but after reading a ton of sensor pdf files on this site I have been unsuccessful at finding an example that applies to me.
The sensor programs I've seen use sensor devices that have a differing resistance (photocell) or some pulsein or pulseout or use serin serial stuff.
What I have is a very simple automotive pressure sensor with the following 3 terminals:
a- Ground
b- Output (positive 0-5 v)
c- +5 volts
All I want to do is read the output signal of this device with my stamp. The signal will vary from 0 - 5.0 volts lineally based on a pressure input port.
I am using my old BS2 HomeWork board.
So what I have is the ground connected to Vss and the +5 volts connected to Vdd.
I connected the sensor's output to P1 using a 330 ohm resistor.
All I need to know if what is the code used to read a positive input value ?
I already have a 4 line blue LCD screen that I am using to print the value out to, so the value needs to be stored as a variable.
Thank you very much in advance!!!!
BigMike
Comments
Basically, a very, very, very simple question that will answer everything I need could be how do I connect a AA 1.2 volt Duracell battery for example?
What code do I use to read how much positive voltage the battery currently has? Once I learn how to do this, I can use this pressure sensor [noparse]:)[/noparse]
Thanks
Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
www.parallax.com/Store/Components/IntegratedCircuits/InterfacingChips/tabid/613/CategoryID/78/List/0/SortField/0/Level/a/ProductID/245/Default.aspx
So the automotive pressure sensor I have outputs an Analog voltage output and my BS2 requires a digital input?
I will start working on this immediately, thanks for the tip!
I got it! I am using the following program for this:
I am playing with two pots hooked up to the circuit and I can only seem to get adcBits valves from 0 to 255. I change the variable to a Word and not a Byte but it still only goes up to 255. It is reaching 255 when the pressure sensor is at about 25% of it's maximum value.
How can I increase this range?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
"I change the variable to a Word and not a Byte but it still only goes up to 255"
It is working great and today I got a lot of data logged and am about ready to transfer it to a motorcycle.
Thanks for everyone's help!
Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen