Electronic – Temperature current source using a LM35

current-sourcesensortemperature

Anyone care to explain how this piece of circuit work?

enter image description here

I already build it and it works wonders but I can't figure it out.

Best Answer

The LM317 is used to provide a trim voltage - it's output will be around 1.25V or whatever it's internal reference voltage is, then the resistor/pot is used to derive a trim range of something like 0-140mV.
The PNP transistor to increase the current capability (the LM35 cannot provide 20mA by itself)

If we look at the numbers, we want a 16mA increase for 100°C. So this is 0.16mA per °C. We know the output of the LM35 is 10mV°C, so we can calculate the current through the 62.5Ω resistor:

10mV / 62.5Ω = 0.16mA, just what we need as the LM35 outputs 10mV/°C, which produces 0.16mA thorugh the resistor. Since the range is from 4-20mA, we need 4mA drawn to start with though. The LM317 will sink around 2.8mA (1.25V / 452Ω) so we just need another 1.2mA. 1.2mA * 62.5Ω = 75mV, so we trim the pot to about halfway for out zero °C reference at 4mA.

Then the voltage/current across/through the resistor increases. The LM317 current will stay static, so once trimmed it's just the output and PNP sinking the rest of the current. I'm not sure exactly how the LM35 is desinged internally, but it probably involves a compensated feedback amplifier stage to provide a low impedance output.
Roughly, the LM35 will sink current through it's supply pin, some of which comes through the base of the transistor and turns it on, until it's voltage at the output is the desired point.