Sub topic 7
What a small DC motor demands: stall current and back-EMF
This chapter assumes you have read the earlier chapters on pin current limits and on external motor power with a common ground. You should be comfortable with voltage, current, and Ohm's law, and with uploading simple sketches. By the end you will be able to read a motor's datasheet, size a supply and a driver for it, and explain why a motor that works fine on the bench can reset your Arduino the moment it is loaded.
A motor is not a resistor
A brushed DC motor looks like a simple load, but it behaves differently from an LED or a resistor. Inside, a coil of wire (the armature) rotates inside a magnetic field. That coil has two properties that matter to you:
- It has resistance, which limits current when the motor is not turning.
- It has inductance, which resists changes in current.
It also does something a resistor never does. While it spins, it acts as a generator and pushes a voltage back against your supply. That voltage is the back-EMF (back electromotive force). Together, these three facts explain most motor problems you will meet.
The simplified electrical model is a series circuit:
- Supply voltage
Vdrives the circuit. - Winding resistance
Rdrops some voltage as current flows. - Back-EMF
Eopposes the supply.
This gives the working equation:
I = (V - E) / RThe current is set by the gap between the supply voltage and the back-EMF, divided by the winding resistance.
Back-EMF: why a spinning motor draws less current
Back-EMF is proportional to speed. A motor that spins twice as fast generates roughly twice the back-EMF. This is the same physics as a generator: a coil moving in a magnetic field produces a voltage.
Consider what that does to the current in I = (V - E) / R:
- At standstill,
Eis zero. The full supply voltage appears across the small winding resistance. Current is at its maximum. - As the motor speeds up,
Erises and the gapV - Eshrinks. Current falls. - At full free-running speed,
Eis close toV. Only a small current remains, enough to overcome friction and windage. - If load slows the shaft,
Edrops and current rises again to supply the extra torque.
Torque is proportional to current. That is how the motor "asks" for more power under load: it slows slightly, back-EMF falls, and more current flows. You do not control this directly. You control voltage, and the load decides the current.
The numbers on a datasheet
Hobby motor datasheets and supplier listings usually give a few figures at a rated voltage. The ones you need are in this table.
| Figure | Meaning | Why it matters to you |
|---|---|---|
| No-load current | Current when spinning freely | Lower bound on what your supply must deliver |
| No-load speed (RPM) | Speed with nothing attached | Sets how fast the motor runs unloaded |
| Rated or running current | Current at the intended load | Size your continuous supply and driver around this |
| Stall current | Current with the shaft held still | Peak demand; size the driver and fuse for this |
| Stall torque | Torque with the shaft held still | Maximum pulling force at that voltage |
| Winding resistance | Resistance measured at the terminals | Lets you estimate stall current yourself |
Many cheap motors list only voltage and no-load figures. In that case you can estimate stall current yourself with Ohm's law, because at stall the back-EMF is zero:
I_stall = V / RFor example, a small motor with 2 ohms winding resistance on a 6 V supply can draw up to 3 A at stall. Measure the resistance with a multimeter across the motor terminals. Turn the shaft slowly by hand while measuring, and take an average, because the brush contacts make the reading wobble. Treat the result as a rough figure. Brush and contact resistance, supply sag, and warming windings all move the real number.
Stall current is the number that breaks things
Compare the three states of a typical small hobby motor, such as a yellow gearmotor on 6 V. These figures are representative, not from any specific part:
| State | Typical current | Notes |
|---|---|---|
| Free-running | 0.15 to 0.25 A | Back-EMF near supply voltage |
| Normal load | 0.5 to 1 A | Rolling a small robot on a flat floor |
| Stalled | 2 to 3 A | Shaft blocked, wheel jammed, gear stripped |
The Arduino pin limit is far below even the free-running figure. The absolute maximum on an AVR pin such as the one on an Uno is 40 mA, and 20 mA is the recommended working figure. Even the quietest motor is five to ten times past the maximum. A stalled one is nearly a hundred times past it.
Stall current matters for four separate reasons.
- Driver rating. A transistor or driver chip rated for 1 A will overheat or fail if the motor stalls at 3 A. Pick a driver whose continuous rating exceeds the running current and whose peak rating exceeds the stall current, or add current limiting.
- Supply capacity. A supply that can only deliver 1 A will sag when the motor stalls. The voltage drops, and anything else on that supply may misbehave.
- Heat in the motor. At stall, almost all electrical power becomes heat in the windings, because no mechanical work is done. A small motor held stalled can overheat and damage its insulation within tens of seconds to a few minutes.
- Start-up surge. Starting looks like a brief stall. Back-EMF is zero at the first instant, so the motor draws near-stall current until it spins up. Every start is a short spike.
Inductance: the other half of the problem
Back-EMF explains why current falls as the motor speeds up. Inductance explains what happens when you switch the motor off.
The winding is a coil, and a coil stores energy in its magnetic field while current flows. An inductor resists any sudden change in current. When you open a switch in series with the motor, the current wants to keep flowing. With nowhere to go, the coil forces the voltage across itself to whatever level is needed to push current through the open switch. That produces a short voltage spike, often many times the supply voltage and of reversed polarity.
This is called inductive kickback or a flyback spike. It can destroy a transistor, damage a driver chip, and inject noise into the rest of the circuit. The next chapter covers the flyback diode that provides the current a safe path. For now, remember the cause: the motor is both a generator (back-EMF) and an energy store (inductance), and your switching circuit has to cope with both.
Brushes add to the problem. As the brushes slide across the commutator segments, they make and break contact thousands of times per second. Each break is a small kickback and a small arc. This is why brushed motors produce broadband electrical noise that can reach your microcontroller through shared power lines or through the air.
Motors also push back when you stop driving them
Because back-EMF exists whenever the shaft turns, a motor that is being spun by something else becomes a generator. Spin a small DC motor by hand with its leads connected to a multimeter on a volts range, and you will see a voltage that rises with speed. This is a good bench test: it confirms the motor works, and it shows the proportionality between speed and back-EMF.
The same effect has two practical consequences:
- A robot rolling downhill with the motor unpowered will push voltage back into whatever is connected to the motor terminals.
- When you cut power to a spinning motor, the motor coasts and keeps generating. If the motor terminals are shorted together (by an H-bridge in brake mode, for example), that generated current flows through the windings and brakes the motor sharply. The later H-bridge chapter returns to this.
Estimating what your supply and driver must handle
Work through a concrete example. Suppose you choose a small gearmotor rated at 6 V, with these measured or listed values:
- Winding resistance: 2.4 ohms
- No-load current: 0.2 A
- Expected running current: 0.7 A
First estimate stall current:
I_stall = 6 V / 2.4 ohm = 2.5 AThen apply simple design rules:
- The driver must handle at least 2.5 A, or you must limit current in some other way. Choose one rated for 3 A or more to leave margin.
- The supply should deliver the stall current without sagging below the voltage the Arduino and driver need. A pack of four AA cells has noticeable internal resistance. It may drop well below 6 V at 2.5 A. A lithium or sealed lead-acid pack handles it better.
- Wires and connectors must carry that current without heating. Thin jumper wires and breadboard contacts are rated for well under 1 A in practice. Use thicker wire and screw terminals for the motor path.
You can check your estimate at run time. Put a multimeter in series with the motor supply and set it to the 10 A range. Run the motor free, then load it by gripping the output shaft gently, and watch the current rise.
Seeing the surge in a sketch
The following sketch reads a current-sense value and reports it, so you can see the start-up surge. It assumes you have a current-sense module, such as an ACS712 breakout, wired to analog pin A0 with the motor's supply passing through it, and a MOSFET driver on pin 5 as set up in a later chapter. The constants are for the 5 A version of the module (185 mV per amp) and a 5 V reference, so adjust them for your module.
const int MOTOR_PIN = 5;
const int SENSE_PIN = A0;
const float VREF = 5.0; // ADC reference in volts
const float SENSOR_ZERO_V = 2.5; // output at 0 A for a 5 V module
const float SENSOR_V_PER_A = 0.185; // 185 mV per amp (5 A module)
float readAmps() {
int raw = analogRead(SENSE_PIN);
float volts = raw * VREF / 1023.0;
return (volts - SENSOR_ZERO_V) / SENSOR_V_PER_A;
}
void setup() {
Serial.begin(115200);
pinMode(MOTOR_PIN, OUTPUT);
Serial.println("ms,amps");
}
void loop() {
unsigned long start = millis();
analogWrite(MOTOR_PIN, 255); // full speed from standstill
while (millis() - start < 1500) {
Serial.print(millis() - start);
Serial.print(',');
Serial.println(readAmps(), 2);
delay(20);
}
analogWrite(MOTOR_PIN, 0);
delay(2000); // let the motor stop fully
}Open the Serial Monitor or Serial Plotter. Each run should show a high first reading that falls over a few hundred milliseconds to a much lower steady value. The high reading is the start-up surge. The steady value is the running current at no load. Because PWM at full duty (255) holds the pin constantly high, the reading is steady instead of a rapidly switching signal. At lower duty cycles the current is chopped, and a slow analogRead will give scattered values.
Soft-starting to reduce the surge
Because the surge happens when back-EMF is zero, you can reduce it by raising the voltage gradually so back-EMF builds as current flows. With PWM, that means ramping the duty cycle instead of jumping to full:
const int MOTOR_PIN = 5;
void rampTo(int target, int stepDelayMs) {
static int current = 0;
while (current != target) {
current += (target > current) ? 1 : -1;
analogWrite(MOTOR_PIN, current);
delay(stepDelayMs);
}
}
void setup() {
pinMode(MOTOR_PIN, OUTPUT);
}
void loop() {
rampTo(255, 4); // about one second to reach full speed
delay(2000);
rampTo(0, 4);
delay(1000);
}A soft start lowers peak current and mechanical shock on gears. It does not help at a true stall, because a blocked shaft never builds back-EMF.
Common mistakes
- Sizing for running current only. The motor works on the bench, then the driver burns out the first time a wheel jams.
- Trusting the rated voltage as a limit. A 6 V motor will often run on 9 V, but it draws more current, runs hotter, and wears its brushes faster.
- Ignoring the supply's internal resistance. A weak battery sags under surge and resets the Arduino, which looks like a software bug.
- Measuring current with the wrong meter range. Many multimeters fuse the 10 A input at a lower value, or have no fuse on it at all. Check your meter before you stall a motor through it.
- Assuming a bigger motor is safer. A larger motor has a larger stall current and needs a larger driver.
Summary of the model
| Behavior | Cause | Consequence for your circuit |
|---|---|---|
| Current falls as speed rises | Back-EMF opposes the supply | Surge at start, low current when free-running |
| Current rises under load | Speed drops, back-EMF falls | Supply and driver must handle the loaded case |
| Very high current when jammed | Back-EMF is zero at stall | Size for `V / R`, or limit current |
| Voltage spike when switched off | Winding inductance | Needs a flyback path |
| Electrical noise while running | Brush commutation | Needs decoupling and good wiring |
Exercise
A 12 V brushed DC motor has a measured winding resistance of 4 ohms and a free-running current of 0.3 A. (a) Estimate its stall current. (b) You plan to drive it with a transistor rated for a continuous 1.5 A. Is that adequate, and what could you do if the motor might stall? (c) Why does the free-running current come out far lower than 12 V divided by 4 ohms?
Show answer
(a) At stall back-EMF is zero, so I = V / R = 12 / 4 = 3 A. (b) No. A stall would draw about 3 A, twice the transistor's continuous rating, so it could overheat and fail. Use a driver rated above 3 A, or limit current with a current-limited supply, a fuse, or current sensing that cuts the PWM. (c) A spinning motor generates back-EMF that nearly equals the supply voltage. The current is (V - E) / R, and with E close to 12 V the difference is small, so only about 0.3 A flows, enough to overcome friction.
Exercise
You add a soft-start ramp to your sketch and the motor starts more gently. Your robot still draws a large current spike, and the driver gets hot, when its wheel is jammed against a wall. Why does the ramp not help, and what should the sketch or hardware do instead?
Show answer
A ramp helps because back-EMF builds as the motor speeds up, which reduces the gap V - E. A jammed shaft never turns, so back-EMF stays at zero and the current is V / R whatever the duty cycle you have ramped to. The fix is to detect the stall and cut power. Use a current-sense reading above a threshold, or detect that an encoder is not moving, and then set the PWM to zero. A fuse or current-limited supply gives a hardware backstop.