YAPP - a instant on relay for a PI power switch

gregcope

Well-Known Member
Joined
21 Aug 2004
Messages
1,634
Visit site
Hi All,

I have a raspberry PI boatmon(itoring) solution project - might come to nothing.

I have a mopi to keep the power requirements down (https://pi.gate.ac.uk/pages/mopi.html). It can short two headers to boot the RPI. I thought of connecting these to a bilge float switch (and maybe a buzzer) so that it would boot the pi - that can then send me an SMS.

However the mopi assumes (rightly) the headers will be used for a power button. And if held closed for 10 secs will hardpower off the PI. This is bad as if the floatswitch has gone high, the PI will boot, and 10secs in, will be powered off ...

Assume I can solder. No more.

I need a relay that when it sees 12v go on, will "blip" the PI on. ie Even if it remains on (to power the buzzer), the relay will close the connection to avoid the 10 sec power off.

Thoughts? Does such an off the shelf/cheap thingy exist?
 
Yep.... they're called latching relays, and are very inexpensive... any decent electric/electronic retailer will sell them.

Ah, just read your post better.... latching relay won't work!....

Second edit - Eureka moment!.... a simple car indicator flasher relay would do it.... you would need to wire in a load in parallel with the pi in order to activate the relay, but that would work nicely, for a few quid!... if you get a slow latching relay as well, then the same indicator relay could break the circuit by energising a latching relay to break, rather than make, but you'd need to see how long the mopi needs the 12v circuit for, as the relay may cut the supply too quickly....

Another possible solution would be a slow blow breaker... make the circuit last long enough to power the device up and then to pop the breaker before the 10 second limit... probably easiest of all, but would need playing with some resistors and breaker sizes to get it working properly.
 
Last edited:
Thoughts? Does such an off the shelf/cheap thingy exist?
Not quite off the shelf but something like an arduino uno or nano could do that and much more. Add a real time clock and you could turn on the pi at set intervals plus monitor bilge level, battery voltage, temp etc and use those as triggers. Pulls about 30mA from memory.
 
How about turning it on via a capacitor?
Nobody like this idea? You just put a series capacitor in the switch-on line, it differentiates the steady signal into a pulse. Refinements include a parallel resistor to discharge it, and a resistor to ground. A reverse biased diode can be used to prevent the off pulse taking the input negative.

RC-Differentiator-circuit.png


[Later] Embedded images broken? Fixed, need http:// D'OH!
 
Last edited:
Not quite off the shelf but something like an arduino uno or nano could do that and much more. Add a real time clock and you could turn on the pi at set intervals plus monitor bilge level, battery voltage, temp etc and use those as triggers. Pulls about 30mA from memory.

Have all of that (nearly) working. mopi does allot of that and pulls around 20mA apparently.

https://github.com/gregcope/rpi
 
Nobody like this idea? You just put a series capacitor in the switch-on line, it differentiates the steady signal into a pulse. Refinements include a parallel resistor to discharge it, and a resistor to ground. A reverse biased diode can be used to prevent the off pulse taking the input negative.

RC-Differentiator-circuit.png


[Later] Embedded images broken? Fixed, need http:// D'OH!

I like it Nigel!:)
 
Have all of that (nearly) working. mopi does allot of that and pulls around 20mA apparently.

https://github.com/gregcope/rpi
Now that sounds pretty cool :cool:

Would the Pi boot quick enough to send one of the gpio pins high? If so then could you put a normally closed relay in series from the bilge switch an open that by sending 5v from another gpio pin?

Or, looking at the spec a bit closer, the mopi seems to be able to be switched via some solder pads, is that how you were going to get it linked to the bilge switch? -
In the case of the power switch there are solder pads on the PCB, right next to the button, to allow fitting of a remote power switch.
so presumably when it sees continuity across those it then powers the Pi through gpio pin 2 ?
So assuming there is some kind of software latching going on, maybe you could take a line from pin 2 which will now be +5v and use that to switch a normally closed relay to open?
Might work, have you tried asking on the raspberry pi forums? Some very clever clogs on there.

Enjoy, sounds like lots of fun, lets us know how you get on. :)
 
Last edited:
Now that sounds pretty cool :cool:

Ta.

Or, looking at the spec a bit closer, the mopi seems to be able to be switched via some solder pads, is that how you were going to get it linked to the bilge switch? - so presumably when it sees continuity across those it then powers the Pi through gpio pin 2 ?

That was the idea - however the mopi will also power down if the switch is held for 10secs. So this would not work for a bilge switch as it might remain on (and switch off the PI).

2nd logic issue it that the pi would try to go to sleep, but the mopi would power it on again ...

So binning this idea.

Plan B is not to use the mopi for this and just connect the bilgeswitch to the RPI GPIO and write some code to check at when the PI is awake.

Code is mostly complete. SMS works, GPS works, config via SMS works. Puppet install/config is working.

- Need to do the mopi bits (battery volts, wake run, sleep cycle)
- Find some tupperware
- Wire in the bilge switch + code up the python bits
 
Top