I need to use a few lm35 sensors for a project

Thread Starter

geoffers

Joined Oct 25, 2010
520
Hi all,
I need to use a few lm35 sensors for a project.
They're going going to be connected to the adc on a pic 16f1779, I need to sense a little bit below 0c so was going to use this setup as per data sheetScreenshot_20201012-190334.png
Probably using 1n4148 diodes as I have some kicking about.

I was going to use the sensors at a bit of a distance <4m from the pic and assume I would need two diodes and the resistor next to the sensor.

I was also going to use two ADC channels per sensor, one as the measurement and one as the zero point (effectively the sensors ground).

However this soon runs me low on pins even with a 40 pin package, if I have 8 sensors each with two diodes and one resistor will I cause myself any issues if I tie all the sensors grounds together and the input this into one ADC channel?

Alternatively just use two diodes next to the pic to reference all my sensors?

I'm using the lm35caz as accuracy is fairly important.

Thanks Geoff
 
Last edited by a moderator:

dendad

Joined Feb 20, 2016
4,641
Why not use LM135 instead?
Or some other type that does not "stop" at 0C?
But I think a common set of diodes used by all sensors will work ok. Maybe with bypass caps added too.
The other way is to try One Wire type sensors that are digital. All sensors can then run on the one pin. DS18B20 or similar.
 

sparky 1

Joined Nov 3, 2018
1,218
Some LM35 datasheets leave out discussion for figure 7 the circuit recommended for cold measurements.
The 18k Ohm resistor and the two diodes makes certain the device will work below 2 degrees and lower to -51 centigrade.
The 2 diodes useful as a makeshift current limiting diode which in turn make a voltage drop needed for the supplying LM35 low uA.
At the very low range the error will be more pronounced also circuit works better in cold because LM35 operating supply needs.

It is nice to have longer leads on the sensor in many applications the microprocessor needs just a number (in centigrade) to use in compensating for another type sensor. In this case no other sensor and not really cold but cold enough to possibly give a small flaky error below 10 degrees C

If you find a difference in calibration (like an ice water bath in double styrofoam cup with thermometer ) when going to longer leads the datasheet discusses making a compensated cable. So the longer the leads the more tendency for increased capacitance. The ability to easily change probe cables from short to long and make the sensor water proof will make the calibration a snap.
 
Last edited:

Deleted member 115935

Joined Dec 31, 1969
0
I'd look at a i2C set of sensors, or SPI then you only need 2 or 3 pins back to the processor
 

Thread Starter

geoffers

Joined Oct 25, 2010
520
Thanks, the main reason I chose that sensor was the Caz version is +-0.2 degrees and fairly small so I can slide it into a stainless tube to make a probe.
I think the price of a couple diodes is worth paying for the accuracy?
The LM 135 is +- 1 and the digital one +- 0.5, as long as I'm not going to run into any issues with long cables I'll be happy :)
 

Deleted member 115935

Joined Dec 31, 1969
0
Re the accuracy,
Have you read the forums about counterfeit LM35 ? make certain you purchase from an approved supplier else you will not get the accuracy.

Also re accuracy
If its in a stainless steel tube, the temperature measured is going to be a long way different to the real temperature, unless the temperature is not changing,

Also re accuracy
The voltage off the chip is relatively high impedance and single ended, and is very susceptible to interference, which you will read as a temperature difference. Your analog front end nees to be very good to read the 0.2 degree difference. analog over wires, really needs to be very low impedance, and or differential

I'd suggest you make up a test one before you committe,
 

bassbindevil

Joined Jan 23, 2014
924
Speaking of counterfeit sensors, that would include just about every DS18B20 that comes from China. But they are incredibly cheap, so get a handful to experiment with, and invest in real ones for the final application. Real ones can be bought direct from Maxim (they might even send you some freebie samples), or from authorized distributors like Digikey, Newark, Farnell, Mouser. Suppliers like Adafruit might be ok; $4 apiece does allow a profit if they're buying direct from Maxim in quantity, but it would be wise to verify using the "discover_fake_DS18B20.ino" arduino sketch and complain if you didn't get a real one.
https://github.com/cpetrich/counterfeit_DS18B20
 
Top