Shop OBEX P1 Docs P2 Docs Learn Events
ADC0831 and the math behind it — Parallax Forums

ADC0831 and the math behind it

Jason MillerJason Miller Posts: 3
edited 2009-01-20 21:41 in BASIC Stamp
I am a novice when it comes to the basic stamp and analog to digital conversion so please bear with me:

I am using a LM34 to measure temperature and it is connected to a ADC0831. I currently have the Vref on the 0831 set to 5 volts thus I am using the following scaling math:

5/255 = 19.6mV
Since the LM34 outputs 10mV per degree and 100 reads 51 on the 0831 I use the scaling factor of 100/51.

My question is if I changed the Vref to 2.5 volts so 2.5/255 = 10mV do I need a scaling factor?? But I must need to change something since when I use a Vref of 2.5 the output of the 0831 is not correct.

Any insight or help would be greatly appreciated,
Jason

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-01-20 16:34
    Jason,

    What do you mean the output of the ADC0831 is not correct? With a VREF of 2.5V when your input signal is 2.5V you should get 255 from the ADC0831. Is this not what you’re getting?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering


    Post Edited (Chris Savage (Parallax)) : 1/20/2009 6:15:05 PM GMT
  • Jason MillerJason Miller Posts: 3
    edited 2009-01-20 17:44
    I get a decimal value 128 from the 0831 when I have the Vref at 2.5 volts
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-01-20 18:12
    And what voltages are on VIN+/VIN-?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • Jason MillerJason Miller Posts: 3
    edited 2009-01-20 19:12
    Chris -

    I had a wiring problem which when corrected fixed the problem I was seeing. I have another question though - can I get an accuracy to tenths of a degree with the ADC0831 and if so how do I go about it.

    Thanks
    Jason
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-01-20 21:41
    Jason,

    Since the LM34 outputs 10mV per degree, then 1/10 degree resolution would require 1mV resolution on the ADC. While you could do this on the ADC0831, your measurable range would be very small. You would be better off going with a 12-bit ADC in this case and adjusting the VREF to 4.095 which would give you 1mV/step resolution on the ADC. Each value would be equal to 1/10 degree (1mV). I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
Sign In or Register to comment.