I have LD1084V adjustable voltage regulator powering servo and want to control its output from MCU. Optocoupler should behave as variable resistor so my thinking was : schema

I am mainly concerned with gray rectangle area - other part works fine so far.

MCU is Attiny85. I've measured current at RP2 when running servo at full speed (by voltmeter only) and it was 0.9 mA max. Optocoupler should bypass RP2, when fully open. R1 is for diode protection. R3+C1 should smooth PWM to somehow-steady analog voltage.

I've used lot of internet to put it together, but I am still a noob ... so could as well missunderstood some parts all together.

I didn't tested it yet (I expertly killed my only opto at hand, so waiting for replacement).

I want to ask if my thinking is right and if this can be done with transistor-based opto (photodiode ones are a bit pricey)?


  • \$\begingroup\$ Why do you need to vary the power supply voltage to the servo? If it is a standard servo like is used in remote controlled cars and airplane models, then you should just give it its rated voltage and leave it at that. \$\endgroup\$ – JRE Feb 12 at 10:47
  • \$\begingroup\$ I need ability for users to adjust torque moment. \$\endgroup\$ – Jirka Justra Feb 12 at 10:55
  • \$\begingroup\$ What kind of servo is it? \$\endgroup\$ – JRE Feb 12 at 11:04
  • \$\begingroup\$ jxservo.cz/JX-servo-PDI-5521MG-360-digital-55g-20kg-d119.htm \$\endgroup\$ – Jirka Justra Feb 12 at 11:13
  • \$\begingroup\$ You wouldn't normally mess with the power supply to such a servo. Why do you want to limit the torque? \$\endgroup\$ – JRE Feb 12 at 11:40

You'd better to start again from scratch. Your servo for sure doesn't need a linear PSU, you could use a buck converter for that purpose. Next thing that you do want to have is a LDO with PWM adjusting as it makes a PSU with lots of noise and lots of heat dissipation, a useless power supply. Further it is not clear why the galvanic isolation is needed.

  • \$\begingroup\$ Galvanic is not needed, anything that can act as variable resistor is acceptable. Noise should be mostly taken by low-pass filter R3+C1. Heat is in OK level so far. For this concrete application LDO seems to be right choice. But I may overlook something. \$\endgroup\$ – Jirka Justra Feb 12 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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