Shop OBEX P1 Docs P2 Docs Learn Events
Voltage measurement without ADC — Parallax Forums

Voltage measurement without ADC

Lars JepsenLars Jepsen Posts: 9
edited 2005-05-10 21:22 in BASIC Stamp
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

Comments

  • JonathanJonathan Posts: 1,023
    edited 2005-05-10 18:08
    Lars,

    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
  • BeanBean Posts: 8,129
    edited 2005-05-10 18:33
    What voltage range are you trying to measure ?
    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."
    ·
  • Lars JepsenLars Jepsen Posts: 9
    edited 2005-05-10 18:59
    I’m trying to detect changes between 0-5 volts. I’m can’t remember if the minimum voltage threshold for the stamp 1.4v? If it is… I’m interested in changes between 1.4-5v.
  • JonathanJonathan Posts: 1,023
    edited 2005-05-10 19:04
    We need to know more about your project. What accuracy do you need? Are you looking for a single change in state/voltage? If so a simple comparator circuit would work for you. How fast will the signal vary? The more you can tell us the more we can help.

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Lars JepsenLars Jepsen Posts: 9
    edited 2005-05-10 19:20
    The initial output voltage sent from my sensor is constant. However, my sensor should be able to change the voltage level (similiar to a pot) and the stamp should detect smooth changes with the voltage value rounded off to the nearest hundredth.

    Post Edited (Lars Jepsen) : 5/10/2005 7:27:24 PM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-05-10 20:06
    Hundredth of a volt or hundredth of your scale (0.05 V)? Either way your going to be hard pressed to get that much resolution without an ADC.

    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
  • Lars JepsenLars Jepsen Posts: 9
    edited 2005-05-10 20:28
    My mathematics terminology is a little off at the moment. I’m looking to detect a value change from ex. 4.55v to 4.35v to 3.10v… etc. What type of results would I be getting with 4-6 bits of information?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-05-10 20:39
    If you only want to measure 0 to 5 volts, then connectin and ADC0831 is a whole lot easier than trying to *fake it* with a 555 or other external circuit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Lars JepsenLars Jepsen Posts: 9
    edited 2005-05-10 21:00
    The sensor that I’m using constantly sends an output of 5 volts. I’m not sure if exceeding 5 volts would harm the stamp. What is the limit again?
    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?
    313 x 295 - 4K
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-05-10 21:22
    5.5V is the absolute maximum for supplying the stamp, however I believe you cannot drive a pin at a voltage higher than your supply.
    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.
Sign In or Register to comment.