# Voltage regulator for Stepper and Microcontroller

I'm designing my first PCB for a personal project :

I'm planning to run a Stepper motor (3.8V 670mA/phase) with the DRV8834 driver and an Atmega328P from the same power source.

The power will come from a classic USB charger (rated at 5V, 2A) plugged in my PCB.

Do I need a voltage regulator on my PCB as the power coming should be already regulated to 5V by the USB charger ?

If so, would I need two voltage regulators one for the Stepper that will draw higher amounts of current at times, and another one for the stable microcontroller, or can I use one for both ?

I believe if needed I will go for an LDO 5V - 2A regulator like those found here.

Would it be a good choice ?

• The motor is designed for a nominal voltage of 3.5V so yes, you need a regulator. A good choice would be one that regulates to 3.5 V not 5 V. Jul 17 '17 at 11:50
• My apologies I forgot to mention I will use the provided stepper driver : pololu.com/product/2134 that can run out of 5V. I'll edit my post. Jul 17 '17 at 11:52
• So you will only blow the motor up running at 5 V and not the driver. Jul 17 '17 at 12:03
• You don't need an extra component (regulator). You're going to drive a stepper motor with an H-bridge, and you can regulate it down to 3.5 volt with the H-Bridge. Instead of having a duty-cycle between 0% and 100%, use a duty-cycle of $\frac{3.5}{5}=0.7$, $\frac{1-0.7}{2} = 0.15$ so from 15% to 85% Jul 17 '17 at 12:33
• Driving a stepper motor is similar to driving a speaker, do you find it normal to use 256 buck converters for 256 different settings of maximum audio? Hmm, no. Perhaps you use a class-D amplifier with a duty-cycle that is multiplied by a variable called "Volume" that goes between 0 and 1. Jul 17 '17 at 12:43

Stepper motor coils have high inductance, which resists current changes by inducing an opposing voltage proportional to the rate of current change. In practice this means that to get the motor to step faster you have to apply higher voltage. Current limiting is then applied to account for the lower voltage drop at lower speed. This can be achieved by putting a resistor in series with each phase, or applying PWM which switches the power on and off rapidly to reduce the average current draw.

High performance stepper motors are usually operated on a higher voltage than their coil rating. 3.8V is the voltage drop across each phase of your motor when passing a constant (DC) current of 670mA, not the design supply voltage. To run it on 5V you just have to limit the phase current to 670mA.

The DRV8834 uses PWM to reduce current draw. The Pololu DRV8834 breakout board has a potentiometer for adjusting the current limit.

• +1 ... This answer is spot-on. I can only guess that the down-vote came from someone who doesn't understand high-performance stepper driving and chopper drives. With the DRV8824, externally regulating the motor voltage down to 3.8V will only serve to inhibit performance.
– Tut
Jul 17 '17 at 13:40
• Thank you, it is indeed how I understood the usage of the Pololu driver board (they have a nice explanatory video describing the current limiting process). Regarding the second part of the question, is it good practice tu put a voltage regulator on a PCB knowing that the power coming from the USB charger should already be regulated to 5V ? Jul 18 '17 at 10:10
• You don't need a 5V regulator because USB is already regulated at 5V. However the stepper motor may induce some noise into the power supply, so you should either filter the MCU power or regulate it down to a lower voltage (eg. 3.3V). Jul 18 '17 at 18:16

Be careful with the regulator. Ensure you use a package that will dissipate the power. One of those looks like a SOIC8 and would likely not suffice. Current Drawn x (5-output voltage) gives power lost in regulator and the datasheet will tell you temperature raised per watt dissipated.

If your stepper motor can't take 5V (a quick glance simply says it's rated at 3.8V), you will need a regulator for it. You can probably use the same regulator for the AVR too, it depends on the frequency you're running it at. (Check the frequncy vs voltage limitations on the AVR datasheet). Also, it might make interfacing between micro, stepper motor driver and the motor itself easier if all are running at 3.8V.

You might want to run the supply from regulator to the AVR though ferrites to each power pin and, most importantly, make sure you have the biggest possible uninterrupted ground plane along with thick, thick power tracking.

You may try to add a resistor in series with 5V regulator where that supply goes to stepper motor. To supply 3.5 V to stepper motor whose current rating is 670mA/ phase, you need to add a resistor of ~2.24 Ohm. It drops 1.5 V supply before Supply goes to that stepper motor.

Calculation: Voltage (drop) = 1.5 V Current = .67 A.

          Resistor      = 2.24 (approximately)