Shop OBEX P1 Docs P2 Docs Learn Events
How to read analog 0-1v signal — Parallax Forums

How to read analog 0-1v signal

jbalatjbalat Posts: 96
edited 2010-02-02 03:28 in Propeller 1
Is it possible, if so..
Is this on along a similar line to the RC time stuff ?

Comments

  • TappermanTapperman Posts: 319
    edited 2010-01-31 23:33
    Use an A/D chip (like TLC-548) with AA bat as a reference voltage, might be quickest?
  • hover1hover1 Posts: 1,929
    edited 2010-02-01 00:26
    What kind of resolution are you looking for? Do you want to meaure .5 , .25, .1 volt increments, or more accurate measurements? Or is it just ON/OFF at 0/1 volt?

    A little more information is needed to give you the proper solution.

    Jim

    Post Edited (hover1) : 2/1/2010 12:31:06 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-01 00:39
    Don't forget that the Propeller can do ADC with just a couple of resistors and capacitors. Read the application note on the cog counters (AN001 - www.parallax.com/tabid/832/Default.aspx)
  • jbalatjbalat Posts: 96
    edited 2010-02-01 10:59
    I need 0.05v accuracy

    I just thought instead of using a pot I just use the 1v source with a lower resistor if any at all as per the standard rctime circuit with the capacitor ?

    PUB Pot | potTime, M

    ' Configure counter module.
    ctra[noparse][[/noparse]30..26] := %01000 ' Set mode to "POS detector"
    ctra[noparse][[/noparse]5..0] := POT_PIN ' Set APIN to P0
    frqa := 1 ' Increment phsa by 1 for each clock tick

    repeat
    ' Charge RC circuit.
    dira[noparse][[/noparse]POT_PIN] := outa[noparse][[/noparse]POT_PIN] := 1 ' Set pin0 to output-high
    waitcnt(clkfreq/100_000 + cnt) ' Wait for circuit to charge

    ' Start RC decay measurement. It's automatic after this...
    phsa~ ' Clear the phsa register
    dira[noparse][[/noparse]POT_PIN]~ ' Pin to input stops charging circuit
    waitcnt(clkfreq / 5 + cnt) ' Wait for Decay 1/5 second

    ' Get Time difference
    potTime := (phsa - 624) #> 0
    M := (potTime / 360) ' use a factor to get right voltage

    waitcnt(clkfreq / 20 + cnt) ' Wait 1/20 second -> 10 Hz
  • kwinnkwinn Posts: 8,697
    edited 2010-02-02 03:28
    .05V resolution from a 0-1.0V signal is less than 8 bits so you could easily use 2 pins for an ADC as Mike suggested.
Sign In or Register to comment.