Hardware · Control family

Servos and PWM control.

What these are
Small motors that hold an angle you command
You control them
With a PWM signal, one wire
Open Agriculture Technology pick
A PCA9685 to drive many from an ESP32

A servo is a small geared motor that holds whatever angle you tell it to. Unlike a plain motor that just spins, a servo has its own control electronics and position feedback built in, so you send it a single signal and it drives itself to that position and stays there. For a grower it is the cheap, easy way to aim a camera, crack a small vent or louver, turn a feeder gate, or open a little valve to a known angle.

A hobby servo motor
Image: adafruit.com

What a servo is.

Open a hobby servo and you find three things: a small DC motor, a set of reduction gears that trade speed for torque, and a little circuit that reads the output shaft’s position and steers the motor until it matches your command. That feedback loop is the difference. You do not need a motor driver for one servo, because the servo already contains its own. You just give it power, a ground, and a control signal.

How PWM sets the angle.

Servos listen for PWM, pulse-width modulation: a signal that pulses about fifty times a second, where the length of each pulse carries the message. A pulse around one millisecond means one end of the travel, two milliseconds means the other, and one and a half sits in the middle, so the pulse width maps straight to an angle across roughly 180 degrees. PWM is the same trick used to dim an LED or set a fan’s speed; here the width sets position. Any microcontroller can produce it, and a one-line servo library hides the timing so you just say “ninety degrees.”

Positional versus continuous.

Two kinds, and it matters which you buy. A positional servo, the usual sort, moves to an angle and holds it, perfect for setting a vent or a valve to a known position. A continuous-rotation servo has had its feedback removed, so the same signal sets speed and direction instead of angle, and it spins freely; it suits a small turntable or a slow continuous feed. Sizes run from a 9 gram micro servo for light jobs up to metal-gear servos that pull real torque for a heavier gate or damper.

The power gotcha.

This is the one that catches people. A servo draws real current when it moves, and a surprising surge when it stalls against a load, often far more than a controller’s little regulator can give. Power a servo from the ESP32’s 3.3 or 5 volt pin and the first hard move browns out the board and resets it. Give servos their own power supply sized for the stall current, and tie its ground to the controller’s ground so they share a reference. The control signal is tiny; the muscle needs its own feed.

Driving many at once.

One or two servos run straight off a microcontroller’s PWM pins. The trouble starts when you want several, because a controller has only a handful of hardware PWM channels and juggling them in software gets jittery. The fix is a dedicated PWM driver. A PCA9685 drives sixteen servos over two I2C wires and generates the pulses itself, so the controller is free to do other work; the boards chain for even more. A Pololu Maestro goes further, running stored sequences on its own over USB or serial, so it can move a set of servos with no microcontroller at all.

Where they fit, and where they don’t.

Where they fit

  • Aiming a camera or a sensor.
  • Cracking a small vent, louver, or damper to an angle.
  • A feeder gate or a small motorized valve.
  • Light, repeatable positioning on the cheap.

Where they don’t

  • Continuous heavy spinning; use a DC motor.
  • Precise indexing over many turns; a stepper fits.
  • Big force or long travel; a linear actuator does that.
  • Powering from the controller’s rail; give them their own.

Guides and parts.

Straight from the makers; these open in a new tab:

Adafruit servo driver guide Pololu Maestro controllers ESPHome servo Actuators & Control

Three ways to drive them.

Direct from the controller for one or two, a PWM driver for many. The tinted column is the everyday pick for a grow setup built on an ESP32 or a Raspberry Pi.

Ways to drive servos · verified 2026-06-23
Spec Direct from MCU PCA9685Open Agriculture Technology pick Pololu Maestro
Servos A few (hardware PWM pins) 16 per board, chainable 6, 12, 18, or 24
Interface Direct PWM pins I²C, two pins USB or serial
Generates PWM No, the MCU does the timing Yes, on the board Yes, on the board
Runs standalone No No (needs a controller) Yes (stores scripts)
Frees the MCU No Yes Yes, fully
Best for One or two servos Many servos from an ESP32 or Pi Standalone or PC-driven sequences

For the deep dive on the two driver boards, see the PCA9685 for many servos from a microcontroller, and the Pololu Maestro for standalone or scripted control.

Frequently asked questions.

How does a servo know what angle to turn to?

You send it a PWM signal that pulses about fifty times a second, and the length of each pulse sets the angle: roughly one millisecond is one end of travel, two milliseconds the other. The servo’s built-in electronics read the shaft position and drive the motor until it matches, then hold it there.

Why does my servo reset the microcontroller?

Almost always power. A servo pulls a large current surge when it moves or stalls, more than a controller’s small regulator can supply, so the voltage dips and the board resets. Give the servo its own power supply sized for the stall current, and connect its ground to the controller’s ground so they share a reference.

What is the difference between a positional and a continuous-rotation servo?

A positional servo moves to a commanded angle and holds it, good for setting a vent or valve. A continuous-rotation servo has its position feedback removed, so the same signal sets speed and direction and it spins freely, suited to a small turntable or slow feed. They look alike, so check before buying.

How do I control a lot of servos at once?

Use a dedicated PWM driver. A PCA9685 drives sixteen servos over two I2C wires and makes the pulses itself, freeing the microcontroller, and the boards chain for more. A Pololu Maestro can run stored sequences on its own over USB or serial, moving servos with no microcontroller in the loop.

Do I need a motor driver for a servo?

No. A servo already contains its own motor driver and control electronics, so a single servo just needs power, ground, and a PWM signal. You only reach for a separate PWM driver board when you want to run many servos or take the timing load off the controller.