Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Any Simple Push To On/Off Circuit?

Status
Not open for further replies.
I have a cheapo Chinese flashlight with 24 ordinary (but matched) white LEDs in parallel and powered from three 1.5V cheap "super heavy duty" AAA cells in series without anything to limit the current except the internal resistance of the battery.

:banghead:
I believe this is the key to the multiple FLAWED schematics one finds on the web.

The Chinese manufacturers, in an effort to cut down $0.001 of cost, omit the limiting resistors. Then some kid without basic electronics knowledge, copies it, and publishes it on the web.
The flawed design will then be copied relentlessly. Forever.
 
Hi crutschow, do you have any 4013 circuit that can be used in this flashlight? Thank you
Below is the LTspice simulation of a circuit using the 4013 connected as a toggle FF.
D1, C1, and R1 are for switch de-bouncing.
S1 and V1 simulate the PB switch.
The transistor can be any logic-level P-MOSFET that fully turns on at 3.3V Vgs (as noted in the data sheet where the Rds value is specified) with a current rating of at least 2A and an Rds of less than an ohm.

The circuit is micropower (or likely nanopower), consuming only leakage current whether it's ON or OFF.

Note that the power (to the battery) and ground for the 4013 are not shown and must be added.
Also all unused inputs (not outputs) on the unused FF in the package must be connected to ground.

Push ON-Off Sw.PNG
 

Attachments

  • Switch High-Side Bistable MOSFET FF.asc
    2.2 KB · Views: 133
Last edited:
you can use 4017 too to make push on/off and it can directly switch the transistor , check the version that can work on low voltage.
 
you can use 4017 too to make push on/off and it can directly switch the transistor , check the version that can work on low voltage.
Why would you try to use a decade counter circuit as a switch? :confused:
 
It can be used to work in two states , reset at 3rd pulse (push button) so that can be used for the purpose by connecting the 2nd output to switch the transistor.
I understand you likely could use it.
My question is why would you use that particular circuit, which is kind of a kludge for that purpose?
 
Below is my LTspice simulation of the circuit KMoffett posted.
I have to significantly modify some of the resistor values to get a good switching action for all the voltages.
S1 and V1 model the momentary PB switch function.

Note that the circuit requires no de-bouncing circuit and and is insensitive to how long the button is pressed.

The circuit recovery time is only about 50ms after the button is released before it can be pressed to again toggle its state.

The MOSFETs must be logic-level types that fully turn ON (not their Vgs threshold) at 3.3V Vgs (the point where the Ron is measured in the data sheet).

Edit: If it is desired that the circuit always start in the OFF state when power is applied then you can add a 20nF capacitor across R1. That will keep M1 off during the power up time until all the circuit voltages have settled.

Edit 2: You can substitute a CD4049 inverter for M2 if desired. With that you can also eliminate R1 thus requiring only three passive parts for the circuit (besides the PB).
That circuit should also power up in the OFF state, thus not requiring any additional capacitor.

View attachment 94706
I upped the voltage to 13.6 v and use an IRF4905 for the P fet and I can not get this circuit to run. I'm going to go work on some simpler (mechanical) and let my brain relax and hope for some help.
Jeff
 

Attachments

  • Switch High-Side Bistable 2 MOSFET2.asc
    1.6 KB · Views: 160
I upped the voltage to 13.6 v and use an IRF4905 for the P fet and I can not get this circuit to run. I'm going to go work on some simpler (mechanical) and let my brain relax and hope for some help.
Jeff
I had to modify your circuit by increasing C1 to 1μF and changing M2 to a MOSFET with a higher Vgs(th) to get it to work.
The problem was that the voltage at G2 was not going low enough to turn off M2.
Note: I don't have the IRF4905 model in my library so I substituted a different P-MOSFET for M1.

To make the switching more reliable over a range of voltages, replace M2 with a CD4049 inverter since it has a higher threshold voltage, making it easier to switch. With that you can also eliminate R1. That is shown in the second attachment.
 

Attachments

  • Switch High-Side Bistable 2 MOSFET3.asc
    1.7 KB · Views: 138
  • Switch High-Side Bistable MOSFET 4049.asc
    2 KB · Views: 122
Last edited:
Thanks, crutschow, most appreciated!
Jeff
 
I don't know where what I thought I had posted went, but here's where I want it so here's my post, I was working with the circuit and it worked kind of iffy, and after changing a few thing, used a 47uf 50 volt cap, I had it working good, but you couldn't push the button to rapidly or it wouldn't work, wouldn't turn off until the cap voltage had bled off. I was watching this with my scope and noticed it had to decay to about 2 volts or less to be able to switch, so I put a Bright White LED across the cap to keep the voltage down, it was going up to 13v and taking a while to decay. I thought it was working good and removed the meter and the scope and it started NOT staying off, so to take the place of the meter, I added a 100k resistor to keep the NFET, 2N7000,gate drained off , I finished up using a 2.2uf cap, because I had 3 of them and I need 3 of these circuits and 511k resistor and 1 LED across the cap, it needs 2 to sim.
Now it switches just about as fast as I can push and repush the button, I'm happy.
toggle switch.JPG

tried some different caps,4.4nf worked good, 100pf worked better,IMHO.
 

Attachments

  • IRF4905.zip
    1,006 bytes · Views: 112
  • 2n7000.zip
    1,011 bytes · Views: 112
  • ON OFF one push 2 fets +2 cap.asc
    2.4 KB · Views: 134
Last edited:
Your circuit is the discrete version of this circuit:
 

Attachments

  • alternate action LED.PNG
    alternate action LED.PNG
    8.3 KB · Views: 371
My build is for my off road vehicle and will be powering things like fans and other lights, AG/s alternate would work, but would need a FET or heavier duty transistor.
 
I always hate it when shipping is a lot more than product:mad:
 
Ziddik,
This should work as a Push-ON/Push-OFF switch for your flash light. When OFF, this would only draw current from leakage of the turned-off MOSFETs and the charged capacitor. Both less than a uA. The mechanical push button should last forever.

Mike,
Out of curiosity do you have a constant current circuit that would work for the OP with 3.7v and white LEDs. (I don't like paralleling LEDs.)

Ken
View attachment 94688

nice :cool:
 
Hi, it's been long since i have posted a thread, been kinda busy with life but now back into DIY world and i need help for a flashlight project.

I'm looking for a decent circuit of a push to On/Off circuit. I have designed an awesome flashlight of wood, but I'm having problem with a switch.

I don't like mechanical switches as most of them wear out after a few weeks of use. So any of you experts know any simple reliable circuit, preferably using just transistors or an IC that is commonly available?

My flashlight battery voltage is 3.7 V and 1 A. My circuit has posted here. Thanks in advance

Hy Ziddik,

Would you prefer two switches for turning your torch on and off: one switch for on and another switch for off. I personally hate toggle switches for controlling absolute states. The switch could be either mechanical contacts, semiconductor (hall effect magneto resistance etc), or touch. The former has a relatively short life, not just because of contact wear/fouling, but also because of the generally poor mechanical design of contact switches. The latter relies on capacitive coupling of your finger and would probably not be best for a torch and may make it difficult to realise 'zero' current drain in the off state.

As the other members have said, the current through each LED should be defined (300mA). Not only will this give you more overall light, but the light will be more consistent as the battery voltage drops with battery discharge. It will also increase battery duration and prevent the LEDs from being over stressed. Also as the eye has a logarithmic response to light, you may be able to reduce the LED current, if you have a current defining circuit, with little perceptive loss of torch brightness. This would increase the battery duration.

As MikeMI says in post #8, one way to define the LED current would be to use a step up inverter. This approach has a lot going for it because, with the right inverter you you could squeeze the most juice out of the battery. Three drawbacks are the relatively high current required from such a low voltage inverter, the inverter starting problems, especially as the battery discharges and the terminal voltage goes down, and the conversion efficiency, especially in view of the high step up ratio of around 3V to 9V.

Another approach would be to use a constant current generator for each LED, which on balance is probably the simplest for a one-off design, but the drawback is that each LED would only be able to be operated at slightly under 3V max because that is the low discharge voltage for a LiIon cell.

While I have done an outline design for the individual constant current current generator approach, I have not investigated the inverter approach in any detail.

Just to put the current drain of any switching circuit in perspective, the self discharge of a LiIon battery is typically 2.5% per month. Taking an 18650 LiIon battery with a capacity of 2.5AH would give a constant drain current of 20uA (if my calcs are right). This self discharge current goes down at lower temperatures and increases radically at higher temperatures.

I expect you have heard all the warnings about buying second-line batteries with claimed high AH figures, especially those whose marketeers names end in 'fire'. Panasonic (Sanyo) are the best bet for the private individual.

spec

(oh dear I didn't notice the OP date)
 
Last edited:
I have made several variations of this switch and right now I like the one that is displayed in this .asc
I have found that the addition of a LED or zener to keep the cap from charging up to the supply voltage makes it able to toggle quicker. I have some 16 pin sop adapter boards and I can mount 2 FDs8958D dual fet chips on it and make 2 switches in a compact package. Also, it can be used to switch R6 and/or R5 in this drawing. I have found it to be quite versatile.
Jeff
Capture.JPG
 

Attachments

  • ON OFF one push 2 fets + cap-2- (2).asc
    2.8 KB · Views: 113
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top