'Soft' On/Off Power Switch


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    Aug 2003
    Posts
    985

    Default 'Soft' On/Off Power Switch

    Hi Guys,
    These links show examples of on/off circuitry commonly used in calculators,
    mobile phones, and other battery-operated devices.
    The p-channel MOSFET serves as an electronic power switch.
    They look ideal for pic based circuits, so I gave the first example
    a shot.

    Description:
    http://www.reed-electronics.com/ednm...=0&rme=0&cfd=1
    Figure 1:
    http://www.reed-electronics.com/ednm...es/54571f1.pdf
    Figure 2:
    http://www.reed-electronics.com/ednm...es/54571f2.pdf

    The 5K1 resistor in series with the switch S1 in Figure1
    only appears to short the battery.
    I have constructed the circuit on a small PCB, and had no luck.
    I tried connecting another 5K1 resistor between Q1 gate, and
    the switch end of the other 5K1 resistor because I thought it
    might have been left out.

    I found that the P Channel MOSFET was powering the 7805 reg
    no matter what I did to the gate pin. It even provides power when the gate pin is disconnected.

    Any suggestions?... I don't have any experience with MOSFETs
    Art.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Appended is a circuits that I subscribe to... it's one that's been floating about for a while and credits go to Dr Jan Kazula. You can replace the transisors with mosfets.

    Circuit Description: At initially applying power at point SUPPLY, PNP transistor Q1 remains switched off by Resistor R1. There is no voltage at OUTPUT end, all circuitry is in OFF state.

    To SWITCH-ON, press button SW1, this will bias on transistor Q1 via R2 and D1. +5v will appear at the output and your PIC chip will wake up. The PIC must now provide a signal at an output pin for the switch to remain ON. It can be any pin, and for this example we will use RA1 configured for output. PIC sets RA1 high as soon as possible in it's software (before finger is removed from button!!!). This via R3 will keep transistor Q2 switched on, and this in turn via R2 keeps Q1 switched on. The circuit is now latched and will remain on as long as the PIC keeps RA1 high.

    To SWITCH-OFF. In this example we are also using a second pin from the PIC...again it can be any pin, but in this example we use RA2 configured for input. The PIC is polling pin RA2 (but not within one second of switch-on to allow your finger to release the button!), RA2 is held high by Resistor R4, but goes low if you press SW1. Your PIC software sees you press the button at RA2 and in turn switches RA1 low (thru software), voltage disappears from Q2 and the power circuit switches off. The secret here is to ensure that you do not switch off RA1 (ie make it go low) until you detect that the person has taken his finger off the button SW1, (ie on a negative to positive transition of RA2). This will stop automatic cycling to OFF and immediately back to ON if someone keeps their finger on the button permanently.

    D1 stops Q2 from passing a low signal back to RA2 and switching the whole circuit OFF when it's job is actually to keep everything ON. D2 stops the PIC's +5v bias on RA2 (via R4) getting mixed up with the switching circuit voltages which may be at a much higher level.

    Automatic TIMER OFF is accomplished in your software. Any time you want, just make RA1 go low and the entire circuit is switched off.

    Q1 BC327B (most any PNP transistor)
    Q2 BC547B (most any NPN transistor)
    D1, D2 1N4148 (or equivallent low-power signal Diode)
    R1 22K
    R2, R3, and R4 12K

    Melanie
    Attached Images Attached Images  

  3. #3


    Did you find this post helpful? Yes | No

    Smile Help

    Hello,

    Where I connect the load to control?

    Leonardo




    Quote Originally Posted by Melanie
    Appended is a circuits that I subscribe to... it's one that's been floating about for a while and credits go to Dr Jan Kazula. You can replace the transisors with mosfets.

    Circuit Description: At initially applying power at point SUPPLY, PNP transistor Q1 remains switched off by Resistor R1. There is no voltage at OUTPUT end, all circuitry is in OFF state.

    To SWITCH-ON, press button SW1, this will bias on transistor Q1 via R2 and D1. +5v will appear at the output and your PIC chip will wake up. The PIC must now provide a signal at an output pin for the switch to remain ON. It can be any pin, and for this example we will use RA1 configured for output. PIC sets RA1 high as soon as possible in it's software (before finger is removed from button!!!). This via R3 will keep transistor Q2 switched on, and this in turn via R2 keeps Q1 switched on. The circuit is now latched and will remain on as long as the PIC keeps RA1 high.

    To SWITCH-OFF. In this example we are also using a second pin from the PIC...again it can be any pin, but in this example we use RA2 configured for input. The PIC is polling pin RA2 (but not within one second of switch-on to allow your finger to release the button!), RA2 is held high by Resistor R4, but goes low if you press SW1. Your PIC software sees you press the button at RA2 and in turn switches RA1 low (thru software), voltage disappears from Q2 and the power circuit switches off. The secret here is to ensure that you do not switch off RA1 (ie make it go low) until you detect that the person has taken his finger off the button SW1, (ie on a negative to positive transition of RA2). This will stop automatic cycling to OFF and immediately back to ON if someone keeps their finger on the button permanently.

    D1 stops Q2 from passing a low signal back to RA2 and switching the whole circuit OFF when it's job is actually to keep everything ON. D2 stops the PIC's +5v bias on RA2 (via R4) getting mixed up with the switching circuit voltages which may be at a much higher level.

    Automatic TIMER OFF is accomplished in your software. Any time you want, just make RA1 go low and the entire circuit is switched off.

    Q1 BC327B (most any PNP transistor)
    Q2 BC547B (most any NPN transistor)
    D1, D2 1N4148 (or equivallent low-power signal Diode)
    R1 22K
    R2, R3, and R4 12K

    Melanie

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    The 'load' is connected between the Collector of Q1 and 0v.

  5. #5
    Join Date
    Aug 2005
    Location
    Houston, TX
    Posts
    43


    Did you find this post helpful? Yes | No

    Default See Auto-off under schematics

    My final circuit, sort of like Melanie's, works perfectly as far as I can tell. I have no quick button problem, perhaps because I put a decoupling cap., .1uf, in the circuit.

    AMay

  6. #6


    Did you find this post helpful? Yes | No

    Smile doubts

    Hello,

    Do I want to connect a load with a battery of 9V, like I make to connect the pic with 5V and that it doesn't consummate a lot?.

    Thank you

  7. #7
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Post

    Art,

    That circuit should work except for the following.

    1. You need to really pull the gate to ground. You sort of attempted this, but you should do it by either tying the 5k1-SW junction directly to the gate (probably not too safe, but proves the point). Or tying it through a resistor (as you did), or using a voltage divider (Battery-Resistor-Gate-Resistor-Switch). The gate vs source resistor ratio (note they form a voltage divider) should be very low. In other words, when the switch closes you want the gate to see as close to ground as possible.

    2. Make sure you're using a P-channel MOSFET, not N-channel. More so, make sure the device is meant to operate from logic levels (i.e. you want a logic level MOSFET).

    3. You could use the same RC time constant in the second picture and it would give you additional delay. Capacitor goes on gate (to ground), resistor from gate to SW as small as possible, resistor from gate to battery as large as possible. This should give you a fast discharge rate (for turning on) and slow charge rate (to allow uC to take control).

    4. You could also use either the second circuit shown, or Melanie's. Both very elegant solutions too.

    Hope this helps any,

    languer.

  8. #8
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default

    Woohoo!

    I found a similar circuit that is based on the more common
    N-Channel power MOSFET.
    The circuit was a MOSFET based touch switch where you finger's
    condictivity across two pins acts as the momentary switch.
    The circuit was for a lamp, and didn't make allowance for 'staying on'.

    After some modification I got the physical circuit working great
    first go. The second circuit also doesn't use the second
    transistor (Q2).

    I have had LOTS of fun with it now that the pic can turn itself off.
    If you get a PIN wrong, the pic can say bye, bye! ...
    The same if the program has a point of finalistic determination,
    where the pic can turn off after completing a task.

    I will post my schematic in the right section since it might help others.
    Cheers,
    Art.

  9. #9
    Corey's Avatar
    Corey Guest


    Did you find this post helpful? Yes | No

    Lightbulb Try an LM2941 Linear Regulator

    Hi,

    Try using an LM2941 linear regulator. They need to be configured, but I've attached a VB program that does all of the calculating for you. You should still take a look at the datasheet though.

    They are great little linear regualtors and can also be used as a 1 amp switch.

    They have a control pin that must be tied low for the unit to work.

    I designed a circuit that tapped a signal off of the RS232 TX line from my PC. The RS232 line drove a transistor (2N3904) which charged a capacitor that, when it reached a certain voltage, drove another transistor that brought the regulator's control pin low. Then, when the regulator turned on, the PIC would start up and would drive one of it's pins high. This pin would take over from the RS232 signal and would hold the PIC on.

    You could then turn off the PIC and the entire circuit with a simple command to make that same pin low.

    Super easy!

    Good luck.
    Attached Files Attached Files

Similar Threads

  1. Switch mode power supply Pic Micro
    By iw2fvo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th July 2009, 13:11
  2. Replies: 3
    Last Post: - 29th April 2009, 00:45
  3. 16F628A - Stops if release power switch.
    By dene12 in forum General
    Replies: 16
    Last Post: - 14th February 2009, 07:57
  4. Switch PIC16F877 ON/OFF
    By koossa in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th August 2005, 12:34
  5. Electronic 'Soft' Power Switch
    By Art in forum Schematics
    Replies: 0
    Last Post: - 10th August 2003, 23:50

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts