Hello
I wanna design a circuit which turns a device on after a button is pressed for 3s and when the button is pressed for the second time for another 3s turns the device off,can someone suggest me what should I do?
we don´t know about
* your power supply,
* nor your device´s voltage, AC, DC, current,
* nor the signal level
* nor timing requirement....
So your question is not very precise.
we don´t know about
* your power supply,
* nor your device´s voltage, AC, DC, current,
* nor the signal level
* nor timing requirement....
So your question is not very precise.
I'm using a battery for devices and their voltage is DC,I don't wanna connect them directly to the battery so a circuit is needed between them to control their on/off state because there's no need for all of them to be on all the time,just when the button is pressed for 3s they're connected to the battery and devices work until we press it again for another 3s.
* Battery: All batteries are DC. But it could be a tiny 1.5V coin cell or a huge 48V 200A solar buffer
* Device: is it a 3V 1uA SRAM backup system, or a 10 kW motor
... how can we know?
This is one possible solution. VG1 represents a pushbutton connected to the battery positive (three second pulses). C1 or R1 would need to be a bit larger to get it over three seconds, this simulation shows about 2 or so seconds needed to toggle the latch on and about 2 seconds for it to toggle off (after being pressed), it seems precisely 3 seconds is not important. It's a really typical circuit that uses the CD4013 or any variant of that (presumably you might prefer a lower voltage type than 'CD' models to maximize the 3.7V and falling battery usage). Only one flip-flop needed. Supposdedly about the same timings/durations at 27ºC and at 100ºC. To carry a bigger load than a 1k resistor might require adding a pass transistor, that's why crutschow asked about current/load, and I'm sure he'll provide you with a more elegant solution than mine, especially if you fill in the gaps, so to speak. What happens if in this version the pushbutton is continually pressed for more than three seconds, no idea, caveat emptor. A latching comparator and an RC network may be another option. Load switch might be another useful term.
The possible problem with that is, the required maximum clock rise-time for the CD4013 FF is fast (below) with is apparently not in the model, and that circuit generates a very slow clock rise (Vin1).
Thus I added a Schmidt-trigger gate to my similar circuit to provide the fast clock rise (below):
The circuit does not change states for a push-button on for less than 3 seconds, (green trace) and changes stage for anything over 3 seconds.
R1C1 determines the delay time
R4C2 provides a power-on reset to set the output off.
I added a P-MOSFET driver at the output for the load.
It can be any logic-level type with a low enough on-resistance rating for the load.