LM35 Temp. Sensor - UNO and MKRZERO

Hello all,

I'm new to Arduino products but have dabbled in electronic circuits years ago.

I set up a simple temperature monitoring circuit using an LM35 sensor.

I got the sketch from the Arduino site and used it as is.

Works fine on the Arduino UNO, room temp. at about 70 degrees F.

I set the same sensor up on the Arduino MKRZERO board. I used the same sketch set up for the different board. The results were about 104 degrees F for the same room.

Can some one shed some light on this issue between the boards?

Thanks..

Please post a link to the sketch.

Without seeing the relevant sketch, I would hazard a guess that as the LM35 is an analogue temperature sensor, that maybe there is a slightly different scaling factor or offset needed. Just a guess ...

The sketch was actually from a different site, see the link below...

https://www.tutorialspoint.com/arduino/arduino_temperature_sensor.htm

Thank you.

jimschriver:
The sketch was actually from a different site, see the link below...

Arduino - Temperature Sensor - Tutorialspoint

Another bad LM35 tutorial.
Comparing LM35 output voltage to a potentially unstable VCC is not going to get you a stable temp readout.
On an Uno, you get a much more stable readout and higher resolution if you switch to 1.1volt Aref in setup().
Many examples on this site.

But that's not going to work on the newer generation SAMD21 MKR boards with 3.3volt logic.
Try switching to 1volt Aref in setup() with this line.

AR_INTERNAL1V0;

Then change the 0.48828125 multiplication factor until you have the expected temp readout.
That will also depend on selected A/D resolution of the board.

Maybe easier to use a digital temp sensor with these boards.
Leo..

Here's an LM355 library with example.

Knock yourself out.

LM35.zip

-jim lee

That LM35.zip doesn't seem to use a more stable internal voltage reference,
so basically as bad as the one OP linked to.
Leo..

70 deg -> 104 deg difference is not a slight grounding issue.

-jim lee

jimLee:
70 deg -> 104 deg difference is not a slight grounding issue.

70/104 is about 2/3.
The difference between 3.3volt and 5volt is also 2/3.
That error happens when you use code written for 5volt logic on a 3.3volt logic processor.
Leo..