BS A2D C and voltage comparator
celestino_galan
Posts: 44
Does anybody know in any BASIC Stamp has analog to digital converter and/or is it possible (and how)to use the "voltage comparator" from the BASIC Stamp 2px to measure a voltage?
Thanks
Thanks
Comments
RCTIME is generally used to measure an unkown resistance. Please see the help file, then post more questions if needed.
The voltage comparitor can easily be used to indicate when an unknown voltage is greater than or less than a known voltage. The comparitor returns a boolean result (yes or no, true or false....).
Just like google......the help tool is your friend.
I typically use it to sense when the voltage on a 12 volt battery drops below some threshold. I can give more details regarding use if you can give a specific description of the application.
The comparitor uses two pins. A common use is the user (you), puts a known voltage on one pin, and feeds an unknown voltage into another pin. A logic 1 or logic 0 is returned based on the comparison of the two voltages.
k
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
トヨタは すばらし です!!
Post Edited (KenM) : 5/15/2005 4:18:46 PM GMT
You can add an ADC externally. There are lots of references on that. Here is a module with Stamp and ADC on board: www.emesys.com/OWL2pepr.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Works as follows:
The tag labeled "To comparitor input" monitors a ratio of the battery voltage (variable input).
The tag labeled "Other comparitor input" is fixed at 2.5 volts and does not change.
When the battery voltage is at 13 volts, the variable input will be 3.22 volts....greater than the fixed input (2.5v), and the comparitor result is logic 0.
When the battery voltage is at 12 volts, the variable input will be 2.97 volts....greater than the fixed input, and the comparitor result is again 0.
When the battery voltage is 10 volts, the variable input will be 2.48 volts....less than the fixed input, and the comparitor result will now be 1.
This is an ideal case, on paper·with EXACT resistor values. In the real world your result will be off from the calculated voltages described above.
You can use a 20k ohm pot in place of R1, and that will allow you to adjust the fixed input from about 1.7 volts up to 5 volts, but setting the fixed voltage at 5 volts is useless.
This is assuming the fixed input is wired to P2
Write back if this does not make sense or you have more questions.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
トヨタは すばらし です!!
Post Edited (KenM) : 5/15/2005 5:24:28 PM GMT
Thanks again
Post Edited (celestino_galan) : 5/15/2005 5:16:38 PM GMT