Soft Latch single momentary power switch circuit w/ GPIO option for auto power down

Status
Not open for further replies.

wildview

Well-known member
Hi, I was wondering if anyone on the forum could offer a circuit that would power on/off a Teensy using a single momentary switch. I would like to have the Teensy be able to turn it self off as well with the same circuit. There's a lot of circuit designs available, but I haven't found one that allows both options of on/off from a single momentary switch along with a GPIO feed from the Teensy to turn itself off too. Most of soft latching circuits I've messed around with have oscillation issues when you hold down the momentary switch too long and I would like to avoid this so the Teensy is not powering up/down if someone holds down the momentary switch for a long period of time. I hope this is possible and thanks again for your help.

Thanks,
Rob
 
Use a JK flipflop fed back into itself.

Debounce the switch in hardware to stop multiple edges. Then feed this into the clock of the flipflop.

This will act to toggle a logic level of 0/1/0/1/0/1...
This can also be toggled using the teensy.

The flipflop can control a mosfet or a relay that powers down the rest of the circuit

EDIT-
As a second method you can have the button directly in the power line of the Teensy. When the button is pressed down the Teensy will then receive power. In Setup() toggle a pin which opens a mosfet/relay that will keep the teensy powered when the button is released. The teensy can then simply lower this pin to turn itself off
 
LOL Michael. We must have been typing the same thing at the same time. Yes, I like this option since it's cheap and it looks like it has the auto shut down option via input. Thanks Xenoamor for your input as well.
 
Great. I bought a couple today and will let you know how it works out. $3.95 is a pretty fair price. It saves a bunch of time having to dial in a circuit for this plus it has the diode protection =)
 
The Pololu module circuit appears to be somewhat similar to what we did in-house during 2014.

Caveat - had problems at 10V/m per CISPR24. But we fixed it.
 
Interesting. I'm only running 6V, but hopefully it will work. What was the problem you had and what was the fix?

I found this circuit I could try if it doesn't workout. It doesn't incorporate the ability to shut down power from a GIPO input though.
DI5389f1.png
 
I found this option here https://www.pololu.com/product/2808 this I believe will save a lot of work and plus it's cheap < $4. Has anyone used these?

Well I bought a pair of those for my current project but haven't used them yet.

However... my prototype board uses one of the older units and it seems to work fine (I bought it years ago). It does allow me to shut my device down if the temperature gets too high OR when the Lipoly battery voltage is too low. I didn't measure current draw or anything but I have no complaints. I added it to the project at the last minute and it was a cheap and easy solution.

FWIW,

Brad.
 
Status
Not open for further replies.
Back
Top