# How to vary the voltage output depending on the changes in temperature?

I am working with the Siemens Logo8! PLC (0BA8 version) and the purpose of my circuit seems to be simple:

If temp > 25°C then output voltage = 8V

If temp < 25°C and >15°C then output voltage = 5V

If temp <15°C then output voltage = 2V

Is there a possible way in a circuit of doing this?

I achieved a similar concept by using one Analog Input, then 2 Analog Threshold Triggers connected to a latching relay and eventually to a Digital Output. (Picture attached) However, the limitations of that system is that Voltage can be either 1 or 0.

The concept behind the circuit seems to be simple but I am really struggling to make it work and any hints will be much appreciated.

simulate this circuit – Schematic created using CircuitLab

I'll send invoice on schematic entry cost ;)

and if you don't understand my schematic , try this one which I had no trouble understanding in university undergrad in my day..

• Tony Stewart, thank you for getting back to me. After going through the analog comparator, eg if Temp > 25'C, the digital signal would be equal to 1 as the threshold was reached, and therefore after going through a latching relay, the digital output will be equal to 1 too. I can't pull up a digital signal of 1 (after going through a Comparator) to 8V. I need some other functions there, PWM only accepts analog values and the rest of the functions such as Analog Amplifier. How can I compare an analog input value, and as a result produce a set analog output?
– NatD
Commented May 3, 2017 at 12:19
• Let me draw out what I said in text for you to understand. Commented May 3, 2017 at 20:01
• If you cannot generate a Vref or compute R ratios, then I cannot help further Commented May 3, 2017 at 21:25
• That's because Pease also talked you thru it on the phone. Commented Sep 8, 2022 at 7:24
• nope quack quack @DDuck Commented Sep 8, 2022 at 11:42