Sub topic 13
Troubleshooting: resets, jitter, hot parts, and silent motors
Assume you can upload an Arduino sketch, use pinMode() and digitalWrite(), and read a simple wiring diagram. You also need to know the difference between an Arduino supply, an external motor supply, and ground.
Motor problems usually come from power wiring rather than from the control code. Test one part at a time. Disconnect the motor before changing wires, and do not touch a hot component until it has cooled.
A reliable troubleshooting order
- Turn off power.
- Check the wiring against the driver or servo pin labels.
- Confirm that the motor supply voltage matches the motor.
- Confirm that the Arduino ground and external supply ground are connected.
- Test the control signal with the motor disconnected.
- Connect the motor and test at low speed or a small servo angle.
- Measure the supply voltage while the motor starts or changes direction.
A multimeter is useful. Measure voltage directly across the motor supply terminals during operation. A large drop means the supply, wiring, connector, or battery cannot provide the required current.
Resets and brownouts
A brownout is a temporary drop in supply voltage. The Arduino may reset when a motor starts because the motor draws a large startup or stall current. A servo can cause the same problem when it accelerates or reaches a load.
Use these fixes:
- Power the motor or servo from a suitable external supply.
- Connect the external supply ground to Arduino
GND. - Place a bulk capacitor near the motor driver or servo supply, such as 100–470 µF, with the correct polarity.
- Add a 0.1 µF ceramic capacitor near sensitive electronics or the driver board.
- Use short, thick power wires and reliable connectors.
- Avoid powering a high-current servo through a weak USB cable or breadboard power rail.
The common ground carries the signal reference. It does not mean that the motor current should flow through an Arduino I/O pin.
Servo jitter
A servo needs a signal wire, a supply wire, and a ground wire. If the signal ground is missing or loose, the servo may twitch unpredictably. Jitter can also result from:
- A supply voltage that sags under load.
- A long signal wire near motor wires.
- Mechanical load, binding, or a damaged gear.
- Rapidly changing commands in
loop(). - A servo signal that is sent before
attach()or after the servo is detached.
Keep servo power separate from Arduino power when practical, but connect their grounds. Command a stable angle and observe whether the servo still jitters. If only one servo jitters, swap the servo or signal wire. If every servo jitters, suspect the supply or grounding.
Hot parts and silent motors
A hot MOSFET may not be logic-level, may be wired incorrectly, or may be carrying more current than its rating. A hot motor may be stalled. A stalled motor can draw its stall current continuously, so remove power quickly.
A silent motor often has one of these causes:
| Symptom | Likely cause | Check |
|---|---|---|
| No movement or sound | No motor supply | Measure voltage at the driver output or motor terminals |
| Driver LED is off | Standby or enable input is inactive | Set `STBY` or `ENABLE` to the required active level |
| Motor works only with USB connected | Missing common ground | Connect external supply ground to Arduino `GND` |
| One direction works | Direction input or H-bridge channel fault | Check both direction pins and motor terminals |
| Driver becomes hot immediately | Short, stall, or excessive current | Remove power and check the load and driver rating |
For a MOSFET circuit, verify the gate, drain, and source pinout from the exact datasheet. Package shapes are not a reliable guide. The flyback diode must be across the motor, with its cathode toward the positive motor supply.
A controlled motor test
For an H-bridge channel, begin with a low command and a free-spinning motor:
const int PWMA = 5;
const int AIN1 = 7;
const int AIN2 = 8;
const int STBY = 4;
void setup() {
pinMode(PWMA, OUTPUT);
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);
pinMode(STBY, OUTPUT);
digitalWrite(STBY, HIGH);
digitalWrite(AIN1, HIGH);
digitalWrite(AIN2, LOW);
}
void loop() {
analogWrite(PWMA, 80);
delay(1000);
analogWrite(PWMA, 0);
delay(1000);
}If this test fails, inspect power and enable wiring before changing the speed value. If it works unloaded but fails under load, the motor supply or driver may be undersized.
Trace the fault from power to load
Exercise
A servo resets the Arduino whenever it starts moving. What should you check first, and why?
Show answer
Check the servo supply voltage while it moves and verify a common ground. The servo's startup current may sag the shared supply, causing a brownout reset.