I want to measure temperature on Pi with LM35 sensor. I have cables like this it's 4 x 0.75mm^2 and the longest is about 10 meters. I can't change them to UTP. Is this gonna work on this cables or maybe I should use thermoresitors instead?
-
1Have you seen this electronics.stackexchange.com/questions/15734/…?– Steve RobillardDec 27, 2015 at 7:40
-
1Why not put an I2C chip with an A2D near the sensor, then transmit the data back over I2C to the Pi....– Piotr KulaDec 28, 2015 at 1:08
1 Answer
The EE Stackexchange question/answers on LM35, pointed out by Steve Robillard, He linked this question, covers the subject of LM35 well. The answers indicate that several meters of cable (including UTP, Unshielded Twisted Pair) doesn't work well for LM35.
The EE stack exchange focused a lot on "instability due to load capacitance (>50pF)" Further circuitry (more components) would be required to use the LM35 at distance.
The LM35 is an active device, whose output changes in voltage with changes in temperature. The LM35 uses power supplied externally, uses internal transistors to create a voltage output. This type of device is called an active device (as opposed to a passive device).
or maybe I should use thermoresistors instead?
"Thermoresistors", or thermistors are passive devices, whose resistance changes with changes in temperature. Thermistors do not put out a voltage, nor are they susceptible to oscillations because of load capacitance.
Using a thermistor doesn't mean you get a free ride to error proof temperature sensing. Also, you don't get a nice voltage already scaled in mV per degree of temperature (as with the LM35).
Your long cable is still susceptible to picking up noise from the environment. However, a filter capacitor can help reduce the noise picked up. Capacitor C1 shown will reduce noise. Unlike the LM35 which can be induced into oscillation by loading capacitance, you get a good effect of noise reduction from the thermistor. The cable capacitance isn't working against you.
Not knowing the temperature range you want to measure, nor the thermistor you might choose, I have simply shown the thermistor at 10K ohms, and the resistor R2 as 10 K ohms. R2 is necessary of course to form the voltage divider.
Choosing resistance values very high, or very low can have substantial side effects. Too high of resistors can allow noise levels to be higher. Too low of resistor values and you start to have voltage drop on long cables, which will affect the accuracy of your measurement.
EDIT : To add a specific design as illustration.
Lets take a Vishay #NTCLE100E3103JB0 thermistor Data Sheet that is shown as value of 10K ohms at 25 degrees C. The data sheet also shows that the resistance at 0 degrees C would be 32554 ohms (about 32.5K).
For a system using +5 volts (schematic above), and using a voltage divider equation: With R2 as 10K ohms and with the thermistor at 10K ohms (25 degrees C), the signal (going to analog input pin) would be 2.5 volts. With thermistor at 32.5 K ohms (0 degrees C), the signal would be 3.82 volts.
For a system using 3.3 volts, signal would be 1.65 volts at 25 degrees C (half of the 3.3v). Signal would be 2.52 volts at 0 degrees C.
The capacitor C1 could be almost anything you have that is convenient. 100nf would be a good starting point. You could use a 10 uf electrolytic if that is all that you have. Just be sure that you put the positive lead to the signal (not ground). Electrolytics aren't that good at filtering high frequency noise.
Now all you need is an Analog Input.
-
Thank you for your reply. I want to measure temperature 10-30 celsius deegres. What resistor, capacitor and thermistor should I use? Dec 27, 2015 at 22:13
-
@mariusz2108 , I edited the answer to show a typical thermistor and voltages to be expected.– MarlaDec 27, 2015 at 22:58