Why isn't this working?
MarkS
Posts: 342
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).
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
No, 3.3 on the Prop and 5 on the ADC/LM34.
(by "both chips", I meant the LM34 and the ADC...)
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
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.
I can't get past the fact that the LM34 looks like a transistor.
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!