Momentary On/Off Switch with soft shutdown

Raspberry Pi related support

Momentary On/Off Switch with soft shutdown

Postby PeteB » 12 Apr 2016, 00:57

I am looking at what Rikardo is going through in this thread:

http://www.runeaudio.com/forum/audiophonics-i-sabre-v3-dac-es9023-tcxo-t3377.html

...and it just seems ridiculous.

Can't we get a simple momentary contact switch, attached to some random pair of GPIO pins working to do a simple, local, soft shutdown? Or say, Mute, if Shutdown is too much trouble...

It seems there are scripts, and software, already published here to do this. perhaps not installed by default, but it can't be difficult, and switches like this are only around $1 in any local store.

I looked at the Mausberry script and directions (before I broke mine), but this would be even simpler.

One momentary pushbutton, one pair of GPIO pins (one pin, really, I think you only need to pull an input down to GND), and a script to activate the shutdown already in place?

I would be willing to work on that if someone gives me a place to start, but I do NOT want to just hack Rune Audio code and wait for it to conflict with something else being done.

(been there, done that, the T-shirt was not worth the effort)... :mrgreen:

edit:

Renamed thread to be more descriptive.
Last edited by PeteB on 21 Apr 2016, 03:29, edited 2 times in total.
PeteB
 
Posts: 421
Joined: 06 Feb 2016, 05:07

Re: Momentary Contact Switch

Postby thedman! » 12 Apr 2016, 18:50

I know nothing about scripting for pi or arch, but totally agree there must be another way to do it without a mausberry...

This may help:
https://github.com/t-richards/mausberry ... /README.md

And this:
post12134.html?hilit=Stop%20script#p12134

Other than that, I'm done!

Good luck!
thedman!
 
Posts: 62
Joined: 24 Mar 2016, 15:45

Re: Momentary Contact Switch

Postby ingohz » 12 Apr 2016, 21:17

Shutdown only should be easy to implement. You have to detect the button press/release and then execute the rune shutdown procedure. The latter has been described somewhere in the forum. It would be really nice to combine this with a (DIY) power controller like the mausberry.

  • HiFi 1: Alix/voyage-mpd, MusicalFidelity M1 DAC (RP2/HifiBerry Digi+), Accuphase DP-67, Accuphase E-212, Infinity Kappa 8.2i
  • HiFi 2: RP2/7" Touchscreen/IQaudIO Pi-DAC+, Philips Fidelio X1
ingohz
 
Posts: 45
Joined: 22 Feb 2016, 12:11

Re: Momentary Contact Switch

Postby PeteB » 13 Apr 2016, 00:46

I read some (not all) of the Mausberry documentation, but I was thinking of something simpler, that can use the Rune shutdown pretty close to how it is now, and Frank has already posted how to modify it, install it, etc...

For some people, a simple momentary contact switch to do a shutdown might be enough. A switch from any local supplier, two wires to two GPIO pins, done.


I like the circuit ingohz posted, but I can't help wondering if the average person even needs it. If the script does a safe shutdown, a latching relay is all that is needed to provide the hardware on/off function.

With power off, pressing the button latches the relay (set coil) and applies 5V to the Pi.

With power on, pressing same button (also connected to a GPIO pin), starts the shutdown. At the end of the shutdown routine, a pulse is sent to unlatch the relay (reset coil), which removes 5V from the Pi.
PeteB
 
Posts: 421
Joined: 06 Feb 2016, 05:07

Re: Momentary Contact Switch

Postby Dohmar » 13 Apr 2016, 02:49

It sounds nice, but the problem that I can see is that once the pi is halted, it requires a complete loss of power before it can come back up. Thats where the mausberry comes in, as (I think) the mausboard gets told when to cut power via the GPIO pins. It can be implemented by using a variable timed relay (ie pushing the button) to turn off after x seconds but I dont think that would work for the power on sequence either, unless there was some kind of conditional voltage monitoring on the outbound/pi 5vdc IN...

I'm no EE thought so Im probably wrong

-D
Dohmar
 
Posts: 79
Joined: 14 Mar 2016, 12:27

Re: Momentary Contact Switch

Postby PeteB » 13 Apr 2016, 03:59

Dohmar wrote:... I'm no EE thought so Im probably wrong

-D

You are not wrong, but that was why I suggested the latching relay as an alternative to the Mausberry (which is a nice design, in my opinion). The button sets the relay on power up, and the Pi resets it as part of the shutdown script.

Once the relay is reset, the Pi is "cold", in other words there is no 5V at the Pi circuit board. So the Pi shuts itself off, so to speak, and draws zero current until the button is pressed again.

It does require one or two additional small parts, but using latching relays is not some new concept in electronics, more like back-in-time... :D
PeteB
 
Posts: 421
Joined: 06 Feb 2016, 05:07

Re: Momentary Contact Switch

Postby Dohmar » 13 Apr 2016, 06:00

TBH I like the mausberry and would buy one, if it could support 12v that the suptronics supply works on. If the relay can handle the voltage, it should just be a matter of changing the input and output power connectors. I've emailed mausberry to see if they can hook me up a bare board. See what happens

-D
Dohmar
 
Posts: 79
Joined: 14 Mar 2016, 12:27

Re: Momentary Contact Switch

Postby ingohz » 13 Apr 2016, 08:37

I'd prefer MOSFET, but that doesn't matter now. Why not begin with the one-button-version to get a clean shutdown of the box? Pete, you have programming skills and preferences?
  • HiFi 1: Alix/voyage-mpd, MusicalFidelity M1 DAC (RP2/HifiBerry Digi+), Accuphase DP-67, Accuphase E-212, Infinity Kappa 8.2i
  • HiFi 2: RP2/7" Touchscreen/IQaudIO Pi-DAC+, Philips Fidelio X1
ingohz
 
Posts: 45
Joined: 22 Feb 2016, 12:11

Re: Momentary Contact Switch

Postby PeteB » 13 Apr 2016, 16:21

ingohz wrote:I'd prefer MOSFET, but that doesn't matter now. Why not begin with the one-button-version to get a clean shutdown of the box? Pete, you have programming skills and preferences?

I have some basic programming skills, yes, but there is not much original programming required here unless I am mistaken. Bash scripts are much the same no matter the platform. Where I am deficient is in understanding what works well within Rune and Rune OS, differences from other Linux distros etc.
PeteB
 
Posts: 421
Joined: 06 Feb 2016, 05:07

Re: Momentary Contact Switch

Postby ingohz » 13 Apr 2016, 19:36

Of course you can implement this in the quick (and dirty) way with a little scripting here and there. I thought of something that is not resource hungry and should be configurable via the Rune interface.
  • HiFi 1: Alix/voyage-mpd, MusicalFidelity M1 DAC (RP2/HifiBerry Digi+), Accuphase DP-67, Accuphase E-212, Infinity Kappa 8.2i
  • HiFi 2: RP2/7" Touchscreen/IQaudIO Pi-DAC+, Philips Fidelio X1
ingohz
 
Posts: 45
Joined: 22 Feb 2016, 12:11

support RuneAudio Donate with PayPal

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: cmh714 and 8 guests