Build it step by step
0 of 7 doneWire the first test
Servo plus to the Nano 5V pin, minus to GND, signal to D9.
Upload and open the monitor at 9600 baud
Watch for the word Booted.
Watch the rail readings
A dip below about 4500 mV while the servo moves is the warning.
Hold the arm gently for a moment
The rail may dip further, or the board may reset.
Wire the fix
Servo plus to the battery pack plus, the pack minus to the Nano GND and the servo minus.
Repeat
The rail stays near 5000 mV and Booted appears only once.
Check the common ground
Without it the servo shakes or ignores the signal.
How do you build a resetting board fault hunt?
A servo makes the Nano reset every time it moves. The sketch reports the 5 V rail while the servo sweeps, so you can see the dip, and then you fix it with a separate battery pack and a shared ground. You need Arduino Nano, SG90 Micro Servo, Battery holder 4 × AA with switch, AA alkaline battery × 4, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 7 steps and about 60 minutes.
- Level
- Intermediate
- Time
- About 60 min
- Parts
- 6
Parts list
- Development BoardsBuyArduino Nano × 1
- Motors & ActuatorsBuySG90 Micro Servo × 1
- PowerBuy
- BatteriesBuy
- PrototypingBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Servo signal (orange or yellow) | Nano D9 | Control |
| Servo plus (red) | Nano 5V (first test) or the battery pack plus (the fix) | Servo power |
| Servo minus (brown) | Nano GND | Ground |
| Battery pack minus (the fix) | Nano GND and the servo minus | Common ground, essential |
| Battery pack plus (the fix) | Servo plus only | Servo power, never to the Nano 5V pin |
Code
A small servo can draw hundreds of milliamps when it starts or meets a load, and a USB port or the Nano's own regulator may not hold the 5 V rail up. When the rail dips below about 4 V, the Nano resets, the Serial Monitor prints Booted again, and the servo jerks. The sketch measures the real rail using the chip's internal reference and prints it with each step of the sweep, so you can see the dip. The fix is to power the servo from its own battery pack of four AA cells, which gives about 6 V and plenty of current, and to join the pack's minus to the Nano's GND so the control signal has a common reference. Never connect the pack's plus to the Nano's 5V pin, and use the same pack only for the servo. If the servo does not reset your board in the first test, add a heavier load by holding the arm, which draws more current, but release it quickly and never force it.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
#include <Servo.h>
Servo arm;
long readVccMv() { // measure the real 5 V rail against the chip's internal reference
ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
delay(2);
ADCSRA |= _BV(ADSC);
while (bit_is_set(ADCSRA, ADSC)) {}
long result = ADCL;
result |= ADCH << 8;
return 1125300L / result; // millivolts
}
void setup() {
Serial.begin(9600);
Serial.println("Booted"); // seeing this again and again means the board is resetting
arm.attach(9);
arm.write(90);
delay(500);
}
void loop() {
for (int a = 20; a <= 160; a += 10) {
arm.write(a);
Serial.print("angle ");
Serial.print(a);
Serial.print(" rail ");
Serial.print(readVccMv());
Serial.println(" mV");
delay(150);
}
for (int a = 160; a >= 20; a -= 10) {
arm.write(a);
delay(150);
}
}What the serial monitor should show
Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual Arduino Nano with its sensors at their default values. Your numbers will follow your real readings, but the format should match.
Booted angle 20 rail 0 mV angle 30 rail 0 mV angle 40 rail 0 mV angle 50 rail 0 mV angle 60 rail 0 mV
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| First test, servo on 5V | Rail dips, maybe repeated Booted |
| With the separate pack and common ground | Rail steady near 5 V |
| Pack ground not joined | The servo twitches or does nothing |
| Pack plus wired to the Nano 5V pin | Never do this |
| Sweep with the fix | Smooth movement |
If it does not work
Servo does nothing with the pack
The grounds are not joined.
Board still resets
Check the pack plus goes only to the servo, and the cells are fresh.
Rail reading looks wrong
The reading is only a guide, use the meter for a check.
Servo buzzes at the ends
Stop at 20 and 160 degrees as in the sketch.
Serial text garbled
Set 9600 baud.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the resetting board fault hunt?
Arduino Nano, SG90 Micro Servo, Battery holder 4 × AA with switch, AA alkaline battery × 4, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).
How long does the resetting board fault hunt take to build?
About 60 minutes for a intermediate maker, in 7 steps.
How do I know the resetting board fault hunt works?
First test, servo on 5V: Rail dips, maybe repeated Booted. With the separate pack and common ground: Rail steady near 5 V. Pack ground not joined: The servo twitches or does nothing.
Servo does nothing with the pack: what should I check?
The grounds are not joined.
Board still resets: what should I check?
Check the pack plus goes only to the servo, and the cells are fresh.
Rail reading looks wrong: what should I check?
The reading is only a guide, use the meter for a check.
Servo buzzes at the ends: what should I check?
Stop at 20 and 160 degrees as in the sketch.
