Adding power switch to volumio

Greetings. How can I add a power off switch to my volumio music streamer…? ( Raspberry Pi 4 + IQ audio DAC pro.) Could someone kindly explain?

John

Depends on what you require from a power switch.
You can buy hardware so you have a soft and hard shutdown, add a switch to the power cord,…

1 Like

I use this method:

Switch:
https://www.digikey.be/nl/products/detail/e-switch/ULV7FWGSS341/9996196
You need a switch that clicks when pushed, stays in that position, not a momentary switch.
Other alternatives are available, with or without wire loom and connector.
Relay:

Power button requires the installation of two plugins:

  • GPIO Buttons
    • Enable Shutdown On
    • GPIO Pin 16
  • GPIO Control
    • System Startup Event On
    • GPIO Pin 13
    • GPIO State On
      When you push the switch, power is applied to the power supply and RPI. Once Volumio is started, 5 V is applied to GPIO pin 13 that closes the relay because GPIO pin 16 is connected to ground.
      When you push the button again, GPIO 16 is decoupled from ground, RPI, Volumio plug-in detects it and does a proper shutdown. This opens the relay and switches off all power.
      What puzzled me for a while where the pin numbers. The drawing shows the GPIO pins for Roon Audio, not for Volumio. You need to use GPIO pins 13 & 16.
      Physical layout for the pins:
      https://www.raspberrypi.com/documentation/computers/raspberry-pi.html
      Keep in mind that the GPIO numbers are not the same as the physical pin numbers.
      GPIO 13 is 33 and GPIO 16 is 36.
      I like it because when switched off, all power is switched off. Good for the environment :blush:. I don’t mind walking to my Volumio streamer to switch it on and off. A remote is not possible.

Hope this helps.

1 Like

Indeed… It’s a useful technique; I’ll give it a go.

Thanks
John

Most dacs/amplifiers has 12v trigger. With some extra hw and a 5v powerpack and a gpio pin it might be possible to shutdown the os on a descent way.

Kindly explain how to do it…

I am working at now using a 15000 mAh powerpack to keep the OS running a shutdown when the power-supply is switched off. Testing it with a OrangePi the idea to use a OR-port (some diodes) and using a GPIO pin. As long this pin is high power is coming from the battery. When the 12v triggered a relay will close and the Pi will get power and startup. During startup a GPIO-pin will be set high. So if the 12v is coming up the OR port is true and the relay between power pack will close so the Pi will startup. The 12v will also activate a second relay to switch on the power supply which is connected to the loader-port of the pack. How the switch off works by triggering the power switch of the Orange Pi. It will start a shutdown process. When the shutdown is done the GPIO will go low and relay between powerpack and the PI will disconnect. Hopefully I get this done in the upcoming weeks.

1 Like

Thank you for your response… If any schematic available, please share.

i have this on my iqaudio dac volumio music streamer

1 Like

Many thanks… But it is not available here in my country…

Naveen the idea is to use 5V UPS based on 18650 batteries. I found such a device on Alieexpress, it uses passthrough when a charger is connected and when you switch off the charger the Pi is running without an interruption. With 2 Ne555 timers: The first one will switch-on the power to the PI and toggle the the powerbutton but acpid is not running because the OS is starting up. With the next toggle it will startup the shutdown procedure (OS is runnning and also acpid) A small change in a rc-script will bring a GPIO pin to high and triggers a second Ne555 timer to keep up power to the Pi for 3 seconds after this timeout a disconnect of the power to the PI and switch-off the charger (power-supply). Because the NE555 timers uses directly the power of the UPS so a toggle on the button it will connect the 5v to the PI.
See: 0.93€ 89% OFF|Type C 15W 3a 18650 Lithium Batterij Oplader Module DC DC Booster Snel Opladen Voeding/Omzetter 5V 9V 12V| | - AliExpress

1 Like

Thank you so much :+1:

I created on a breadboard a circuit with a NE555 as timer and NAND gate 4093 and some transistors. It works as follows:
Button press power on a SSR (Solid State Relay) switching on the 5V a second SSR the AC power. Between the power adapter there is 5V UPS based on 18650 batteries (Alieexpress). Player is coming up.
Button press powerbutton on the Orange PI One is bypassed (simulate a push). Installed acpid and modified /etc/acpid/powerXXX.sh containing /sbin/shutdown -h -P now “Power button pressed” this works for version 3.666 on a OPI ONE and when the sd-card is in the OPI PC it works also because when the OPI is down PA09 (PIN 33) is going high (3.3V). Tested a OPI PC version 3.7 Volumio the pin is staying low. PA09 is used with a timer so after approx. 4 sec. the circuit is resetted. SSRs switching to off. My question is how to get GPIO PIN 9 (or another) to high when OPI is going down. (Devicetree ?)