View Full Version : Try This Mod With ADC0831_LM34.spin

05-23-2008, 08:54 AM
Hey All
I've recently been fooling around with Larry Freeze's great little ADC0831_LM34 spin program. I learned quite a bit about the basics of the interface and the FullDuplexSerial
I noticed one weird thing though. No matter how hot the sensor got the output
maxxed out at 127 (maxium 7 bit resolution). I tried boiling water. Dang it, I held a lighter a couple inches below the sensor and it still maxxed at 127 F. It struck me that somehow
the LSB was not loading. So, on a hunch, I changed the REPEAT 8 to REPEAT 9 and it worked.
After recalibrating the Vref pot to a known temperature (ie. room, ice, etc.) it now
maxxed out at 255 (the full 8 bit resolution of the ADC). Why this worked I'm not totally sure. It may have to do with the falling trigger of the Chip Select line and timing of the INA.
When I have the patience I'll peruse the data sheet in depth and figure it out. For now I kluged it and I'm rigging up a probe so I can take the temperature of everything in sight.


Edit: Also change Lm34temp from byte to word or long in var section.

"Can't sleep, clown will eat me."
Bart Simpson

Post Edited (b.p.m.) : 5/23/2008 2:24:53 AM GMT

Luis Digital
05-23-2008, 09:20 AM
Yes 9 (tc), view image.http://www.technology.niagarac.on.ca/courses/comp630/TemperatureAlarmDesignExample_files/image003.gif

07-23-2008, 09:51 AM
I have a Parallax-GPS hooked up to a UOLED-96


and it works great until I put it in the wheel well of my x's van... where it works fine until the outside temp goes above 90 and the inside temp goes to about 130... and then it just sits there. The Parallax GPS keeps acquiring (hardy little beast) but my poor little UOLED-96 hates it...

So, I decide to monitor the temperature in the wheel well. Unfortunately, between the time I last used my sensirion temperature and humidity monitor I either broke the code or broke my chip... and being in a hurry I decided that an LM34 would be good enough... and then I came across Larry Freezes object, which allows me to hook up both the lm34 and the adc0831... to my 96 without even modifying the pin settings... what could be better?

I looked at the circuit and didn't understand it ... so I tried just hooking everything up... no resistors (except a 1K on the data line) no capacitors... and no
voltage reference (just hooked up the +5V line to the ADC0831 reference pin)

And it works... so what's my problem?

I had to modify the repeat loop to repeat 10... which makes sense when I look at the timing diagram above...but no sense when I look at the above post, which clearly indicates a repeat loop of 9 gave full range.

AND If anyone has time... in the original circuit the signal line coming out of the lm34 and going to the Vin of the 0831 is also connected to ground through a 270 ohm resistor and a 1uf capacitor... why? When I put this into my breadboard the results aren't as reliable as without it.

The voltage I measure out of the LM34 is high at 70F... I've got the heat on in my cell, and I'm going to chart my curiosity vs ambient room temp.



Post Edited (rjo_) : 7/23/2008 2:37:55 PM GMT

07-24-2008, 04:08 AM
hey rich
A couple quick points; first you need the vref trimpot to get the most accurate results because the lm34 outputs 3V at 300F the maximum; second you should recheck the ADC0831's timing chart because it outputs the lsb (8th bit) on the falling edge of the 9th clock pulse.
I tried your version with a REPEAT 10 and it totally threw off the accuracy. I did take out the 1uf cap/270 resistor combo and you were right about that not having any effect on the circuit as far as i could tell. I am curious as to why it was added in the first place. Does anyone know why?



"Can't sleep, clown will eat me."
Bart Simpson