power on\of with delay

Discussion in 'The Projects Forum' started by david1234, May 7, 2014.

  1. david1234

    Thread Starter Member

    Nov 27, 2013
    81
    1
    Hello,
    I want to be able to power on my device (work on 9-12V)
    only when I press the power for 3-4 seconds
    and also to shut it down when pressing 3-4 seconds
    something like in all the mobile phone now
    I was thinking about FlipFlop ?
    how can I do this?
    simple and cheap?

    Thanks ,
     
  2. philippe53

    New Member

    May 4, 2014
    17
    2
    Hi,
    Is it to avoid an accidental operation or always switch a device after an other ?
     
  3. david1234

    Thread Starter Member

    Nov 27, 2013
    81
    1
    to avoid an accidental operation..

    thanks,
     
  4. david1234

    Thread Starter Member

    Nov 27, 2013
    81
    1
    I didn't find in P_Spice Schimtt Trigger FlipFlop
    so I put a JK

    but I think the best what is to use a Schimmt , no ?
     
  5. Dom Amoy Brew

    New Member

    May 6, 2014
    6
    0
  6. david1234

    Thread Starter Member

    Nov 27, 2013
    81
    1
    it's not what I need
    first of all is to big - I don't need the option of AC
    second from what I can see it only delay for turn on OR off
    I need both.....
     
  7. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,516
    1,248
    A cell phone uses a custom IC with extremely low standby current because that part is powered all the time. It has to be powered when the phone is off so it can detect when to turn the phone on. The functions are easy to replicate with standard parts, but they will drain your battery during the off times unless care is paid to minimize current.

    The 9V goes to the delay circuit, the FF, and the source of a p-channel FET. The FET drain runs the rest of the circuits. The on/standby switch that you press drives the input to the delay circuit. Its output drives the clock of a toggle FF, and the Q- output drives the electronic switch.

    The FF can be CMOS and the switch device can be a p-channel FET, so the only real power budget to deal with is the delay generator. Very large R, very low leakage current C, and something that detects a very slow level change and produces an edge fast enough for the FF. Two 7002 small signal FETs in series might work here, and get you some hysteresis to boot.

    ak
     
  8. david1234

    Thread Starter Member

    Nov 27, 2013
    81
    1
    O.K
    this is what I thought ,
    can you show me a schematic of this circuit ?
    and also how much I "lost" during storage ?
    if I'm losing up to 5mAh it's good for me.

    I will try to make a sketch of the circuit and upload ,

    Thanks .
     
  9. inwo

    Well-Known Member

    Nov 7, 2013
    2,433
    315
    Flip flop won't add delay.

    3-4 seconds seems long.

    If it's for a project you're building, it can easily be done with timer or in software.

    If adding to an existing circuit, just an rc circuit between switch and circuit may give enough delay. Plus an added transistor if slow switching times aren't accepted by device.

    Do you need two? On and off? Or is the same switch used to toggle on-off?
     
  10. crutschow

    Expert

    Mar 14, 2008
    12,961
    3,216
    Below is the LTspice simulation of a circuit that gives a delay for both turn-on and turn-off from one momentary PB switch. It uses CD4000 series CMOS ICs which can operate directly from up to 15V so you don't need a voltage regulator.

    It uses Schmitt-trigger inverters to give a sharp clock pulse edges to the FF, otherwise it might not trigger properly.

    The R2 and the diode provide for fast discharge of C1 so it is ready for the next PB press.

    Note that power and ground connections are not shown for the IC's. The circuit draws negligible power so can be left connected to the power source.

    The R1C1 values shown give a delay of about 3.5s for both turn-on and turn-off.
    Edit: These values may need some tweaking to get the desired delay in the built circuit.

    It uses a P-MOSFET at the output for efficient high-side switching of your load. The device can be just about any P-MOSFET that has at least a 20V rating and at least double the current rating of the highest load current.

    Delayed Switch.gif
    View attachment Delayed Alternate Action Switch.asc
     
    Last edited: May 8, 2014
    david1234 likes this.
  11. BC107C

    New Member

    Apr 3, 2011
    14
    1
  12. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,516
    1,248
    Looks good to me. Since you are using the Q output for control, I would add a small RC network to the FF Set input to guarantee a power off condition on first time power up.

    ak
     
  13. crutschow

    Expert

    Mar 14, 2008
    12,961
    3,216
    That's a good idea. A 1MΩ resistor from the Set input to ground and a 0.1μF ceramic cap from the Set input to V+ should work for that.
     
  14. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,516
    1,248
    For any of you geezers out there that remember the GE Transistor Manual, you can implement the toggle FF with two NAND gates and eliminate the 4013.

    Or see the attached schematic, but use a 4093. Tie Q- to D to make it a toggle FF, and drive the clock input with the R1-C1 node in the post #10 schematic. Since it isn't critically important that the Q and Q- outputs transition at exactly the same time, a small RC delay in one of the gate #2 inputs will assure a consistant power-on condition.

    The 4093 is the near-perfect basic logic component. The only way it could be better is if it were a 741.

    ak
     
    Last edited: May 8, 2014
  15. crutschow

    Expert

    Mar 14, 2008
    12,961
    3,216
    Since that design using NAND gates is a level-triggered FF and not an edge-triggered type, if you connect the D input to the Q- output it will oscillate as a ring oscillator when the clock input is high. For it to work as a toggle FF the clock pulse width would need to be shorter than the propagation time of the oscillator.
     
  16. david1234

    Thread Starter Member

    Nov 27, 2013
    81
    1
    Thanks -
    I do have some questions (also mark in the circuit)
    1. I want to use a reset button - not 2 state switch. so I will need to press the button for 2-3 seconds and them the device will be turn on\off , not press and then wait.
    there is a different - you agree,right?
    is it what you did there? because I don't thinks or I didn't understand it correctly.

    2. why do I need to use 2 CD4093B ?
    3. maybe my calculation is wrong - but if I do R1*C1= 4114*10^-6 ==> that isn't 3.5 seconds, it's 4mS...
    4. and what about the power for the FlipFlop and the cd4093b - they need to connected to VCC all the time? or I can connect them after the switch? I need to save the battery
    Thanks again ,
    I just need to understand before I go out and buy this parts
     
    Last edited: May 11, 2014
  17. crutschow

    Expert

    Mar 14, 2008
    12,961
    3,216
    No, I don't understand the difference between "press the button for 2-3 seconds" and "press and wait". To me they are the same thing. :confused:
    My circuit changes state (on\off) when you push and hold the momentary button (S1) for about 3.6s as shown in the simulation plot.

    Originally you said 3-4 seconds, now you say 2-3 seconds. Which do you want?

    As noted on the schematic, V2 is just for simulation purposes (to turn S1 on and off).
    Since the CD4093 is an inverter I used two in series so that the input and output are in-phase. Since there are 4 gates in one-chip, it only requires one part.
    Your math is off. It's 187,000 * 22e-6 = 4.1s.
    As I stated in my first post, the power connections are not shown. Due to the very low current required by the CMOS chips and MOSFET (essentially leakage current) you can leave them connected to the battery with negligible drain.
     
  18. david1234

    Thread Starter Member

    Nov 27, 2013
    81
    1
    again - thanks for the explaining , very helpful
    now:
    1. my mistake , I thought I wrote 2-3 seconds...... sorry (but it is the same, just to change the RC- so ignore this )
    there is a different between pressing for 2-3 seconds and just get a delay for this time - for example:
    I don't wont that if someone press by mistake the power button (or something touch it) for a time less then 2 seconds it start working , I want to make sure it will start not by mistake.
    take you Iphone\HTC\Samsung for example - when the phone is close only a long press of 2 seconds will start it , if you press it by mistake it won't start.
    now do you understand what I mean? only a LONG press will stat the circuit
    2. no problem with the amount of the device - just to understand the electronic.
    3.I guess I have made mistake in putting the numbers in the calculator, sorry - I see now my mistake.
    4.O.K , I understand.I will build the schematic for the all circuit and post it

    Thanks ,
     
    Last edited: May 12, 2014
  19. eetech00

    Active Member

    Jun 8, 2013
    644
    110
    HI

    Here's a circuit to consider.:)

    Timer will start when button is pressed.
    If button is released before timeout, timeout is cancelled.
    If button is held past 2.9 seconds, load is energized.
     
    david1234 likes this.
  20. david1234

    Thread Starter Member

    Nov 27, 2013
    81
    1
    looking good - this is want I have wanted
    Thanks !!

    just 2 understanding questions:
    1. the push button his job is to start the 555, right?
    so isn't he need to be between the VCC and PIN8 ?
    I don't want it to work the all time - its take to much mA,or am I wrong?
    2. how did you calculate the 2.9 seconds? using witch R and C?


    Thanks,
     
Loading...