power buttons like on cell phones

Discussion in 'The Projects Forum' started by bignick270, Nov 5, 2010.

  1. bignick270

    Thread Starter Active Member

    Mar 25, 2009
    36
    0
    I would like to know how to implement a power on/off switch like on cell phones where you hold a certain button down for x amount of time and the unit turns on or off. Then, when the device is running the button can be interfaced to a uController for normal input.
     
  2. GetDeviceInfo

    Senior Member

    Jun 7, 2009
    1,571
    230
    Define 'Off'

    In many cases, 'Off' is actually a sleep mode.
     
  3. bignick270

    Thread Starter Active Member

    Mar 25, 2009
    36
    0
    In terms of my project "off" will be completely off as in to disconnect the batteries from the circuit.
     
    Last edited: Nov 5, 2010
  4. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    If the batteries are completely disconnected, a "soft" power on/off will not work.

    Phones and MP3 players go into ultra low power sleep mode when turned "off". They typically draw less current than the batteries' self discharge rate.
     
  5. bignick270

    Thread Starter Active Member

    Mar 25, 2009
    36
    0
    point taken, it definitely makes sense.
    Alternative methods to having a bulky external power switch where you can utilize a general user input switch?
     
  6. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    If you are using a microcontroller, This Application Note explains how to use low power sleep mode that can be woken up or put to sleep using the keypad or other I/O.
     
  7. bignick270

    Thread Starter Active Member

    Mar 25, 2009
    36
    0
    I want to be able to complete power down the device, have nothing to do with the uC controlling the on/off functionality, just to be able to reuse the switch as a general input.

    Even if it has to be done in hardware with a delay factor so you have to hold the button for x time for it to toggle.
     
  8. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,576
    231
    This is a circuit that I designed to give me push-on/push-off or push-on/program-off. Complete shut down. The programming of how input P3 is used can make it a dual function power and operational switch.

    Ken
     
  9. bignick270

    Thread Starter Active Member

    Mar 25, 2009
    36
    0
    If you have some time could you explain the operation of the circuit / switch. My background is stronger in the embedded software side and weaker in the hardware side.
     
  10. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,576
    231
    The pushbutton SW1 initially powers the 08M through D2.

    The program immediately sets P0 high using Q1/Q2 to maintain battery power through Q1 and D1.

    The program ignores or waits for the initial high input on P3, thru R4, to be pulled low by R5 when SW1 opens. D2 isolates P3 from the power when SW1 is open.

    At the end, the program sets P0 low turning Q1/Q2 off and remove all power to the 08M.

    Or...pushing SW1 during the program triggers an interrupt set on P3. The program then sets P0 low and ends. Q1/Q2 are turned off and the battery is disconnected.

    C1 assures that the 08M has enough time to end the program gracefully, and R4 assures that C1 totally discharges. Values for these two depend on what else is on the 08M's Vdd circuit.

    Hope this helps.

    Ken
     
  11. bignick270

    Thread Starter Active Member

    Mar 25, 2009
    36
    0
    Could something be done in hardware where the push button has to be held down to like 3 seconds through a RC time constant or a timer that triggers a JK flip flop (configured so that J and K are tied high with the input on clock line which will toggle the output)?
     
  12. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,576
    231
    Perhaps you can tell us a littler more about what you are trying to do...what you are trying to control. What voltages are involved? What is the short pulse going to do? maybe even a schematic. What limitations are controlling our options?

    Ken
     
    Last edited: Nov 6, 2010
  13. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,576
    231
    Just a thought...a 3 second 555 monostable, with the button providing the grounding trigger input. The button grounding and the output of the 555 are NOR'd. If the button is held down, after 3 seconds the normally high output of the NOR goes low and stays there until the button is lifted. I don't know what you would do with that. ;)

    Ken
     
  14. bignick270

    Thread Starter Active Member

    Mar 25, 2009
    36
    0
    I maybe taking this too far haha, but lets see.

    Like i was saying earlier I want to be able to turn a device on or off by holding a general user input switch down for so many seconds, like 3 seconds (wanting it to be held so the switch so it can also be tied to the micro for a keypress style input). The reason I threw the last idea out was to eliminate the microcontroller from having to be involve in turning on/off, in case of a lock up or something similar.

    The total current draw for the device would be no higher than 200mA with normal operating range between 30mA and 120 mA depending on the operation. The supply is 2 series NimH batteries which will go to two boost converters to get a 3.3V and 5V supply. I would like the circuitry controlling the on/off to happen prior to the voltage regulator stages, which would place it between the batteries and the regulators.
     
  15. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    You could use a second uC dedicated to power control, wired like the PicAxe version above.

    The main uC would see the key/button as just another of the matrix, but the second uC monitoring that line could time when the line is held high for over 4 seconds, cutting power to the MOSFET.

    The only hangup is when using a key on a typical membrane keypad, they are usually only rated for a few mA, not a few hundred. If your input is using different switches, that would be different, I've assumed it would be something like holding down the 1 key on a cell phone for autodial, but make it be power off/on instead.
     
  16. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,576
    231
    This gets into the minutia of your whole circuit. As thatoneguy questioned, is the button just part of a matrix? The devil's in the details! Will you post a schematic of what you have? With out all those little details, we're just blindly presenting ideas for you to reject. That wears me out. :(

    Ken
     
Loading...