Author Topic: ON/OFF Switch with timer.  (Read 4546 times)

0 Members and 1 Guest are viewing this topic.

Online Zero999

  • Super Contributor
  • ***
  • Posts: 12534
  • Country: gb
  • Hero999
ON/OFF Switch with timer.
« on: December 20, 2015, 11:12:51 am »
Awhile ago Dave made a video about a soft on/off switch.

What if you want to do the same thing but include a timing function?

The idea came to me when I was looking at a monostable using FETs rather than BJTs, as the timing capacitor could be quite small. I assembled it on stripboard and it worked quite well.


I decided to add the ability to reset using the same button. I added a resistor from the output to a capacitor and connected it to the input via a switch.



It works quite well. The next improvement will be to reduce the standby power consumption by increasing some of the resistor values and using a proper power MOSFET, rather than the 2N7000 which was fine for test purpose but not much good for anything else. R1 can be replaced with the load.
« Last Edit: February 18, 2018, 07:41:27 am by Hero999 »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 12534
  • Country: gb
  • Hero999
Re: ON/OFF Switch with timer.
« Reply #1 on: December 28, 2015, 09:26:58 pm »
I've redesigned the circuit so it uses less power in standby and can be connected in series with the load. This simplifies wiring and enables an N-channel MOSFET to be used for high side drive.

I've assembled it on stripboard.

The final design will be used for some solar powered lights in a shed. It will be used as a power switch and the time out will be increased to half an hour which will prevent it from being left on all night an flattening the battery.



C1 = tantalum
C2 = ceramic
C3 = aluminium. If longer delays are required it should be tantalum but a series resistor should be added to reduce the peak current which can damage tantalum capacitors.
+V = 12VDC

For the test I used a 2.2W incandescent lamp.
« Last Edit: December 28, 2015, 09:30:41 pm by Hero999 »
 

Offline 3DTronics

  • Newbie
  • Posts: 3
  • Country: us
Re: ON/OFF Switch with timer.
« Reply #2 on: December 30, 2015, 08:59:49 am »
Thanks for sharing. I've been working on a circuit for a soft power button using a 555 but I like the idea of using basic components instead.
 

Offline tautech

  • Super Contributor
  • ***
  • Posts: 14852
  • Country: nz
  • Taupaki Technologies Ltd. NZ Siglent Distributor
    • Taupaki Technologies Ltd.
Re: ON/OFF Switch with timer.
« Reply #3 on: December 30, 2015, 09:20:13 am »
The final design will be used for some solar powered lights in a shed. It will be used as a power switch and the time out will be increased to half an hour which will prevent it from being left on all night an flattening the battery.
:-+
Nice little project for newbies.

Could you add a circuit description for simple understanding of how it works.
Edit or a further post.  ;)
Avid Rabid Hobbyist
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 12534
  • Country: gb
  • Hero999
Re: ON/OFF Switch with timer.
« Reply #4 on: December 30, 2015, 09:23:38 am »
Thanks for responding. I thought no one was interested!

Dave did a similar thing awhile ago but it didn't include the timing function. I've found the video. I went on to design a simpler circuit.


I'll write up a description of the circuits.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 12534
  • Country: gb
  • Hero999
Re: ON/OFF Switch with timer.
« Reply #5 on: December 30, 2015, 10:55:10 am »
Before attempting to explain the final circuit, lets look at the basic monostable with FETs.



When power is applied:
C1 will charge though R1 and Tr2's gate which will be forward biased. A tiny current, the order of 600nA, will briefly flow though R4.
Tr2 will be on, since its a depletion FET and gate will settle at 0V: it needs a negative voltage to turn off.
Tr1 will be off, so after the brief charging of C1, no current will flow though R1.
With Tr2 on, its drain will be near 0V which is connected to Tr1's gate via R3 so Tr1 will remain off, as it's an enhancement FET so needs positive voltage to turn on.

When the switch is activated.
Tr1's gate will be connected to +V so it will turn on.
Now the anode of C1 will be connected to 0V, so the voltage at the cathode will be equal to the 0V minus the supply voltage, minus a diode drop.
As Tr2's gate is now negative, it will turn off.
The voltage on Tr2's drain will rise to +V.
Now Tr1's gate will be held at +V, via R3 and R2, even when the switch is released.

C1 will discharge through R4.
Eventually, the voltage on C1's cathode will fall below the pinch-off voltage of Tr2 so Tr2 will start to turn on.
When Tr2 is on, the gate of Tr1 will be connected to 0V again via R3, so Tr1 will turn off.
C1 will charge via R1 & Tr2's gate and the circuit will be ready to be activated again.

The above circuit could be reset by pulling Tr1's gate to 0V. Another push button could be added to do this but that would cost more and resistors would need to be added to avoid short circuiting the power supply if both buttons were pressed simultaneously.

The reset function can be done using the same switched by adding a R5 and C2.


The circuit works on the same principle as the previous one. If forgot to number the transistors: Tr1 = 2N7000 and Tr2 = 2N3819.

When the power is first applied, C2 will charge to the supply voltage, via R5 and R1.
Tr1 will be off and Tr2 on.
When the switch is first activated, the Tr1's gate will be connected to C2 which will be charged to the supply voltage so it will turn on.
The circuit will operate as the first circuit.
C2 will now discharge to near 0V.

If the switch is not pressed again before C1 has discharged, the circuit will continue to operate as the first circuit. When Tr1 turns off as the delay terminates, the drain voltage will rise to +V and C2 will charge again, via R5.

If the switch is pressed again, C2 will be connected to Tr1's gate. The voltage on Tr1's gate will now be near 0V, causing Tr1 to turn off.
When Tr1 is off, C1's anode will be pulled to +V.
C1 will charge to +V via R1.
Tr2's gate will at or above 0V and will turn on.
Tr2's drain will be near 0V.
Tr1's gate will then be connected to 0V via R3.
With Tr1 off, the voltage at the drain will be near +V so C2 will charge to the +V via R5.

Now to the final circuit which allows it to be connected in series with the load, allowing the N-channel MOSFET to switch the high side.

The circuit works in the same manner as the previous two.
Apart from adding a diode and another capacitor I've also made a few other modifications:
  • I've increased the value of R2 to minimise the standby current.
  • The value of C2 has been increased which enables Tr1's gate to be connected directly to  Tr2's source, as the capacitor can apply a firm enough pulse to raise the voltage on Tr1's gate, in spite of Tr2 being on.
  • I replaced the 2N7000 with the IRL540, a proper power MOSFET.
  • R3 added in series with the gate of Tr2 because the load could draw a large current, which could destroy Tr2.
  • Increased C1 for a longer delay.
RL represents the load. In the test I conducted, I used a 12V 2.2W incandescent lamp.

When the power is applied Tr1 will be off.
C3 will charge to +V via D1 and the RL.
C2 will charge via R4 and RL.
C1 will charge via RL, R3 and Tr2.

When the switch is activated, Tr1 will turn on.
C3 will now power the rest of the circuit, as D1 prevents it from discharging.
The circuit will operate as the previous two.
Tr2 will turn off, connecting Tr1's gate to C3's anode via R2.

When Tr1 turns off, due to the button being pressed again or the delay terminating, C3 will be connected in series with RL again.

Well, it's getting late. I hope that's a good enough explanation. Sorry if the wording isn't good. No doubt I'll edit it later.
« Last Edit: May 22, 2018, 06:30:35 pm by Hero999 »
 

Offline 4JimBeam

  • Contributor
  • Posts: 5
  • Country: de
Re: ON/OFF Switch with timer.
« Reply #6 on: February 19, 2016, 02:40:44 am »
Thanks for the Hero999  :-+
 

Offline promacjoe

  • Regular Contributor
  • *
  • Posts: 65
  • Country: us
Re: ON/OFF Switch with timer.
« Reply #7 on: February 19, 2016, 04:37:35 am »
Question, I see the only ground you have on the circuit is through the load. Once the power goes on, the ground of your circuit goes to positive. Aren't you missing a second ground somewhere.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 12534
  • Country: gb
  • Hero999
Re: ON/OFF Switch with timer.
« Reply #8 on: March 18, 2016, 10:37:45 am »
Question, I see the only ground you have on the circuit is through the load. Once the power goes on, the ground of your circuit goes to positive. Aren't you missing a second ground somewhere.
Sorry for the late reply.

No, there is no missing ground. The circuit gets is power by charging C3 when Tr1 is off.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf