LM35 Temperature Sensor- Externally Powered?

Thread Starter

Dejon

Joined Apr 18, 2020
22
Is it possible to supply 5v power using an external source and have the signal wire only connected to an Arduino to read the temps? I'm not sure if I'm doing something wrong because if I connect the temp sensor pos/neg/signal wires to the Arduino, it will display the temperature fine. If I connect the sensor pos/neg to an external power source and just connect the signal wire I get way off readings.
 

BillB3857

Joined Feb 28, 2009
2,536
It sounds like you are trying to use only one wire going to the arduino. Try tying the negative of the LM35 supply to the ground terminal of the arduino. You need a reference for any signal that the arduino is to evaluate.
 

Thread Starter

Dejon

Joined Apr 18, 2020
22
@BillB3857 So I just did some tests. I get random readings when only the signal cable is plugged into the Arduino but once I connect the neg wire to the lm35 it reads 32deg F consistent.

If I combine both the external power neg side with the Arduino neg side and connect the external positive side to the lm35 It dose nothing. All it says is 32deg F... I'm so lost on this.
 

SamR

Joined Mar 19, 2019
2,590
I'd have to find my notes for the details, but LM35 TO-92 sensors are a bit dicey. I seem to remember having to do some "creative" scaling on them to get to be even close to correct. Even though it is the "precision" sensor I seem to remember the TMP36 TO-92 as being better and more accurate. YMMV

Edit: There are only 3 connections to the LM35. +5V power, GND, and Signal. The trick in the Arduino is scaling in the code to convert the mV Signal Output from the LM35 to the Analog Input pin to display the correct temperature in the Serial Monitor. Look up the TI DataSheet for the LM35 as it has the most info on it.
 
Last edited:

Thread Starter

Dejon

Joined Apr 18, 2020
22
@SamR Shouldn't it still be able to read something though if using an external power source with of course the neg of the Arduino and the neg of the external being shared.
 

SamR

Joined Mar 19, 2019
2,590
Sure, unless the "sensor" is bad. Have you tried replacing it? Don't remember all the details but the Analog input actually isn't analog. The 5V is chopped into 1024? segments so in the code you have to do some math conversion to span 0-1024? to the signal output span of the sensor. You should be able to detect an output signal from the sensor with your multimeter. If no output it's dead? Check the pinout on the datasheet to make sure you are using the correct pins on the TO-92. Flat side facing you, 1=5V, 2=Signal, 3=GND from left to right.

Edit: you don't need an external power source. Use the 5V pin on the Arduino to power it. WHEN using external power, it must have the same ground plane as the Arduino. IE they have to be connected.
 

jpanhalt

Joined Jan 18, 2008
10,251
Have you considered the Maxim DS18B20 (https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf ) sensor? It is as close to "1-wire" as you are likely to get. You do have to have a common ground, but no power is needed when operated in "parasitic" mode:
Source: Datasheet
In addition, the DS18B20 can derive power directly from the data line (“parasite power”), eliminating the need for an external power supply.
One caveat, if you go that way. There are two versions of the sensor. One version does not work in parasitic mode. The Maxim version from Digikey (linked) does work that way. It is available from a lot of distributors.
 

ericgibbs

Joined Jan 29, 2010
10,821
hi Dejon,
The LM35 requires the 0V ground reference and the LM35 output line to be connected back to the MCU, using just the output wire back to the MCU will not work.
E
 

atferrari

Joined Jan 6, 2004
4,095
Is it possible to supply 5v power using an external source and have the signal wire only connected to an Arduino to read the temps? I'm not sure if I'm doing something wrong because if I connect the temp sensor pos/neg/signal wires to the Arduino, it will display the temperature fine. If I connect the sensor pos/neg to an external power source and just connect the signal wire I get way off readings.
You seem to want to minimize the number of wires as inputs to your circuit. The +5V driving your LM35 must have a common connection with the LM35 and with your board. Otherwise you will get garbage.

Keep in mind that the current required to drive that sensor should be small (very) and better if stable.

My very first design (with option to 8, 16, 24 or 32) sensors, used integrated constant current sources (LM34 IIRC), one per sensor.
Worked like a gem.

From the many different ICs I ever used is one of the simplest.

My sincere suggestion: RTFM. The very best you could do.
RTFM.
 

xox

Joined Sep 8, 2017
495
TS could probably use a single, cheap op-amp DIP setup with separate voltage followers, one for the Arduino and the other to the temp sensor, no?
 

dendad

Joined Feb 20, 2016
3,602
You always need at least 2 wires.
One the common reference point, in this case, 0V or gnd, and the signal wire.
And the sensor power supply must also be referenced to the same 0V.
Otherwise, how can the Arduino "know" what it is trying to read. It is just the same as hooking a random length of wire to one terminal. It is an antenna, just picking up mains hum.
 
Top