I need to create an analog voltage of 0V-10V for the PLC with a microcontroller with operating voltage 5V.


I've been doing this research since last week. I'll share the results of my research. I need your feedbacks.

First of all, my microconotroller dont have any DAC module. So I'm going to produce an analog signal through the I2C with the mcp4725. (https://www.sparkfun.com/products/12918)

I will then raise this signal to 10V with an opamp.I think I will use this LMV358 module. (https://www.sparkfun.com/products/9816)

There's a problem here. I need a lot of these analog outputs. But the mcp4725 addresses are restricted. So I will multiply I2C addresses with TCA3548A. (https://www.adafruit.com/product/2717)

The modules I use are ready products. I think I don't need to draw a schematic. Anybody have a better idea? Do you think this works? If it works, will it make any problems?

Yes, I need your comments and suggestions.

Best regards

  • 1
    \$\begingroup\$ You'll need a 12 volt supply for the op-amp - op-amps don't just magic-up voltages without the proper power rails. You might also consider using a small negative rail too. \$\endgroup\$
    – Andy aka
    Mar 7, 2019 at 11:16
  • \$\begingroup\$ It should work, however.. it seems a bit umm.. "inelegant".. to convert many channels of digital to analog and then back to digital. Can't you talk serial digital to the PLC? \$\endgroup\$ Mar 7, 2019 at 15:21

1 Answer 1


There is a simpler way to do that with PWM + Filter, you don't need a DAC and is much easier to translate to 10V and is cheaper.

The opamp is a buffer stage that is optional and depends if your PLC has a high impedance or not. You need a rail to rail opamp (might need a different part that there is on the schematic).

PWM signal is directly 0-3V or 0-5V and the output is 0-10V. The output might not be directly linear, but this you can adjust in the code.

This circuit will have a small ripple, you can add more R-C filter stages or increase C1 to reduce it.


simulate this circuit – Schematic created using CircuitLab


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.