Anyone care to explain how this piece of circuit work?
I already build it and it works wonders but I can't figure it out.
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.
LM317 needs 3,5..5mA minimal load. The beter serial resistor value between LM317 out/adj pin is about 360..380ohms, which guarantees about 3,5mA load for LM317. Use 300ohms fixed +68 ohm var. resistor, for example. About the adjustment ot zero point (4mA). LM35 outs 0V at 0 degrees C. With pot. 50( or 68 Ohms) you can apply fixed NEGATIVE voltage between LM35 output and 62.5 ohms resistor. Because output voltage of LM35 at 0 degrees must be 0V, it will sinc current to achieve simetrical positive voltage over 62.5 Ohms resistor. Thanks to this you can add 0.5mA to total line consumptions and get 4mA value for 0 degrees. Sorry for bad english. Cheers