Voltage measurement without ADC
Hi everybody!
I’m trying to measure variable voltage with my bs2sx without using an ADC converter. I read in the manual that you can use the pulsin command or a 555. I can’t find any stamp tutorials on this subject and was wondering if anyone has any suggestions or links on how to measure voltage using the 555 or pulsin.
Thanks in advance!
Lars.
Post Edited (Lars Jepsen) : 5/10/2005 5:52:51 PM GMT
I’m trying to measure variable voltage with my bs2sx without using an ADC converter. I read in the manual that you can use the pulsin command or a 555. I can’t find any stamp tutorials on this subject and was wondering if anyone has any suggestions or links on how to measure voltage using the 555 or pulsin.
Thanks in advance!
Lars.
Post Edited (Lars Jepsen) : 5/10/2005 5:52:51 PM GMT
Comments
There are at least a couple ways to do this. One very simple way is to use the RCTIME command, you can look it up in the help. Basically, it times how long it takes to charge a cap. This is very easy but not super accurate.
Another method is as you suggest, using a 555 timer and the PULSIN command to make a voltage to frequency converter. The varying input voltage changes the frequency of the 555 timer, which is read by the Stamp using the PULSIN command.
HTH,
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video Display Module" Available Now.
www.sxvm.com
"Great people talk about great things, average people talk about average things, small people talk about other people."
·
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Post Edited (Lars Jepsen) : 5/10/2005 7:27:24 PM GMT
You are talking about either 9 or 7 bits of data depending on your definition of a hundredth. Non-ADC conversion methods typically afford you 4-6 bits of information, leaning towards to the lower side.
Post Edited (Paul Baker) : 5/10/2005 8:10:42 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
I just came across experiment 21 from the stampworks manual which involves an analog input with the pulsin command. Would it be possible to use a similar schematic for my project by replacing the photoresistor with ... for example a pot to measure voltage change?
For a 0-5V range, 4 bits will result in a (5/16) .3125 V resolution, 6 bits will result in (5/64) .078125 V resolution, but like I mentioned above 6 bits requires some "know how" to keep the tolerances within acceptable limits in order to provide that degree of resolution.