A power button for my moOde player: safe shutdown and a "ready" light
A Raspberry Pi has no off switch. Plug it in and it boots; pull the plug and it stops — whatever it happened to be doing at the time, including writing to the SD card. For a music player that lives on a shelf and gets switched off every night, "just pull the plug" is how you eventually end up reinstalling moOde from scratch. So I wanted a proper power button on the front of the box. One press, the Pi shuts down cleanly, and a little light tells me when it's safe to cut the power. It turned out to be one of the simplest add-ons I've done to this build — two lines in config.txt , one tiny service, and a transistor that costs less than the wire it's soldered to. But there are a couple of decisions along the way that aren't obvious, and one tempting shortcut that would quietly do the wrong thing. What I'm working with Raspberry Pi 3 Model A+ IQaudio DAC+ HAT moOde Audio Lanboo LB12B-Q10F 12 mm push button, green, 1NO, with a built-in light rated 5–24...