← all builds

From-Scratch Build · Physical Computing

Servo-Driven Power Switch

Some devices have no remote power control — just a physical button. This build gives a Raspberry Pi a tiny robotic finger: a servo motor that presses the power button of an audio amplifier automatically, so the amp wakes up the moment the Pi boots. Rebuilt from scratch to learn GPIO, servo torque and boot-time automation.

Raspberry PiServo motorGPIO gpiozerosystemd

What it is

A robotic finger for a dumb button

I wanted a Raspberry Pi to stream music to a stand-alone amplifier — but the amplifier only turns on via a physical front-panel button. There's no network control, no trigger input. So instead of replacing the hardware, I automated the press itself.

A small servo motor is mounted against the power button. When the Pi finishes booting, a script swings the servo arm, the arm pushes the button, and the amp comes to life. No human in the loop, and nothing about the amplifier had to change.

The core idea I wanted to learn: when a device can't be controlled in software, you can still control it in the physical world. A few degrees of servo rotation, timed to boot, replaces a finger.

The stack

Tools under the hood

A small project, but every layer taught me something. Here is what each part does.

compute

Raspberry Pi

The brain. It both streams the audio and, on boot, runs the script that drives the servo to press the button.

actuator

Angular servo

A hobby servo whose arm is positioned against the power button. Rotating it from rest to a set angle delivers the press.

library

gpiozero

A friendly Python layer over the Pi's GPIO pins. AngularServo handles the pulse-width timing that sets the servo's angle.

timing

Pulse-width control

Tuned min and max pulse widths so the servo reaches the exact angles needed — and enough torque to actually depress the button.

automation

systemd service

A service unit runs the press script automatically at every boot, so the amp turns on with no manual step.

mechanics

3D-printed mount

A printed bracket holds the servo firmly in place so its torque pushes the button instead of pushing itself away.

How it works

From cold boot to playing music

The sequence is short and entirely hands-off:

  1. Pi powers on live

    The Raspberry Pi boots up, ready to stream audio.

  2. Service fires live

    A systemd service launches the servo script automatically as part of startup.

  3. Servo swings live

    The script rotates the servo from its rest angle to the press angle and back, using gpiozero.

  4. Button pressed live

    The servo arm, held by its printed mount, pushes the amplifier's power button.

  5. Amp turns on live

    The amplifier powers up, ready to receive the stream from the Pi.

  6. Auto-off future

    A second press to power the amp down on shutdown — left as future work in this build.

Setup notes

Getting GPIO to cooperate

The fiddly part wasn't the servo — it was permissions and timing on the Pi:

In my rebuild the focus was the boot path: tune the pulse widths, confirm the press lands with enough torque, then hand the script to systemd so it just happens.

Reflection

What rebuilding it taught me