Shop OBEX P1 Docs P2 Docs Learn Events
LM34 and ADC0831 conversion — Parallax Forums

LM34 and ADC0831 conversion

Jason MJason M Posts: 3
edited 2007-07-12 00:01 in BASIC Stamp
I am using a·BS2 with a LM34 connected to an ADC0831. I have to modify the input from the ADC0831·by multipying it by 50/26 to get the correct temp reading. Can someone explain why this is so?

Thanks
Jason

Comments

  • Geek_GirlGeek_Girl Posts: 7
    edited 2007-07-11 20:38
    Jason M said...
    I am using a·BS2 with a LM34 connected to an ADC0831. I have to modify the input from the ADC0831·by multipying it by 50/26 to get the correct temp reading. Can someone explain why this is so?

    Thanks
    Jason
    The 831 is an 8 bit converter, in other words it measures 255 increments from zero to the reference voltage, which is normally the 5 volt supply.

    That means· the 831 gives one count for each 19.6mv in.··· (5·/ 255)

    Your LM34outputs 10mv per degree, so 100 degrees is 1V output.

    Obviously,· you want 100 degrees to read 100 on the screen, but 1V is only 51 counts on the 831, so you need to implement some scaling for the readout to be useful.

    100/51 = 1.9, .....· 50/26 = 1.9 .......

    The LM34 works up to about 200 degrees, so to get the most accurate scaling, you'd divide 2000mv (200degrees X10mv)···by 19.6mv getting 102. ... The scaling math would then multiply by 200 and then divide by 102


    That's why you do it.


    If you want easy, use a 12 bit adc (which divides the reference voltage·into 4096 increments)·with a 4.096V reference voltage, and you'll have 1 count equals 1mv, so the readout will be direct to tenths of a degree.




    Darlene
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-07-11 20:48
    How about sticking with the 8-bit ADC, but using a 2.56V Reference (2.56V / 256 = 10mV each bit)?
  • JonathanJonathan Posts: 1,023
    edited 2007-07-11 21:09
    PJ, All,

    That is exactly what I do. I have a hot tub setup that uses an LM34. Since I never want the tub hotter than 110 (actually 106 but I wanted some headroom), I used a variable reference set to 1.1V. This way I can get 10ths of a degree easily, could actually get hundreths. I mean, what if the tub is 104.1, not 104.0! :-0

    Jonathan

    Nice sig. pic BTW, PJ.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Jason MJason M Posts: 3
    edited 2007-07-12 00:01
    Thank you Darlene - that is the type of explanation I was looking for and it·is very clear now.

    Jason
Sign In or Register to comment.