Momentary button press after USB power out

Discussion in 'The Projects Forum' started by poweroutguy, Jul 24, 2016.

  1. poweroutguy

    Thread Starter New Member

    Jul 24, 2016
    2
    0
    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.
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,123
    3,047
    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.
     
  3. poweroutguy

    Thread Starter New Member

    Jul 24, 2016
    2
    0
    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.
     
  4. wayneh

    Expert

    Sep 9, 2010
    12,123
    3,047
    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.
     
  5. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,538
    1,251
    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 likes this.
  6. wayneh

    Expert

    Sep 9, 2010
    12,123
    3,047
    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. ;)
     
  7. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,538
    1,251
    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
     
  8. wayneh

    Expert

    Sep 9, 2010
    12,123
    3,047
    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.
     
Loading...