12v momentary circuit (relay) help

Thread Starter

Jimmy Falk

Joined Sep 19, 2018
17
Hey there fellow members

I need some help with a circuit or component

I have a 12v feed that operates a relay for a few modules of mine as an on/off switch for those
but I’m also using it as an on/off switch for a rasp pi.
here is where the problems comes in.

the pi turns on when the relay gets the 12v feed and closes the circuit but it doesn’t turn of when the 12v feed in disable sine it goes to NO and pi needs to pins to be bridge to turn of

Sorry for my bad explaination
But in short i need some kind of momentary circuit the operates with a 12v signal
 

Ya’akov

Joined Jan 27, 2019
9,150
It's hard to understand your question because of typos but how are you turning the RPi on (and off)? That is, what are you doing on the RPi with the relay?
 

Thread Starter

Jimmy Falk

Joined Sep 19, 2018
17
sorry for typos English is not my foren language

The relay bridge two pins on the rasp pi making it boot. As relays goes in to NC
But when I turn relay off I need to bridge the pins again for the Pi to turn off
So question is if it’s possible with a relay or do I need something else after relay
 

LesJones

Joined Jan 8, 2017
4,190
I think drawing a timing diagram may make it clear to us exactly what you want.
Show the following.
12 volt feed on/ off state.
12 volt supply to raspberry Pi on / off state. (I am not clear if it is supplied directly by the 12 volt feed or via contacts on the relay.)
The open / closed state of the relay contacts that force the Raspberry Pi to boot. (And any timing information if just a pulse is required.)

Les.
 

Ya’akov

Joined Jan 27, 2019
9,150
I think you could add an overlay to an additional GPIO pin that is a modified version of gpio-shutdown-overlay (https://github.com/raspberrypi/linu...m/boot/dts/overlays/gpio-shutdown-overlay.dts) and set it to active high. Then you can have the relay contacts pull the pin 3 (I'm assuming you are using it as the active low shutdown) low on the NO contacts and have pin N pull high on the NC contacts.

I think that would work because when the RPi was off, pin 3 would also be high, but pin N would be high. When the relay operates pin N would go low along with pin 3. Pin N wouldn't do anything in the low state while operating, and I don't think it would stop pin 3 from starting up on the low signal.

I haven't tried it and won't have a chance for a while, but when I get some time I might.
 

Ya’akov

Joined Jan 27, 2019
9,150
I think drawing a timing diagram may make it clear to us exactly what you want.
Show the following.
12 volt feed on/ off state.
12 volt supply to raspberry Pi on / off state. (I am not clear if it is supplied directly by the 12 volt feed or via contacts on the relay.)
The open / closed state of the relay contacts that force the Raspberry Pi to boot. (And any timing information if just a pulse is required.)

Les.
If the TS is doing what I think he is, pulling GPIO 3 low causes the RPi to either start up or shutdown gracefully (like a PC power button). The timing isn't critical, you could operate with an assumption that 1 second is good. The idea would be 1 second to low on closure of the relay, 1 second to low on opening of the relay.
 

ericgibbs

Joined Jan 29, 2010
18,848
hi,
Does this do what you are asking.

Relay energised, Pi is powered
When relay de-energised the Pi power is removed and the power input pins are shorted together.???

E
 

Attachments

Ya’akov

Joined Jan 27, 2019
9,150
hi,
Does this do what you are asking.

Relay energised, Pi is powered
When relay de-energised the Pi power is removed and the power input pins are shorted together.???

E
I don't believe the TS is just applying power to the RPi. He seems to be using the GPIO overlay that provides graceful shutdown and start up, like a PC power button.

So, a 1 second contact closure when the external relay is energized, followed by a one second contact closure on the same pins when the external relay de-energizes seems to be what he needs.
 

eetech00

Joined Jun 8, 2013
3,946
Hey there fellow members

I need some help with a circuit or component

I have a 12v feed that operates a relay for a few modules of mine as an on/off switch for those
but I’m also using it as an on/off switch for a rasp pi.
here is where the problems comes in.

the pi turns on when the relay gets the 12v feed and closes the circuit but it doesn’t turn of when the 12v feed in disable sine it goes to NO and pi needs to pins to be bridge to turn of

Sorry for my bad explaination
But in short i need some kind of momentary circuit the operates with a 12v signal
So the circuit to the Pi is OPEN, but you need the circuit to momentarily CLOSE, then OPEN again, to turn off the Pi?
It would help us understand your question if you posted your existing circuit.
Is your Pi connected to a USB port?
 
Last edited:

Alec_t

Joined Sep 17, 2013
14,313
Does the Pi really need two pins to be bridged for shut-down? Won't just pulling one particular pin low (or high) do the job?
 

Ya’akov

Joined Jan 27, 2019
9,150
Does the Pi really need two pins to be bridged for shut-down? Won't just pulling one particular pin low (or high) do the job?
The pins are GPIO3 and GND, so it's just one pin low.

To add some information: the /boot/config.txt file includes definitions for overlays that describe how IO pins should be used by the OS. The gpio-shutdown-overlay defaults to GPIO3 which has an external pull up on some models. It can be applied to other pins, and can also be modified to respond differently. I wrote a bit about it above.

I think the TS is naively using it as-is, which is effectively like a PC power button so, it needs to be "pressed" once to shutdown and once to start. The shutdown is the rub because the TS only has the opening of the relay that is signaling it, and that will bring GPIO3 high but not low again.
 
Last edited:
Top