Notifications
Clear all

Timed Off Switch??

 
 jroc
(@jroc)
Active Member

Any ideas on how to make a simple, relay based, switch that senses power-off, then turns itself off after a set amount of time?

USE CASE: I am using a Raspberry Pi (RPi) as my audio streaming device. I have it feeding digital audio into a dedicated DAC, which then goes into a legacy McIntosh amp. Works great and uses all open source software. The one issue is that the RPi – well Linux and the ‘PiCore’ app it’s running – really wants to be properly shutdown. I have the RPi plugged into one of the McIntosh switched power outlets so it comes on/off as I turn the amp on / off.

WHAT I’D LIKE TO DO: Using GPIO pins on the RPi sense current at the power outlet. When current drops I can run a script to shut-down the RPi. But I need, say, 2 mins for this to happen before the RPi itself loses power. Thus I’d like to energize a relay when I turn the power amp on, which will turn the RPi on. Then when the Amp is turned off I want some sort of timer to start and not turn the relay off until a few minutes later.

Notes. Relay and RPi could be powered by a non-switched outlet. OR would it be practical to use a ‘super cap’ to retain power on the RPi the few minutes I need and maybe not even use a relay??

Any ideas folks may have greatly appreciated!


Quote
Topic starter Posted : 03/12/2024 2:12 pm
RadTekMan
(@radtekman)
Reputable Member

Welcome, my thought is instead of the amp controlling the RPi, have the RPi control the amp. Have a power button hooked to an input pin on the RPi, use the software to control power, and have the amp on a relay controlled by the RPi on an output pin. This would require the RPi to have constant power. Not sure what your requirements are for the setup, ie. single control point, both powered down, etc. With MCs it is easy to configure as you just make a script, so it really depends what you want to do.


Radios + Tubes + Scopes + Cars= Nothing better!

ReplyQuote
Posted : 06/12/2024 1:03 pm
 jroc
(@jroc)
Active Member

@radtekman Interesting idea. That could be a viable option. At first blush I think the only downside is that at times I am using the Amp without the RPi (i.e., using a different input to the Amp). However, I am mostly listening to a stream from the RPi, and if the RPi is on sometimes when it’s not actually being used…well, so what? It’s not like it consumes a ton of power or is going to wear out. Something to consider. I am a software guy at heart, so the more I can turn this into software, the easier for me, lol


ReplyQuote
Topic starter Posted : 06/12/2024 1:24 pm
RadTekMan
(@radtekman)
Reputable Member

@jroc In that case you could incorporate a power override command of some sort. Otherwise just switch the input and leave the RPi on to power the amp. I have an arduino I got a while back to play with but haven’t messed with it since. I am a hardware person over a software person so that side is what holds me back. I think about building projects all the time, but always wonder how I would figure out the software part of it. Really I just need to dig it out and start playing again.


Radios + Tubes + Scopes + Cars= Nothing better!

ReplyQuote
Posted : 09/12/2024 10:03 am
 jroc
(@jroc)
Active Member

@radtekman I would recommend that you definitely play with the Arduino. To me it is a fun mix of hardware and software. I have a few Arduino’s, Raspberry Pi Picos, and about a dozen ATtiny84 chips. Once you get the hang of the paradigm, and uploading the programs onto the device from your PC you can go to town controlling the world from these little things. For me the key to taking on something new in this vein is to create a specific project that be the focus for leaning. Like, e.g., a plant moisture sensor. Or some LED lighting project. Have some fun with it!


ReplyQuote
Topic starter Posted : 10/12/2024 6:28 am
RadTekMan
(@radtekman)
Reputable Member

@jroc Absolutely, I am finishing up some customer jobs so I can get back to doing some personal stuff. Seems I have been collecting and not repairing/reviving at all. Plus I need to throw in some cleaning and organizing. I will see what I can come up with for sure, thanks


Radios + Tubes + Scopes + Cars= Nothing better!

ReplyQuote
Posted : 10/12/2024 10:15 am
(@flannel-tuba)
Active Member

If it weren’t already on a Pi, I’d build a simple 555 circuit to do the delayed shutdown; but I would agree that going the Pi/Adruino path does sound like more fun. At one point, I did wire up a 555 timer to shut off the power to the amplifier in my shop when there was no audio signal for a set length of time. It was a pretty simple little circuit. Again though, if I had it to do over again, I’d probably go the arduino route. 


ReplyQuote
Posted : 25/12/2024 1:56 pm
RadTekMan reacted
Share: