I have a latch, and I could use some advice on starting the latch in a known state.

I'm running some robotics off of an ATX power supply, controlled by an Arduino. The motors and such are weak and not particularly dangerous, but just the same I'd prefer to have an emergency shutoff function. I intend to do that by sending PS_ON high permanently if an incoming signal I'm calling STOP ever goes high. That is, I need a latch. I want to include this latch circuit in a printed circuitboard that accepts power from the ATX and commands from the arduino. That way, over time, I can connect more sensors to the STOP signal as I build them and feel they're necessary -- big red button, limit switch, vibration, heat, anything I don't want.

The safety sensors will all be powered by 5V_STDBY. The arduino will itself be powered by either 5V_STDBY or its USB connection (jumper select), and everything else will be powered on main +5/+12. The arduino will have a pin to pull the ATX's PS_ON low and turn on main power. If STOP ever goes high (or low), I want the latch to pull PS_ON high until the power supply is switched all the way off with the physical switch (5V_STDBY goes low).

My best guess is the following circuit:

Latching shutoff

The problem is that I'm not really sure how best to make sure the latch powers up with Q' low. For example, I could try using an RC network to keep the reset pin high until a capacitor charges as soon as 5V_STDBY comes on, giving me a small amount of time with the reset pin high. But here, I don't know how long it takes for 5V_STDBY to come on, and I want the reset pin to still be high once 5V_STDBY settles. It seems like bad design to depend on the specifics of how long 5V_STDBY comes on, because I can't predict the behavior of decoupling capacitors, power loads, etc. I could build a circuit to determine when 5V_STDBY has settled, but that sounds like a lot of unnecessary complexity. I could use an RC network to keep the reset pin high for a small period of time after ARD_PS_ON goes high... which now that I think of it is not a bad idea. But maybe there's something I'm missing.

Are there any considerations I should think about in having a reliable latch circuit? If I use an RC network as an input to a latch, I'm gradually varying the input voltage. Is that a problem? Should I perhaps use Zener diodes to sharpen that drop? Heaven forbid, an analog comparator? Are there ICs I'm not aware of that deal with timing issues like these, and might make my life easier?


enter image description here

Pardon the timestamps; they're not accurate, and I don't know how to turn them off on the app I downloaded. First, the user turns on the physical switch on the back of the ATX power supply, thus turning on 5V_STDBY but not main +5/+12. ATX_PS_ON has a pullup resistor; as long as it's high, main power is off, so ATX_PS_ON goes high at this time.

I want the latch to power up with Q' high, so I want to bring RESET high briefly. Since 5V_STDBY powers the latch, I want RESET to still be high once 5V_STDBY stabilizes so the latch gets a good start state, and to the best of my knowledge, I can't predict how long that will take because I don't know how 5V_STDBY is loaded (correct me if I'm wrong).

Sometime later, possibly many minutes, the microcontroller will bring ARD_PS_ON_PIN high to turn on main power for the rest of the robotics. It will leave it there forever.

If subsequently the sensors detect a bad state, they will bring the STOP pin high, maybe only briefly. This brings Q' low, ATX_PS_ON high, and turns off main power, until the power supply is power-cycled.

The main question is how to either get that behavior on the RESET line, or design my latch not to need it. I feel that I must be making a hash of this: powering up latches and even gates in a known state is something every logic IC since the beginning of time has had to do, so there must be best practices.

  • \$\begingroup\$ I can't seem to wrap my head around all of your requirements as they relate to time. Could you post a timing diagram, please? \$\endgroup\$
    – EM Fields
    Commented Nov 21, 2014 at 6:55

1 Answer 1


You can reset the latch using a specialized reset timer like the DS1812.

It generates a high pulse for 150 ms after the power comes up.

It is available in a TO-92 case (three leads, like a transistor) for $2.43 from Digi-Key.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.