Here's my power supply (schematic except without the transformer since my source is already at 24 V AC and using a 100 uF electrolytic as my smoothing capacitor):

24 VAC rectifier -> 100 uF smoothing cap -> LM317 linear regulator (typical application on page 10 of LM317, running at 3.3V)

And my servo motor is an MG90S. I am feeding it 5V from a boost converter using an AAT1217.

With the servo motor disconnected, I see the servo motor source voltage at 5V and the signal line is giving the pulses required to drive the servo motor. With the servo motor connected, there is a periodic voltage drop to ~1V, causing my MCU to brownout. I hear the servo motor twitching, so it seems like the circuit is trying.

Other stuff I've tried:

  1. Bypassing the 24 VAC and using a 3.3V DC power supply, the servo rotates fine, drawing about 200 mA from the power supply.
  2. Using a 24 VDC source, the servo rotates fine
  3. Using a larger smoothing capacitor (1mF) with 24 VAC, the servo still doesn't work. The voltage drop still occurs and the LM317 gets really hot.

I was thinking that the smoothing capacitance was not large enough so there wasn't enough current going into the servo but (3) disproves that. In addition, using smoothing capacitance calculations (C = (I * t) / dV), it seems like I should not need more than 100 uF. Any ideas what else could be wrong?

So, just to defend the LM317 choice a little,

  1. The servo motor is on no more than 10s per day and not more than a few hundred ms each time.
  2. With that, I was hoping that using a simple linear voltage regulator would be ok in terms of both cost and complexity.
  • 5
    \$\begingroup\$ Can we please stop saying LDO (Low DropOut regulator) to every linear regulator? The LM317 is about as far from an LDO as you can get. \$\endgroup\$
    – JRE
    Commented Jun 30, 2015 at 12:04
  • 1
    \$\begingroup\$ @JRE I slightly love you now. \$\endgroup\$
    – Asmyldof
    Commented Jun 30, 2015 at 12:05
  • 1
    \$\begingroup\$ As to your update: Another why: Why go from 3.3V to 5V with a boost, after taking 24VAC =~ 33VDC to make the 3.3V in the first place? 5V at 200mA = 1W, is 303mA at 3.3V with 100%, using just a chip and an own design, I'd say you're not above 90%, so say 335mA. So 200mA at your 5V is already, without anything added 30*0.335 = 10W in your regulator. \$\endgroup\$
    – Asmyldof
    Commented Jun 30, 2015 at 12:08
  • 2
    \$\begingroup\$ You're reducing 34VDC down to 3.3V with an LM317, then boosting it back up to 5V at relatively high current with a switching regulator!? Madness. Probably your regulator is thermally shutting down to protect itself! At 200mA/5V your LM317 regulator dissipation would be in the 11W range! Or your transformer is an impedance protected type- measure the AC voltage when it cuts out- but a proper source will make it get even hotter! \$\endgroup\$ Commented Jun 30, 2015 at 12:11
  • 2
    \$\begingroup\$ sometimes i swear these questions are a setup, and someone somewhere is ROFLing at us... \$\endgroup\$ Commented Jun 30, 2015 at 12:15

2 Answers 2


24V AC when rectified and smoothed produces a DC level of about 32V. You are using the LM317 to produce 3.3V and then it seems that you are stepping this up to produce 5V for the motor. The regulator you are using is capable of producing over 1A.

You say your stepper motor consumes 200mA and this will require the LM317 to supply about 300mA into the booster.

300mA thru the LM317 whilst dropping about 29V gives a heat power dissipation of about 8.6 watts and you'll need a heatsink or the LM317 will just shut-down.

With a 24V DC supply the problem will be less but still the power dissipated by the LM317 could be as high as 6 watts.

  • \$\begingroup\$ tl;dr: You're wasting >90% of your energy as heat. \$\endgroup\$ Commented Jun 30, 2015 at 13:04
  • \$\begingroup\$ Right, I guess another way to validate that the LM317 is shutting down is by using a smaller AC source. I'll give that a shot tomorrow. \$\endgroup\$
    – rith87
    Commented Jun 30, 2015 at 16:18
  • \$\begingroup\$ Also, I guess the other way to fix this issue is to use a switching regulator instead of a linear one? \$\endgroup\$
    – rith87
    Commented Jun 30, 2015 at 16:40
  • \$\begingroup\$ @rith87 yes, use a buck regulator to produce 5V and then another to produce 3V3 although you could use a linear from 5V to 3V3. \$\endgroup\$
    – Andy aka
    Commented Jun 30, 2015 at 17:43
  • \$\begingroup\$ So, yeah, it seems like the LM317 thermal shutoff starts to occur at 30VDC. I guess I'm still surprised that I'm not able to pull 300 mA through the linear regulator for just a few hundred ms. Anyway, thanks for the answer. \$\endgroup\$
    – rith87
    Commented Jul 1, 2015 at 8:29

Look at the LM317 data sheet you have linked to. On the first page, under "Features", the 4th feature is "Thermal overload protection". As Andy aka has pointed out, using 24 volts dissipates far too much heat in the regulator. What you are seeing is a thermal relaxation oscillator, made worse by the fact that you have no heat sink at all on your regulator. When you apply power the motor gets voltage and current, and starts to move. After a bit (longer the first time, since the regulator is heating up from room tenp), the LM317 overheats, the output shuts down to 1 volt, and the MCU quits. After a bit, the IC cools down to the lower limit, and the output turns back on. The cycle repeats.

If you're feeling curious, get a heat sink of some sort (a piece of aluminum will do, the bigger the better) and clamp it to your regulator. Make sure nothing in your circuit is touching the aluminum. You should see that the motor runs for longer before it quits, followed by longer pauses between twitches. If you now blow a high-speed fan on the aluminum, you should see longer twitch time with shorter pauses between twitches.

As should be obvious from all this, the simple solution is to use a 5-6 VAC transformer, although you'll still need a heat sink on your regulator.


Your Answer

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

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