What you will learn
  • Distinguish positional servos from continuous-rotation motors.
  • Separate control signals from motor power.
  • Wire a servo with a common reference ground.
  • Command a limited motion range.
  • Explain PWM, stall current and driver selection.

Before you begin

Understand voltage, ground and digital outputs. Build only the servo example here; the complete DC motor rover is specified in ARD09.

A signal is not a motor supply

A pin can tell a motor system what to do, but that does not mean the pin can supply the energy to do it. A motor draws electrical current to create torque, the turning effect at its shaft. Starting, accelerating and resisting a load can require substantially more current than spinning freely.

A brushed DC motor normally rotates continuously while powered. Reversing the voltage across it reverses its direction. A motor driver uses switching electronics to provide that current and direction under control of smaller logic signals.

A standard positional hobby servo contains a motor, gears, position feedback and a controller. You request a shaft position using a timed pulse signal, and the internal controller tries to reach it. A continuous-rotation servo uses similar pulses to request speed and direction instead, so it is not interchangeable with a positional servo.

The worked build uses a TowerPro SG90 positional micro servo, not an unverified clone or a continuous-rotation variant. Check your unit’s manufacturer documentation and wire labels. Its nominal angle command is not a guarantee of exact shaft angle; linkage and end stops differ.

Wire a separate low-voltage supply

Use a regulated 5 V servo supply rated for at least 2 A for this unloaded one-servo exercise, with a readily accessible switch or disconnect. Never connect that supply’s positive terminal to the Uno 5V pin while the Uno is powered by USB. Join only the grounds so both devices agree on the signal reference.

With all power disconnected, connect the servo signal lead to Uno D9, its positive lead to external 5 V and its ground lead to external supply ground. Connect that same ground to Uno GND. A 10 kΩ resistor from D9 to GND provides a defined low signal before the sketch takes control.

Remove the horn or keep it completely unloaded for the initial test. Secure the servo body, keep fingers and loose wires away from moving parts, and avoid forcing the shaft. Power the Uno first, then enable the servo supply. Startup can still produce a small movement, so physical clearance is part of the test.

Do not power a motor from an I/O pin or assume the USB-powered board can handle its current surges. If the servo chatters, heats or repeatedly hits an end stop, disconnect motor power before debugging.

PartConnection or purpose
Uno R3 and USB cableRuns the sketch
TowerPro SG90 positional servoD9 signal; external 5 V positive; shared ground
Regulated 5 V supply, at least 2 A, with disconnectServo power only
10 kΩ resistorD9 to common GND
Jumper wires and secure mountShort reliable connections and restrained body

Run a restrained sweep

Install the official Servo library using the IDE Library Manager if it is not already available. The Servo library documentation describes its API. Upload this Arduino C/C++ sketch with servo power off, then enable servo power.

cpp
#include <Servo.h>
Servo pointer;

void setup() {
  pointer.attach(9);
  pointer.write(90);
  delay(1000);
}

void loop() {
  pointer.write(70);
  delay(1200);
  pointer.write(110);
  delay(1200);
}

Servo creates a library object that generates the repeating control pulses. attach(9) selects its signal pin, and write() requests nominal positions in degrees. The small 70–110 range deliberately avoids the advertised endpoints. The library continues generating pulses while delay() pauses this simple main program.

Expected result: An unloaded positional servo first aims near its center, then alternates between two nearby positions. Exact angles and direction depend on the physical servo.

How DC motor control differs

For a DC motor, a driver often provides two direction inputs and a PWM input. PWM rapidly switches the motor’s supply connection; increasing its duty cycle generally increases available drive. Duty cycle is not a direct guarantee of rotational speed because battery voltage, friction and load also matter.

An H-bridge is a switching arrangement that can apply either polarity across a motor. ARD09 uses a Pololu TB6612FNG carrier. Its documented continuous current is 1 A per channel under suitable conditions; its higher transient peak rating is not permission to run that current continuously. Check the carrier documentation.

Choose a driver using the motor’s stall current at the actual supply voltage, not only its no-load current. Stall means the shaft is prevented from turning, a condition that can overheat motors and drivers. Do not deliberately hold a powered shaft to measure this in a beginner exercise; use documented specifications.

The Uno’s analogWrite() PWM and a servo’s timed position pulses serve different interfaces. Sending analogWrite to an ordinary servo is not the substitute for Servo.write. Libraries can also use hardware timers and affect PWM availability on particular pins; verify that before combining motor and servo code.

Test movement as a system

The first acceptance check is modest: the servo moves between two limited positions without resets, excessive noise, heat or wire movement. Watch several cycles, then switch off servo power before touching the mechanism.

A sketch can be correct while the power system is inadequate. If the Uno resets when the servo starts, examine supply separation and common ground. If nothing moves, verify the exact servo lead order, D9 connection and supply polarity. If it rotates continuously, confirm that the hardware is really positional.

The separate servo supply is also your immediate stop method. Software stop behavior helps, but unplugging motor power is the practical fallback during bench experiments. Future robot builds add sensors, bounded commands and fault behavior because movement should depend on more than a recent AI or user request.

Important terms

Actuator
A component that produces a physical effect such as motion.
Torque
Turning effect about an axis.
Servo
A motor system that uses feedback to regulate a requested condition.
H-bridge
A switching circuit that can reverse voltage across a motor.
Stall current
Current drawn when a powered motor cannot rotate.
Common ground
A shared electrical reference between connected circuits.

Mini project: Observe commanded and actual motion

  1. Assemble the unpowered signal and separate-supply wiring.
  2. Upload with servo power disabled.
  3. Secure the unloaded servo and enable its supply.
  4. Observe the center and two limited positions for five cycles.
  5. Disconnect servo power and record whether movement, sound and controller stability met expectations.

Common mistakes and debugging

  • Powering the servo from a GPIO pin: use the documented separate supply.
  • Joining both positive supplies: keep external servo 5 V separate from USB-powered Uno 5V.
  • Assuming a 90 command measures 90 degrees: calibrate actual mechanical position if precision matters.
  • Selecting a driver by peak current alone: check continuous conditions and motor stall specifications.

Independent challenge

Change the two requested positions to 80 and 100 degrees. Predict how the motion changes and explain why this does not reduce every possible startup risk.

Check your understanding: 10 questions

  1. Why does a motor need more than a GPIO signal?

  2. Which supply connections are shared in this build?

  3. Does Servo.write(90) prove the shaft is exactly at 90 degrees?

  4. What is stall current?

  5. Why is a continuous-rotation servo unsuitable for this position exercise?

  6. In your own words, what does “Actuator” mean?

  7. In your own words, what does “Torque” mean?

  8. In your own words, what does “Servo” mean?

  9. In your own words, what does “H-bridge” mean?

  10. In your own words, what does “Stall current” mean?

Quiz answers

Reveal all 10 answers after your attempt
  1. It needs a suitable power source and switching electronics to supply its current.
  2. Grounds are shared; the positive servo supply is not connected to Uno 5V.
  3. No. It sends a nominal position command; actual angle depends on the servo and mechanism.
  4. Current drawn when an energized motor’s shaft cannot turn.
  5. Its pulse commands control rotation speed and direction rather than a fixed shaft position.
  6. A component that produces a physical effect such as motion.
  7. Turning effect about an axis.
  8. A motor system that uses feedback to regulate a requested condition.
  9. A switching circuit that can reverse voltage across a motor.
  10. Current drawn when a powered motor cannot rotate.

Summary

Control information and motor energy follow different paths. Safe movement starts with compatible hardware, a suitable supply, common ground and a deliberately limited first test.

Continue learning

ARD07 displays measurements and status without needing a connected Serial Monitor.

Choose a connected learning path

Sources and further reading

Prepared 2026-09-18. Editorial draft; primary documentation consulted. Hardware build not bench-tested; code has not been executed on the reference board.