Shop OBEX P1 Docs P2 Docs Learn Events
Why isn't this working? — Parallax Forums

Why isn't this working?

MarkSMarkS Posts: 342
edited 2008-01-30 01:53 in Propeller 1
I'm using a LRC1298 ADC configured in single-ended mode, reading a LM34 temperature sensor from channel 0. I'm using the LTC1298 object to deal with the ADC. The problem is that its working, but not as I'd expect. I can read low end temperatures just fine. Placing the probe in a glass of ice water reads 32°F. However, if I place it in my mouth, it will not go above 78°F, a 20° difference.

I'm working on the schematic, but there really is not much to it. The output of the sensor is decoupled with a 10uf cap and connected to ADC pin 2 (channel 0) and the ADC is connected to pins 15, 16, and 17 on the Prop. The output of the ADC is connected to the Prop through a voltage divider (R1 = 510, R2 = 1K).

Comments

  • RaymanRayman Posts: 14,162
    edited 2008-01-30 01:39
    You're using +5V on both chips?
  • MarkSMarkS Posts: 342
    edited 2008-01-30 01:42
    Rayman said...
    You're using +5V on both chips?

    No, 3.3 on the Prop and 5 on the ADC/LM34.
  • MarkSMarkS Posts: 342
    edited 2008-01-30 01:43
    I'm thinking it has something to do with the conversion formula that I'm using, but I can't figure out what.
  • RaymanRayman Posts: 14,162
    edited 2008-01-30 01:44
    Did you measure the output of the LM34 with a multimeter? I think it's supposed to be 10 mV/°F... So, should be .78 V at 78°F, right?

    (by "both chips", I meant the LM34 and the ADC...)
  • RaymanRayman Posts: 14,162
    edited 2008-01-30 01:48
    This might be trouble here:

    temp := 5000 / 4096 * val / 10·

    Since it's 32-bit·integer math, I'd do something like

    temp:= (val*5000*10)/4096

    to be sure to minimize rounding errors
  • MarkSMarkS Posts: 342
    edited 2008-01-30 01:48
    Rayman said...
    Did you measure the output of the LM34 with a multimeter? I think it's supposed to be 10 mV/°F... So, should be .78 V at 78°F, right?

    Yes, it works fine when attached to my meter, although my meter only has a resolution of .1mV. Still, it shows.9 when I try and take my temperature, which is correct.
    Rayman said...

    (by "both chips", I meant the LM34 and the ADC...)

    I can't get past the fact that the LM34 looks like a transistor. redface.gif
  • MarkSMarkS Posts: 342
    edited 2008-01-30 01:53
    Rayman said...

    temp:= (val*5000*10)/4096

    Close, it looks like temp:= (val*5000/10)/4096 did the trick. *10 caused it to scale wildly. I figured it was in that line. Thanks! yeah.gif
Sign In or Register to comment.