All projects
Documented procedureRaspberry Pi 4 · 3B · 3B+ASL3 accessory

Safe shutdownfor your Pi.

Add a small pushbutton to your ASL3 node and shut it down cleanly before removing power. It takes two wires and one configuration line.

01 Normally-open momentary switch02 Physical pins 5 and 603 No additional software package
A red momentary switch with its two wires arranged like a smiling face
A simple two-wire button adds a clean shutdown to the case.

Why add a shutdown button?

Give the SD card a clean finish.

Pulling the plug while the Pi is writing data can damage the file system and make the next startup look like a failed card. A brief button press asks ASL3 to stop the operating system safely. Wait until activity stops before removing power.

THE BUTTON ON THE CASE

A small button makes shutdown easy to remember.

Press it and give the Pi time to finish. When its activity stops, you can safely remove power.

Raspberry Pi 4 ASL3 node in its case, showing the shutdown-switch side
The shutdown switch mounted on the side of a Raspberry Pi case.

A practical little addition

Leave the Pi ready for its next clean start.

The switch asks the operating system to shut down first. It does not disconnect the power supply; wait for activity to stop before unplugging the Pi.

Two steps at the workbench

Connect the button. Enable the overlay.

01

Wire the momentary switch

Connect one switch wire to physical pin 5 (GPIO3) and the other to physical pin 6 (ground). The wires can go either way. If they are red and black, convention puts black on ground. If pin numbering is unfamiliar, a clearly labeled GPIO breakout board can help confirm the pins before you connect the switch.

Raspberry Pi GPIO header pinout, with physical pin 5 GPIO3 and pin 6 ground circled
Pin 5 (GPIO3) and pin 6 (GND) are circled.
Pin 5GPIO3
Normally-open
momentary button
Pin 6Ground
02

Enable safe shutdown

In an SSH terminal, open the Raspberry Pi boot configuration, add the overlay line at the bottom, save, and reboot. Current Raspberry Pi OS uses the path below; older releases may use /boot/config.txt.

sudo nano /boot/firmware/config.txt
dtoverlay=gpio-shutdown

In nano: Ctrl+O, Enter, Ctrl+X. Then run sudo reboot.

After reboot

One press to halt. Wait. Then remove power.

  1. Briefly press the button while the Pi is running.
  2. Wait until disk and activity indicators stop.
  3. Remove the power supply when you are ready.

Read before wiring

Three small cautions matter.

A package of assorted-color Dupont jumper wires
Assorted Dupont jumper wires for GPIO and prototyping.

A handy bench accessory

Keep a package of Dupont wires nearby.

A small assortment of colors, lengths, and connector-end types is useful when building AllStar nodes or trying other electronics ideas. It lets you make quick connections to GPIO headers and breakout boards without cutting a custom wire for every test.

Assorted kits are commonly available on Amazon for about $5 to $8. Check the connector type and your board's pinout before plugging anything in; color is a helpful reminder, not proof of which pin a wire reaches.

Printable guide

Take the wiring and setup steps to your workbench.

The guide includes the switch connection, ASL3 configuration line, board-specific notes, and breakout-board tips.

Download the safe-shutdown guide

Shared freely for amateur-radio experimentation. Use at your own risk; no warranty.