Momentary button press after USB power out

Thread Starter

poweroutguy

Joined Jul 24, 2016
2
I wanted to make a simple circuit that was USB powered (simply so I could use one of those USB outlets in my house, or any USB wall wart kind of power supply)

All I need it to do, is after the 5v disappears (the power is out), then momentarily pick a relay (or some kind of contact closure) to turn on another light I have which is independently battery powered.

I was thinking of using a little arduino like the DigiSpark, but it seems overkill - also, how to store enough voltage just to pick a small relay once - supercap?

Thanks for your advise.
 

wayneh

Joined Sep 9, 2010
18,111
Since you have a battery, can you not just use a circuit powered by it, that detects if the USB power is interrupted? There are other options but that would be easiest.
 

Thread Starter

poweroutguy

Joined Jul 24, 2016
2
I suppose I could, but it's an 18v battery running the light, so I'm guessing then I would need a voltage reg. or some other parts to step that down.
 

wayneh

Joined Sep 9, 2010
18,111
Not at all. All you need is a comparator such as LM339 to control a MOSFET switch, which will act like a relay and control your light.

The inputs to the comparator will be the USB feed and a reference voltage of, say, 3V. If the USB voltage falls below 3v, the comparator changes state and turns on the MOSFET.

I think you could even devise a circuit to control the MOSFET directly without the comparator, if you use a logic level MOSFET that is switched fully on at 5V.
 

AnalogKid

Joined Aug 1, 2013
12,143
A 5 V relay with normally closed contacts will do this with no other control circuit. When the USB 5 V goes away, the normally closed contacts close and complete the light circuit.

ak
 

wayneh

Joined Sep 9, 2010
18,111
I hate relays, but that's a good solution here as long as the current draw is kept low by choosing the right relay.

Actually I love relays as long as the one I need is already in my junk box. ;)
 

AnalogKid

Joined Aug 1, 2013
12,143
Relays with 5 V DC coils and contacts rated for 125 Vac at 5 A or 10 A are very common. A USB jack is good for a minimum of 500 mA, which is more than enough for these critters.

ak
 

wayneh

Joined Sep 9, 2010
18,111
Yeah, but I would assume the TS wouldn't want to devote that much of the USB capacity to just an indicator relay. Maybe that's no issue.
 
Top