PDA

View Full Version : Soft On/Off switch



Audette
- 18th May 2012, 09:47
Hi Guys,

I have seen the soft on/off switch circuit given by the following link in this forum by Melanie (schematic shown below).
http://www.picbasic.co.uk/forum/showthread.php?t=57

http://www.picbasic.co.uk/forum/attachment.php?attachmentid=5&stc=1&d=1060496918
I have been trying to implement the same solution for my application. I have a PCB which is PIC controlled and need a soft on/off switch. The mechanical switch I use is a toggle switch. I have had to change the pnp (Q1) with a P-fet due to the current required from the Vin line. The voltage at the input is 12V and the maximum current drawn can be around 2A.

In the implementation I have, when the toggle switch is turned off, the PIC will detect this and send a '0' to Q2. This initiates the circuit to turn off. However, the P-Fet output voltage reaches around 4V and then suddenly turns back on again. I tried to tie the gate of Q1 to ground using a resistor to make sure that the gate is turned off. But still no joy.

Can anyone tell me what I might be doing wrong please...

Thank you in advance.

LinkMTech
- 20th May 2012, 15:07
Hi Audette,
Welcome to the forum.
Since you changed Q1 to a P-CH FET, then R1 and R2 values will need to be changed to much lower values than what is used it the original thread.
If the FET gate to source can handle a 6V difference, change R1 and R2 values to 1K for faster ON/OFF times. Consult the part's data sheet though.
The 12K on R1 may not be allowing the gate charge to drain fast enough and leaving enough residual "output" to turn the circuit back ON.

Or..

Something is leaking a little current at the R2/D2/Q2.C node.

Charlie
- 21st May 2012, 11:21
FET's are voltage operated devices, where BJTs are current operated devices. Also P-channel devices operate essentially backwards to N-channel devices, so when PIC/RA1 goes high, Q2 turns on hard, making it's collector effectively ground (about 0.6 V or so). This ground, turns the P-channel device ON hard. In other words, grounding the gate of a P-channel device will turn it full on, not full off.

Check your circuit carefully - if I had to guess what might cause the behaviour you describe, I'd check to make sure D1 is not in backwards.

Also, the absolute values of R1 and R2 are not important; only their ratio, despite what the previous poster said. A nice side benefit of using a FET is you can actually make these devices quite large and not waste as much bias current. He was correct that if you go too high, the gate capacitance will start to introduce a small time constant, but it's unlikely you would notice. Assuming Vgs is at least 12V on the device you've chosen, I'd be tempted to eliminate R2 completely for a FET circuit, and make R1 anything I've got lying around between 10K and 100K. That way you don't need to worry about threshold voltage of your device because you'd be pretty much guaranteed to cross it.

aliciaDJones
- 17th August 2012, 15:01
What is Soft On/Off switch?? Is they use on computer or net??

Archangel
- 18th August 2012, 09:56
As I understand it a soft on/off switch ramps the voltage/current up slowly, so as to reduce shock on components or in the case of a hand held power tool, it keeps the motor's torque from jerking the tool out of your hands.

Charlie
- 18th August 2012, 11:20
As I understand it a soft on/off switch ramps the voltage/current up slowly, so as to reduce shock on components or in the case of a hand held power tool, it keeps the motor's torque from jerking the tool out of your hands.
Actually, it's typically used to debounce a switch so you get a smooth single on-off transition instead of multiple bounces from mechanical switches. However, in this case, it's being used to allow a push button contact such as those found on calculators and keypads to power on a PIC. The PIC then keeps itself on with software, until a software command is given to power off. The power off command could be given after detecting a second press of the power button.
If you follow the link to the original thread, in the first post in this thread, all is explained.

Archangel
- 18th August 2012, 19:54
Well good then, I learned something new, to me. Thanks.