LM35 - reading garbage.

Hi,
I'm trying to get ambient temperature from LM35 with DUE but instead of some real temperatures I'm just reading some random values/noise. First, if you want to tell me to use google, do not do it, I tryed every available relevant tutorial and forum post. Nothing helped.
I connected 5 of them, to pins A0-A4 and read directly the values with analogRead() and average of 10
readings were:

A0: 452, A1: 776, A2: 871, A3: 511, A4: 421

converted with formula:

temp = (analogRead(pin) / 1024.0) * 3.3 * 100

and resulting temperatures were something between 135 to 280 °C ... that cannot be right.
It's connected in same way as in this schema https://fredim.files.wordpress.com/2012/06/fetch-php.gif
Arduino is powered via USB.

Is there someging I'm doing wrong. Only possible scenarios that I can come up with are that all 5 sensors are broken or my DUE is broken.

Thanks for any advice.
//Heretiiik

Did you connect all the grounds together?

jremington:
Did you connect all the grounds together?

I made a sketch decribing how I did it.

That is a Fritzing picture. Frequently proven useless in fault finding.

It seems ground is missing. Check the wiring.
Maybe you use a long breadboard with split power rails.
Upload a real picture.
Leo..

Wawa:
That is a Fritzing picture. Frequently proven useless in fault finding.

It seems ground is missing. Check the wiring.
Maybe you use a long breadboard with split power rails.
Upload a real picture.
Leo..

It obviously is. I was too lazy to assemble it again.Below this is a link to folder with some photos, there are only wired 2 of them, the rest wuld be in same manner. Still wired the same way as in Fritzing image.
https://drive.google.com/drive/folders/0B-G3LYBbbOSaSHpjYjBBTnlGb3c?usp=sharing

Wiring seems ok.
There have been reports of fake LM35.

You could try some decoupling of the supply on the breadboard.
Or dump the LM35 and go for a string of DS18B20 sensors.
A whole bunch uses only one pin.
Leo..

In that Fritz picture, did you have the flat side of the LM35s facing the top?
At room temp (22C) you shoud see ADC numbers around 67, 68, 69.

Wawa:
Wiring seems ok.
There have been reports of fake LM35.

You could try some decoupling of the supply on the breadboard.
Or dump the LM35 and go for a string of DS18B20 sensors.
A whole bunch uses only one pin.
Leo..

Well, great then.
As of DS18B20 I heard that it takes about 0.7s to read temperature. That's 2.1s for minimum of 3 sensors I need.Is there a way how to reduce it?

756E6C:
In that Fritz picture, did you have the flat side of the LM35s facing the top?
At room temp (22C) you shoud see ADC numbers around 67, 68, 69.

That Fritz picture is just a illustration, see my reply above for photos of the actual circuit.
Instead of 68+- I got numbers in range from 400 to 900 as I said in initial post.

Heretiiik:
I got numbers in range from 400 to 900 as I said in initial post.

I would measure voltage on the analogue pin with a DMM while you have this reading.
Those numbers indicate several volt is present on the analogue pin.
It should be about 0.25volt if the sensor is at room temp.
Maybe the ground wire to the breadboard is open circuit.
Leo..

Wawa:
I would measure voltage on the analogue pin with a DMM while you have this reading.
Those numbers indicate several volt is present on the analogue pin.
It should be about 0.25volt if the sensor is at room temp.
Maybe the ground wire to the breadboard is open circuit.
Leo..

On all analogue pins theres 1.26V, wethers its connected to output pin of lm35 or not. I checked all 5 LM35s and voltage between Vin and ground pins was 4.9V, output pin measured gave 0V. Well I guess I'll have to buy something else to measure the temperatue.

You’re not following the manufacturer’s recommendations for one thing re: twisted pair supply to the device, along with Star grounding with all the grounds and/or you have not provided any shielding of the signal lines plus their is no buffering of the signal being fed directly into a noisy digital environment.

Correct those problems and it should work fine. BTW the buffer should be a ultra low noise, low Vos , rail to rail amp.

LM35 datasheet: http://www.ti.com/lit/ds/symlink/lm35.pdf

Heretiiik:
On all analogue pins theres 1.26V, wethers its connected to output pin of lm35 or not.

That’s not right. You might have damaged your analogue inputs.
AFAIK the Due is a 3.3volt processor, and analogue inputs are not 5volt tolerant.
Just measured the Uno analogue inputs with a (10Megohm) DMM, and they were <0.07 volt.

Heretiiik:
I checked all 5 LM35s and voltage between Vin and ground pins was 4.9V, output pin measured gave 0V.

Did you use Due ground or breadboard ground for these measurements.
You should ofcourse use Due ground.

Did you already look at/replace that ground wire I mentioned twice before.

I doubt the things that Merv suggested are needed for 20cm breadboard wiring.
Leo…

Wawa:
I doubt the things that Merv suggested are needed for 20cm breadboard wiring.
Leo…

One should disregard a manufacturer’s recommendations only when one might possess superior knowledge of the creators/designers/developers of the device. Further, buffering of low level instrumentation signals is a proven and standard practice for preservation of the signal’s coherence. But what do I know after 52 years of experience.

Merv:
But what do I know after 52 years of experience.

About the same here.
Leo..

Where do you have the NEG (-, black) probe of your DMM connected?

One should disregard a manufacturer’s recommendations only when one might possess superior knowledge of the creators/designers/developers of the device.

That would depend on the context of the manufacturer’s recommendations, which in this case are intended for sensors operating in a noisy (e.g. industrial) environment.

Wawa:
That’s not right. You might have damaged your analogue inputs.
AFAIK the Due is a 3.3volt processor, and analogue inputs are not 5volt tolerant.
Just measured the Uno analogue inputs with a (10Megohm) DMM, and they were <0.07 volt.
Did you use Due ground or breadboard ground for these measurements.
You should ofcourse use Due ground.

Did you already look at/replace that ground wire I mentioned twice before.

I doubt the things that Merv suggested are needed for 20cm breadboard wiring.
Leo…

I used Due ground. I changed wires and breadboard several times. I guess I’ll try to come up with workarout without using analog pins. The rest seems to work fine.

jremington:
That would depend on the context of the manufacturer's recommendations, which in this case are intended for sensors operating in a noisy (e.g. industrial) environment.

No! It depends on what is actually contained in the datasheet included by the manufacturer, which they place there to inform their customers, cover their legal liabilities and protect their reputation to keep the stockholders happy.

The total discussion in the datasheet I cited re: 'noisy environments' was this on page 19:

In noisy environments, TI recommends adding a 0.1 μF from V+ to GND to bypass the power
supply voltage. Larger capacitances maybe required and are dependent on the power-supply noise.

That is TI's recommendation regarding environmental noise. Of course, that presupposes proper attention is given to ALL layout considerations including interconnectivity, which IS DISPLAYED on page 16 showing the Star connections, twisted pair power leads and the shielding where needed dependent upon configuration, to which I noted initially!

If one consults their Analog Engineer's Handbook regarding buffering low level instrumentation signals, one can see that signal conditioning is an efficacious practice as I mentioned originally, also.

I doubt I'll be bothering to TRY to help others on this site again given the "welcome" I've received from some of the more senior members.

Have a good day!

@Merv

Wawa:
I doubt the things that Merv suggested are needed for 20cm breadboard wiring.

I think you're referring to this quote. Sorry to hear it annoyed you.
I still stand by it though, because most problems here result from people not connecting things properly, or using parts from shady sources (rejected/fake).
We don't know the true experience and skills of a poster untill 100 posts or so. You only had 5.
Stick with it, and you will find this a great place.
Leo..