Hi all,
I have an arduino Uno, hooked up to a breadboard from the sparkfun starter kit. All these parts are about one year old. I have attached pictures of the circuit, to the best of my ability. Ignore the button on the breadboard, that was for testing other things that aren't hooked up anymore.
Anyway, I have the following code:
My issue is, the TMP36 is very inaccurate. The data ranges from 115F down to 0F, with no limits on the randomness or crazyness. I have it hooked up via USB and to a 9V 1A power supply, for sufficient juice. Here are some sample coordinates its placing (the second number is the temp):
All of your connections appear to be correct. I would suggest attaching a multimeter to the TMP36 to make sure it's giving stable readings. Also verify that the analog pin is OK by replacing the TMP36 with a potentiometer.
FWIW RRDTool is a better option for long-term/historical data charting and recording. IMHO.
I've done a few things that you recommended. I used a multimeter and put the prongs on ground and the middle output pin. It measures 0.35v or so. I then hooked up the wires that come out from the breadboard, and attached my multimeter to the ground and output lines. The output was not hooked up into the Arduino. The ground was hooked up to the multimeter but was grounded at the Arduino. I got 1.2v at room temperature, 1.0v pressing a finger to it, and 1.6-1.9v with an ice cube on it.
When I hooked the circuit up normally but poked the multimeter prongs in, I got 0.12-0.17v volts, varying up and down every few seconds.
The 10k trimpot produced a steady number, varying from 0-1024 as the documentation says it should, as I turned it. I could leave it in any one position, and the output was solid.
What am I doing wrong?
Thanks
This doesn't directly answer the question but just in general, the DS18B20 is commonly posted as a very reliable and easy to use temperature sensor, and it has been so in my experience too. You might consider experimenting with it.