Discussion:
This isn't working
(too old to reply)
rhor...@gmail.com
2024-01-28 17:14:20 UTC
Permalink
I want to use an EC1 rotary encoder to control a battery powered device. The EC1 sports a momentary switch, rather than an on / off switch, however, so I need to add a circuit to latch the momentary pulse. Figure 3 on this page should work: http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch.

The battery will have an output boltage between 17V and 25V, and the device can use up to 10 amperes, however, so the IRF3719 dual MOSFET suggested on that page won't quite work. Instead, I am using an FQP47P06 P-channel power MOSFET as the main switch and a 2N7002 N-channel MOSFET as the gate driver for the FQP47P06. I don't know why, but it isn't working, however. When the button is pushed, if the device is off, the switch properly turns on, but when the device is already on, pushing the button does nothing. With a 22.0 Volt battery input, pushing and holding the switch brings the voltage at the gate of the 2N7002 to 19.9 Volts, which implies a drain current of about 0.2 milliamps in the 2N7002. That sounds about right.

Looking at the scope, it takes about 150 - 200 ms for the voltage to reach this value, which also seems about right, and as expected, it takes considerably longer for the voltage at the 1uF capacitor to recover to near 0V. I am surmising the 19.9 V level experienced at the top of the cap is not high enough to shut off the FQP47P06. I wonder if the modification below would help?

Loading Image...
John Larkin
2024-01-28 18:19:39 UTC
Permalink
Post by ***@gmail.com
I want to use an EC1 rotary encoder to control a battery powered device. The EC1 sports a momentary switch, rather than an on / off switch, however, so I need to add a circuit to latch the momentary pulse. Figure 3 on this page should work: http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch.
The battery will have an output boltage between 17V and 25V, and the device can use up to 10 amperes, however, so the IRF3719 dual MOSFET suggested on that page won't quite work. Instead, I am using an FQP47P06 P-channel power MOSFET as the main switch and a 2N7002 N-channel MOSFET as the gate driver for the FQP47P06. I don't know why, but it isn't working, however. When the button is pushed, if the device is off, the switch properly turns on, but when the device is already on, pushing the button does nothing. With a 22.0 Volt battery input, pushing and holding the switch brings the voltage at the gate of the 2N7002 to 19.9 Volts, which implies a drain current of about 0.2 milliamps in the 2N7002. That sounds about right.
Looking at the scope, it takes about 150 - 200 ms for the voltage to reach this value, which also seems about right, and as expected, it takes considerably longer for the voltage at the 1uF capacitor to recover to near 0V. I am surmising the 19.9 V level experienced at the top of the cap is not high enough to shut off the FQP47P06. I wonder if the modification below would help?
http://siliconventures.net/images/Flashlight%20Switch%20Update.PNG
The circuit image is cropped but looks wrong. Spice it.

It technically violates the abs-max gate voltage spec of the 2N7002,
but it would probably survive.

I recently bought a bunch of LED flashlights from Amazon. Machined and
anodized, adjustable focus, single AA battery, three blink/intensity
modes, really interesting light pattern. $3 each. How can they do
that?
rhor...@gmail.com
2024-01-29 02:09:13 UTC
Permalink
Post by John Larkin
Post by ***@gmail.com
http://siliconventures.net/images/Flashlight%20Switch%20Update.PNG
The circuit image is cropped but looks wrong. Spice it.
That is the drawing from the sim. The two lines off to the right go to other parts of the circuit that do not affect the switch.

What looks wrong?
Post by John Larkin
It technically violates the abs-max gate voltage spec of the 2N7002,
but it would probably survive.
I could insert a Zener diode between R2 and the gate of the 2N7002. That shouldn't affect the operation of Q2. I haven't gone beyond 22.5 volts in testing.
Post by John Larkin
I recently bought a bunch of LED flashlights from Amazon. Machined and
anodized, adjustable focus, single AA battery, three blink/intensity
modes, really interesting light pattern. $3 each. How can they do
that?
Loss leader?
John Larkin
2024-01-29 03:08:01 UTC
Permalink
Post by ***@gmail.com
Post by John Larkin
Post by ***@gmail.com
http://siliconventures.net/images/Flashlight%20Switch%20Update.PNG
The circuit image is cropped but looks wrong. Spice it.
That is the drawing from the sim. The two lines off to the right go to other parts of the circuit that do not affect the switch.
What looks wrong?
As you noted, it doesn't turn off.

The voltage charging C4 is somewhere between 25 and 12.5. It can't
turn off Q2.
John Larkin
2024-01-29 03:34:35 UTC
Permalink
Post by John Larkin
Post by ***@gmail.com
Post by John Larkin
Post by ***@gmail.com
http://siliconventures.net/images/Flashlight%20Switch%20Update.PNG
The circuit image is cropped but looks wrong. Spice it.
That is the drawing from the sim. The two lines off to the right go to other parts of the circuit that do not affect the switch.
What looks wrong?
As you noted, it doesn't turn off.
The voltage charging C4 is somewhere between 25 and 12.5. It can't
turn off Q2.
Actually, the real problem is the insistance on not making proper
3-way and 4-way connections. All those extra dots make the electrons
get confused and discouraged.
rhor...@gmail.com
2024-01-29 09:46:55 UTC
Permalink
Post by John Larkin
Post by John Larkin
Post by ***@gmail.com
http://siliconventures.net/images/Flashlight%20Switch%20Update.PNG
The circuit image is cropped but looks wrong. Spice it.
That is the drawing from the sim. The two lines off to the right go to other parts of the circuit that do not affect the switch.
What looks wrong?
As you noted, it doesn't turn off.
The voltage charging C4 is somewhere between 25 and 12.5. It can't
turn off Q2.
Yeah, it seemed... wrong somehow. So much for trusting the internet as a source.
Anthony William Sloman
2024-01-29 10:23:42 UTC
Permalink
Post by John Larkin
Post by John Larkin
Post by ***@gmail.com
http://siliconventures.net/images/Flashlight%20Switch%20Update.PNG
The circuit image is cropped but looks wrong. Spice it.
That is the drawing from the sim. The two lines off to the right go to other parts of the circuit that do not affect the switch.
What looks wrong?
As you noted, it doesn't turn off.
The voltage charging C4 is somewhere between 25 and 12.5. It can't
turn off Q2.
Yeah, it seemed... wrong somehow. So much for trusting the internet as a source.
The internet goes everwhere. You have be careful what you connect to.
--
Bill Sloman, Sydney
John Larkin
2024-01-29 14:24:46 UTC
Permalink
Post by ***@gmail.com
Post by John Larkin
Post by John Larkin
Post by ***@gmail.com
http://siliconventures.net/images/Flashlight%20Switch%20Update.PNG
The circuit image is cropped but looks wrong. Spice it.
That is the drawing from the sim. The two lines off to the right go to other parts of the circuit that do not affect the switch.
What looks wrong?
As you noted, it doesn't turn off.
The voltage charging C4 is somewhere between 25 and 12.5. It can't
turn off Q2.
Yeah, it seemed... wrong somehow. So much for trusting the internet as a source.
If you fix the C4 problem, easily done, it still won't turn off if the
(unseen) load has much capacitance. And it might still blow out the
mosfet gates. There is so much bad electronics on the internet. Most
of it is bad, actually.

Why not just use a toggle switch?
rhor...@gmail.com
2024-01-29 14:40:32 UTC
Permalink
Post by John Larkin
Why not just use a toggle switch?
Because I am using a rotary encoder. In previous designs I used a potentiometer with an ON/Off switch, but for several reasons I am moving to a rotary encoder. They have momentary switches.
Fred Bloggs
2024-01-29 15:20:48 UTC
Permalink
Post by John Larkin
Post by John Larkin
Post by John Larkin
Post by ***@gmail.com
http://siliconventures.net/images/Flashlight%20Switch%20Update.PNG
The circuit image is cropped but looks wrong. Spice it.
That is the drawing from the sim. The two lines off to the right go to other parts of the circuit that do not affect the switch.
What looks wrong?
As you noted, it doesn't turn off.
The voltage charging C4 is somewhere between 25 and 12.5. It can't
turn off Q2.
Yeah, it seemed... wrong somehow. So much for trusting the internet as a source.
If you fix the C4 problem, easily done, it still won't turn off if the
(unseen) load has much capacitance. And it might still blow out the
mosfet gates. There is so much bad electronics on the internet. Most
of it is bad, actually.
Why not just use a toggle switch?
The reference isn't bad, if you apply it right, things like keeping power in 3-18V range. See fig 4 for the capacitor loads.

http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch
Fred Bloggs
2024-01-29 15:27:39 UTC
Permalink
Post by John Larkin
Post by John Larkin
Post by John Larkin
Post by ***@gmail.com
http://siliconventures.net/images/Flashlight%20Switch%20Update.PNG
The circuit image is cropped but looks wrong. Spice it.
That is the drawing from the sim. The two lines off to the right go to other parts of the circuit that do not affect the switch.
What looks wrong?
As you noted, it doesn't turn off.
The voltage charging C4 is somewhere between 25 and 12.5. It can't
turn off Q2.
Yeah, it seemed... wrong somehow. So much for trusting the internet as a source.
If you fix the C4 problem, easily done, it still won't turn off if the
(unseen) load has much capacitance. And it might still blow out the
mosfet gates. There is so much bad electronics on the internet. Most
of it is bad, actually.
Why not just use a toggle switch?
They've been in industrial embedded systems for about 40 years. Their pages look pretty good to me. People who misapply their suggestions because they don't understand the operation is what's bad.

http://www.mosaic-industries.com/
Fred Bloggs
2024-01-29 13:15:57 UTC
Permalink
Post by John Larkin
I want to use an EC1 rotary encoder to control a battery powered device. The EC1 sports a momentary switch, rather than an on / off switch, however, so I need to add a circuit to latch the momentary pulse. Figure 3 on this page should work: http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch.
The battery will have an output boltage between 17V and 25V, and the device can use up to 10 amperes, however, so the IRF3719 dual MOSFET suggested on that page won't quite work. Instead, I am using an FQP47P06 P-channel power MOSFET as the main switch and a 2N7002 N-channel MOSFET as the gate driver for the FQP47P06. I don't know why, but it isn't working, however. When the button is pushed, if the device is off, the switch properly turns on, but when the device is already on, pushing the button does nothing. With a 22.0 Volt battery input, pushing and holding the switch brings the voltage at the gate of the 2N7002 to 19.9 Volts, which implies a drain current of about 0.2 milliamps in the 2N7002. That sounds about right.
Looking at the scope, it takes about 150 - 200 ms for the voltage to reach this value, which also seems about right, and as expected, it takes considerably longer for the voltage at the 1uF capacitor to recover to near 0V. I am surmising the 19.9 V level experienced at the top of the cap is not high enough to shut off the FQP47P06. I wonder if the modification below would help?
http://siliconventures.net/images/Flashlight%20Switch%20Update.PNG
The circuit image is cropped but looks wrong. Spice it.
It technically violates the abs-max gate voltage spec of the 2N7002,
but it would probably survive.
I recently bought a bunch of LED flashlights from Amazon. Machined and
anodized, adjustable focus, single AA battery, three blink/intensity
modes, really interesting light pattern. $3 each. How can they do
that?
That FQP47P06 is a case in point. Originally a Fairchild design, duplicated by the 'copy-ers' at ON. Then they're strutting around like peacocks with a plume up their ass to show off their prowess.
Jasen Betts
2024-03-03 08:16:17 UTC
Permalink
Post by John Larkin
Post by ***@gmail.com
I want to use an EC1 rotary encoder to control a battery powered device. The EC1 sports a momentary switch, rather than an on / off switch, however, so I need to add a circuit to latch the momentary pulse. Figure 3 on this page should work: http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch.
The battery will have an output boltage between 17V and 25V, and the device can use up to 10 amperes, however, so the IRF3719 dual MOSFET suggested on that page won't quite work. Instead, I am using an FQP47P06 P-channel power MOSFET as the main switch and a 2N7002 N-channel MOSFET as the gate driver for the FQP47P06. I don't know why, but it isn't working, however. When the button is pushed, if the device is off, the switch properly turns on, but when the device is already on, pushing the button does nothing. With a 22.0 Volt battery input, pushing and holding the switch brings the voltage at the gate of the 2N7002 to 19.9 Volts, which implies a drain current of about 0.2 milliamps in the 2N7002. That sounds about right.
Looking at the scope, it takes about 150 - 200 ms for the voltage to reach this value, which also seems about right, and as expected, it takes considerably longer for the voltage at the 1uF capacitor to recover to near 0V. I am surmising the 19.9 V level experienced at the top of the cap is not high enough to shut off the FQP47P06. I wonder if the modification below would help?
http://siliconventures.net/images/Flashlight%20Switch%20Update.PNG
The circuit image is cropped but looks wrong. Spice it.
It technically violates the abs-max gate voltage spec of the 2N7002,
but it would probably survive.
I recently bought a bunch of LED flashlights from Amazon. Machined and
anodized, adjustable focus, single AA battery, three blink/intensity
modes, really interesting light pattern. $3 each. How can they do
that?
Perhaps they buy them on Aliexpress for $2
https://www.aliexpress.com/item/33020731608.html

Or to answer the implied question, the manufacturers are not buying
their parts from Digikey.

Stick a 14500 lithium-ion cell in there instead of the AA for increased
brightness. These are great for reading laser marking on ICs, also
inspecting drywall for flatness etc.
--
Jasen.
🇺🇦 Слава Україні
Arie de Muijnck
2024-03-03 11:27:36 UTC
Permalink
Post by Jasen Betts
Perhaps they buy them on Aliexpress for $2
https://www.aliexpress.com/item/33020731608.html
Or to answer the implied question, the manufacturers are not buying
their parts from Digikey.
Stick a 14500 lithium-ion cell in there instead of the AA for increased
brightness. These are great for reading laser marking on ICs, also
inspecting drywall for flatness etc.
I like this part of the ad: Emitting Color: black

Arie
Phil Hobbs
2024-03-03 14:28:22 UTC
Permalink
Post by Arie de Muijnck
Post by Jasen Betts
Perhaps they buy them on Aliexpress for $2
https://www.aliexpress.com/item/33020731608.html
Or to answer the implied question, the manufacturers are not buying
their parts from Digikey.
Stick a 14500 lithium-ion cell in there instead of the AA for increased
brightness. These are great for reading laser marking on ICs, also
inspecting drywall for flatness etc.
I like this part of the ad: Emitting Color: black
Arie
If you overdrive it enough, it becomes a Darkness-Emitting Diode (DED).

Cheers

Phil Hobbs
--
Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC /
Hobbs ElectroOptics Optics, Electro-optics, Photonics, Analog Electronics
Fred Bloggs
2024-01-29 13:02:03 UTC
Permalink
I want to use an EC1 rotary encoder to control a battery powered device. The EC1 sports a momentary switch, rather than an on / off switch, however, so I need to add a circuit to latch the momentary pulse. Figure 3 on this page should work: http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch.
The circuit in figure 3 on the page will work once you 1) select a new PFET that can handle the load current, and 2) attenuate the voltages applied to both FET gates to keep them in bounds, 2N7002 is 20Vmax FPQ47PO6 is 25Vmax.

C4 is a 'next state' voltage, meaning the current state must last for about 10 time constants of R14 xC4 (1000ms ) to guarantee the next press of MOM S1 causes a state change.

In order to tame the voltages applied to the FET gates, proceed as follows:

1) disconnect R3-R14 connection

2) add an additional series resistor divider of 22k + 47k between the 25V source and GND, with 22k connected to the source and 47k to GND. Connect a tap from the junction of the 22k + 47k to the top of R14 AND the drain of Q2. Now Q2 can completely discharge C4 to 0V through the 100k. When Q2 is OFF, the 22k +47k will charge C4 to between 10V and 17V, which is safe to put on the gate of Q2 via S1.

When Q2 is turned on by pressing momentary S1, Q2 drain goes to 0V, applying Source/2 to gate of Q1. The gate voltage will range between 7.5V and 12.5V relative to the high side. Q2 drain will discharge C4 through 100k R14 to GND. It also pulls the center tap of the 22k +47k to GND which doesn't affect anything.

If 1000ms has elapsed since Q2 was turned on. C4 should be discharged to 0V. Pressing S1 will then pull the gate of Q2 to 0V through C4. Q2 turns off, removing the gate drive from Q3 turning it off. BUT if the output voltage at drain Q3 hangs around for too long because of big capacitors or something on the load, C4 will recharge through R2 and turn on Q2 again. That's your problem because the information you gave is just a snippet.

Your gate drive of Q1 may be a bit on the weak side. If you change R3 to 10k, the applied gate drive for Q3 will land between 10V and 17V, which should support 4A loading better and make for faster turn-on/off.
The battery will have an output boltage between 17V and 25V, and the device can use up to 10 amperes, however, so the IRF3719 dual MOSFET suggested on that page won't quite work. Instead, I am using an FQP47P06 P-channel power MOSFET as the main switch and a 2N7002 N-channel MOSFET as the gate driver for the FQP47P06. I don't know why, but it isn't working, however. When the button is pushed, if the device is off, the switch properly turns on, but when the device is already on, pushing the button does nothing. With a 22.0 Volt battery input, pushing and holding the switch brings the voltage at the gate of the 2N7002 to 19.9 Volts, which implies a drain current of about 0.2 milliamps in the 2N7002. That sounds about right.
Looking at the scope, it takes about 150 - 200 ms for the voltage to reach this value, which also seems about right, and as expected, it takes considerably longer for the voltage at the 1uF capacitor to recover to near 0V. I am surmising the 19.9 V level experienced at the top of the cap is not high enough to shut off the FQP47P06. I wonder if the modification below would help?
http://siliconventures.net/images/Flashlight%20Switch%20Update.PNG
rhor...@gmail.com
2024-01-29 16:43:01 UTC
Permalink
Post by Fred Bloggs
The circuit in figure 3 on the page will work once you 1) select a new PFET that can handle the load current, and 2) attenuate the voltages applied to both FET gates to keep them in bounds, 2N7002 is 20Vmax FPQ47PO6 is 25Vmax.
Nope and nope. The spec sheet shows the maxiumum Drain-Source Voltage of the FQP47P06 to be 60V and the maximum Gate-Source to be 25V. The maximuim current is 47A. Since the DS is at most 25.2V and the GS is about 8V, with a maximum current of around 10A (more commonly 0 - 5A), it should not be a problem. I have been using these MOSFETs on these devices for nearly 10 years, and I have never had a failure. I am not sure how you think attenuating the voltages will help since the problem is the gate voltage is already too low, preventing the transistor from turning off once it is turned on. It turns on just fine. I can manually shut it down by shorting the Gate to V+, but pressingt the button never gets the gate voltage high enough to shut down the FET.
Post by Fred Bloggs
C4 is a 'next state' voltage, meaning the current state must last for about 10 time constants of R14 xC4 (1000ms ) to guarantee the next press of MOM S1 causes a state change.
I am well aware of the RC time constant, and how this is supposed to work.
Post by Fred Bloggs
1) disconnect R3-R14 connection
2) add an additional series resistor divider of 22k + 47k between the 25V source and GND, with 22k connected to the source and 47k to GND. Connect a tap from the junction of the 22k + 47k to the top of R14 AND the drain of Q2. Now Q2 can completely discharge C4 to 0V through the 100k. When Q2 is OFF, the 22k +47k will charge C4 to between 10V and 17V, which is safe to put on the gate of Q2 via S1.
Of course it is safe. What it isn't is effective. With a 25V power source, the Gate voltage has to be above 21.5V (measured) in order to shut off the FET. That never happens.
Post by Fred Bloggs
If 1000ms has elapsed since Q2 was turned on. C4 should be discharged to 0V.
Pressing S1 will then pull the gate of Q2 to 0V through C4. Q2 turns off, removing the gate drive from Q3 turning it off.
Except it doesn't. See the simulation. Once Q3 is turned on by pressing the switch the first time, the voltage at the Gate never exceeds 20.5 Volts, even if I reduce R3 all the way down to 2K. Any further, and I will exceed the 250 mW rating of the resistors I am using. Tht's quite ridiculous for a MOSFET Gate driver.
Post by Fred Bloggs
BUT if the output voltage at drain Q3 hangs around for too long because of big capacitors or something on the load, C4 will recharge through R2 and turn on Q2 again. That's your problem because the information you gave is just a snippet.
On the bench right now, the only load is a 7805 feeding an Arduino (30ma / 0.33 uF). In the sim, it is a 4 ohm resistor.
Post by Fred Bloggs
Your gate drive of Q1 may be a bit on the weak side.
You have got to be kidding me. I drive these with 1M resistors and a 10M pullup all the time. Hell, they can turn on just from static charges in the air if there isn't a pullup resistor. Do you not know how an FET works?

Loading Image...
Fred Bloggs
2024-01-29 18:30:19 UTC
Permalink
Post by Fred Bloggs
The circuit in figure 3 on the page will work once you 1) select a new PFET that can handle the load current, and 2) attenuate the voltages applied to both FET gates to keep them in bounds, 2N7002 is 20Vmax FPQ47PO6 is 25Vmax.
Nope and nope. The spec sheet shows the maxiumum Drain-Source Voltage of the FQP47P06 to be 60V and the maximum Gate-Source to be 25V. The maximuim current is 47A. Since the DS is at most 25.2V and the GS is about 8V, with a maximum current of around 10A (more commonly 0 - 5A), it should not be a problem. I have been using these MOSFETs on these devices for nearly 10 years, and I have never had a failure. I am not sure how you think attenuating the voltages will help since the problem is the gate voltage is already too low, preventing the transistor from turning off once it is turned on. It turns on just fine. I can manually shut it down by shorting the Gate to V+, but pressingt the button never gets the gate voltage high enough to shut down the FET.
Your turn-on turn-off times are so slow, you're never seeing the effects of overshoot and ringing.
Post by Fred Bloggs
C4 is a 'next state' voltage, meaning the current state must last for about 10 time constants of R14 xC4 (1000ms ) to guarantee the next press of MOM S1 causes a state change.
I am well aware of the RC time constant, and how this is supposed to work.
Post by Fred Bloggs
1) disconnect R3-R14 connection
2) add an additional series resistor divider of 22k + 47k between the 25V source and GND, with 22k connected to the source and 47k to GND. Connect a tap from the junction of the 22k + 47k to the top of R14 AND the drain of Q2. Now Q2 can completely discharge C4 to 0V through the 100k. When Q2 is OFF, the 22k +47k will charge C4 to between 10V and 17V, which is safe to put on the gate of Q2 via S1.
Of course it is safe. What it isn't is effective. With a 25V power source, the Gate voltage has to be above 21.5V (measured) in order to shut off the FET. That never happens.
The only way that is happening is Q2 is not turning off completely. The reason for that is your gate turn-off is so slow, the Q3 is going linear, it doesn't completely shut-off and supplies current thru the 10k to C1putting enough voltage on Q2 gate to maintain Q3 gate voltage causing some conduction. FETs are not fully off or fully on only, there are intermediate conduction states.
Post by Fred Bloggs
If 1000ms has elapsed since Q2 was turned on. C4 should be discharged to 0V.
Pressing S1 will then pull the gate of Q2 to 0V through C4. Q2 turns off, removing the gate drive from Q3 turning it off.
Except it doesn't. See the simulation. Once Q3 is turned on by pressing the switch the first time, the voltage at the Gate never exceeds 20.5 Volts, even if I reduce R3 all the way down to 2K. Any further, and I will exceed the 250 mW rating of the resistors I am using. Tht's quite ridiculous for a MOSFET Gate driver.
Post by Fred Bloggs
BUT if the output voltage at drain Q3 hangs around for too long because of big capacitors or something on the load, C4 will recharge through R2 and turn on Q2 again. That's your problem because the information you gave is just a snippet.
On the bench right now, the only load is a 7805 feeding an Arduino (30ma / 0.33 uF). In the sim, it is a 4 ohm resistor.
Post by Fred Bloggs
Your gate drive of Q1 may be a bit on the weak side.
You have got to be kidding me. I drive these with 1M resistors and a 10M pullup all the time. Hell, they can turn on just from static charges in the air if there isn't a pullup resistor. Do you not know how an FET works?
That's not the point.
http://siliconventures.net/images/Flashlight%20Switch%20Test.JPG
rhor...@gmail.com
2024-01-30 12:36:49 UTC
Permalink
Post by Fred Bloggs
Of course it is safe. What it isn't is effective. With a 25V power source, the Gate voltage has to be above 21.5V (measured) in order to shut off the FET. That never happens.
The only way that is happening is Q2 is not turning off completely.
No, it isn't the only way. Over a period of time short compared to N x RC, C4 will hold the voltage at R14 close to 0. Assuming R14 = 100K, R3 = 10K, and V+ = 25 Volts, that sets the initial voltage at the Gate of Q3 to be 22.7 Volts, which is not high enough to turn off Q3.

Over time, with the output being close to 24 Volts, the current through R2 causes the voltage at the Gate of Q2 to rise above 2 Volts, which turns Q2 back on. When C4 is at 2 Volts, the Gate of Q3 still sits at 22.9 volts, which still is not high enough to turn Q3 off. As you can see from the test trace, the output voltage drops just a few volts for a very brief moment, but it never, ever turns off. It can't. There are no reasonable values of R2, R3, R14, and C4 that will reliably turn off Q3 in a useful manner when the switch is pressed.

I have tried numerous small variations, including going with an ordinary BJT for Q2, but no simple variant works well enough. Either the device switches on but then switches off way, way too quickly if the swutchg is held for any reasonable length of time, or else it won't turn off at all.
Post by Fred Bloggs
The reason for that is your gate turn-off is so slow, the Q3 is going linear, it doesn't completely shut-off and supplies current thru the 10k to C1putting enough voltage on Q2 gate to maintain Q3 gate voltage causing some conduction.
This is nonsense. The reason the switch won't turn off is effectively because the high input voltage causes the Gate voltage to be too low no matter what. The voltage at C4 rises too high to keep Q2 shut off before the voltage at R3 rises high enough to shut down Q3. If the input voltage were lower, and / or the threshold voltage of Q3 were higher, it could work.
Post by Fred Bloggs
FETs are not fully off or fully on only, there are intermediate conduction states.
Try telling me something I don't know. I have been doing this for over 40 years, and my undergraduate studies were in physics. I know precisely how transistors work and how they behave. Please do not treat me like a fool. It wastes everyone's time.
Fred Bloggs
2024-01-30 13:59:06 UTC
Permalink
Post by Fred Bloggs
Of course it is safe. What it isn't is effective. With a 25V power source, the Gate voltage has to be above 21.5V (measured) in order to shut off the FET. That never happens.
The only way that is happening is Q2 is not turning off completely.
No, it isn't the only way. Over a period of time short compared to N x RC, C4 will hold the voltage at R14 close to 0. Assuming R14 = 100K, R3 = 10K, and V+ = 25 Volts, that sets the initial voltage at the Gate of Q3 to be 22.7 Volts, which is not high enough to turn off Q3.
Over time, with the output being close to 24 Volts, the current through R2 causes the voltage at the Gate of Q2 to rise above 2 Volts, which turns Q2 back on. When C4 is at 2 Volts, the Gate of Q3 still sits at 22.9 volts, which still is not high enough to turn Q3 off. As you can see from the test trace, the output voltage drops just a few volts for a very brief moment, but it never, ever turns off. It can't. There are no reasonable values of R2, R3, R14, and C4 that will reliably turn off Q3 in a useful manner when the switch is pressed.
I have tried numerous small variations, including going with an ordinary BJT for Q2, but no simple variant works well enough. Either the device switches on but then switches off way, way too quickly if the swutchg is held for any reasonable length of time, or else it won't turn off at all.
Post by Fred Bloggs
The reason for that is your gate turn-off is so slow, the Q3 is going linear, it doesn't completely shut-off and supplies current thru the 10k to C1putting enough voltage on Q2 gate to maintain Q3 gate voltage causing some conduction.
This is nonsense. The reason the switch won't turn off is effectively because the high input voltage causes the Gate voltage to be too low no matter what. The voltage at C4 rises too high to keep Q2 shut off before the voltage at R3 rises high enough to shut down Q3. If the input voltage were lower, and / or the threshold voltage of Q3 were higher, it could work.
Post by Fred Bloggs
FETs are not fully off or fully on only, there are intermediate conduction states.
Try telling me something I don't know. I have been doing this for over 40 years, and my undergraduate studies were in physics. I know precisely how transistors work and how they behave. Please do not treat me like a fool. It wastes everyone's time.
You don't seem to know much about the importance of the frame of reference for voltages, all your quotes are single ended. Then you're oblivious to the effect of even a small voltage at the gate Q2 and the resulting IDS. Being "close to 0" doesn't cut it obviously. You don't seem to have a clue about the relatively large resistance on the gate of Q3 and how that develops a Q3 VGS from a Q2 relatively small leakage current, as in a few hundred uA. There isn't the slightest awareness of loop gain, or even the existence of the idea of a loop. You don't seem to know a thing about the terminal capacitances you have at either FET, but especially the big one, which is all the same since you don't seem to know what to do with them. You don't seem to know mechanical switches bounce, or what a bounce even is. You don't seem to know much about excessive voltage stress gate-to-channel on the FET being a component failure acceleration factor.
Fred Bloggs
2024-01-29 15:08:50 UTC
Permalink
I want to use an EC1 rotary encoder to control a battery powered device. The EC1 sports a momentary switch, rather than an on / off switch, however, so I need to add a circuit to latch the momentary pulse. Figure 3 on this page should work: http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch.
The battery will have an output boltage between 17V and 25V, and the device can use up to 10 amperes, however, so the IRF3719 dual MOSFET suggested on that page won't quite work. Instead, I am using an FQP47P06 P-channel power MOSFET as the main switch and a 2N7002 N-channel MOSFET as the gate driver for the FQP47P06. I don't know why, but it isn't working, however. When the button is pushed, if the device is off, the switch properly turns on, but when the device is already on, pushing the button does nothing. With a 22.0 Volt battery input, pushing and holding the switch brings the voltage at the gate of the 2N7002 to 19.9 Volts, which implies a drain current of about 0.2 milliamps in the 2N7002. That sounds about right.
Looking at the scope, it takes about 150 - 200 ms for the voltage to reach this value, which also seems about right, and as expected, it takes considerably longer for the voltage at the 1uF capacitor to recover to near 0V. I am surmising the 19.9 V level experienced at the top of the cap is not high enough to shut off the FQP47P06. I wonder if the modification below would help?
http://siliconventures.net/images/Flashlight%20Switch%20Update.PNG
Most battery systems want zero quiescent current draw. You can't use the additional voltage dividers. Use the figure 3 circuit except add protection zeners across the two gates, and connect the top of R14 to Q2 drain, not the junction of the Q3 gate resistors. Instead of 5k + 5k, use 1.2k +680, with the 1.2k at the top. Otherwise, you could keep Q3 on when it's supposed to be off.
rhor...@gmail.com
2024-01-29 16:52:46 UTC
Permalink
Well, I have a design. I am not extremely happy with it, but it is working (ish). The parts count is rather high. Holding down the button for more than a half second or so will cause unexpected results, and one cannot turn the unit off within 2 seconds of tuning it on, but the quiescent current is under 75 microamps, which is acceptable. If anyone has any suggestions for improvement, please speak up. (Note: the sub-circuit on the bottom right allows programmatic shut down, in addition to using the push button)

http://siliconventures.net/images/Flashlight%20Switch%20Update.PNG
Anthony William Sloman
2024-01-30 13:15:04 UTC
Permalink
I want to use an EC1 rotary encoder to control a battery powered device. The EC1 sports a momentary switch, rather than an on / off switch, however, so I need to add a circuit to latch the momentary pulse. Figure 3 on this page should work: http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch.
This is much too late to be useful, but you do need to work exactly what you are trying to. The first thing that worries me is that you don't spell out how long the momentary switch closes the contact.

You then go on to say you want the same momentary switch to turn off the lamp if you press it when the lamp is on.

Life gets a lot simpler if you set up micropower latch to switch between two states - lamp on and lamp off.

It's output can drive the transistor ( the FQP47P06 P-channel power MOSFET). If you have separate logic to treat an output from the momenetary contact as a latch toggling input - directing it to at the Set or Reset inputs to an RS latch - the design can be pretty straightforward.

You can buy a CMOS S/R latch, but even 4000 series CMOS has a maximum voltage rating of 18V.

There's nothing to stop you making up an CMOS S/R latch with higher voltage discrete N- and P-type MOS Fets, as shown here. but you need four of each sort, and parts that can take 25V from gate to source (and I can't think of any).

https://www.tutorialspoint.com/vlsi_design/vlsi_design_sequential_mos_logic_circuits.htm

It isn't going to be as cheap or as simple as what you've tried, but it is designable.
--
Bill Sloman, Sydney
Anthony William Sloman
2024-01-30 23:48:45 UTC
Permalink
Post by Anthony William Sloman
I want to use an EC1 rotary encoder to control a battery powered device. The EC1 sports a momentary switch, rather than an on / off switch, however, so I need to add a circuit to latch the momentary pulse. Figure 3 on this page should work: http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch.
This is much too late to be useful, but you do need to work exactly what you are trying to. The first thing that worries me is that you don't spell out how long the momentary switch closes the contact.
You then go on to say you want the same momentary switch to turn off the lamp if you press it when the lamp is on.
Life gets a lot simpler if you set up micropower latch to switch between two states - lamp on and lamp off.
It's output can drive the transistor ( the FQP47P06 P-channel power MOSFET). If you have separate logic to treat an output from the momenetary contact as a latch toggling input - directing it to at the Set or Reset inputs to an RS latch - the design can be pretty straightforward.
You can buy a CMOS S/R latch, but even 4000 series CMOS has a maximum voltage rating of 18V.
There's nothing to stop you making up an CMOS S/R latch with higher voltage discrete N- and P-type MOS Fets, as shown here. but you need four of each sort, and parts that can take 25V from gate to source (and I can't think of any).
https://www.tutorialspoint.com/vlsi_design/vlsi_design_sequential_mos_logic_circuits.htm
It isn't going to be as cheap or as simple as what you've tried, but it is designable.
It might pay you to put in a second battery to power simple CMOS logic. A 9V lithium iron phosphate battery has a ten year life and 9V is compatible with standard CMOS and high enough to turn on a big MOS-Fet - I'd go for an N-MOS-Fet, They tend to be cheaper if you want to control 10A.
--
Bill Sloman, Sydney
Fred Bloggs
2024-01-31 02:34:25 UTC
Permalink
Post by Anthony William Sloman
Post by Anthony William Sloman
I want to use an EC1 rotary encoder to control a battery powered device. The EC1 sports a momentary switch, rather than an on / off switch, however, so I need to add a circuit to latch the momentary pulse. Figure 3 on this page should work: http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch.
This is much too late to be useful, but you do need to work exactly what you are trying to. The first thing that worries me is that you don't spell out how long the momentary switch closes the contact.
You then go on to say you want the same momentary switch to turn off the lamp if you press it when the lamp is on.
Life gets a lot simpler if you set up micropower latch to switch between two states - lamp on and lamp off.
It's output can drive the transistor ( the FQP47P06 P-channel power MOSFET). If you have separate logic to treat an output from the momenetary contact as a latch toggling input - directing it to at the Set or Reset inputs to an RS latch - the design can be pretty straightforward.
You can buy a CMOS S/R latch, but even 4000 series CMOS has a maximum voltage rating of 18V.
There's nothing to stop you making up an CMOS S/R latch with higher voltage discrete N- and P-type MOS Fets, as shown here. but you need four of each sort, and parts that can take 25V from gate to source (and I can't think of any).
https://www.tutorialspoint.com/vlsi_design/vlsi_design_sequential_mos_logic_circuits.htm
It isn't going to be as cheap or as simple as what you've tried, but it is designable.
It might pay you to put in a second battery to power simple CMOS logic. A 9V lithium iron phosphate battery has a ten year life and 9V is compatible with standard CMOS and high enough to turn on a big MOS-Fet - I'd go for an N-MOS-Fet, They tend to be cheaper if you want to control 10A.
That's just crazy. The circuit in question is Figure 3 here:

http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch

That circuit is a latch as good as any can be done with logic. You have to pay attention to the part specifications though. Figure 3 calls for the IRF7319, a dual P-/N- FET. Datasheet here:

https://www.mouser.com/datasheet/2/196/Infineon_IRF7319_DataSheet_v01_01_EN-3363056.pdf

You can't just blindly pair that up with the 50A behemoth FQP47P06. Datasheet here:

https://www.mouser.com/datasheet/2/149/FQP47P06-1009447.pdf

The FPQ has 10x the gate charge and response time. In the Fig 3 circuit, it means the low power driver has run out of adequate drive by the time the FPQ starts to budge. Circuit then becomes junk.

The IRF7319 is a really excellent design, it's cheap and readily available. It should be rewarded with a purchase preference. So how to make that work? Reconfigure Figure 3 to a low side switch with the N-FET of the -7319 driving the gate of the high-side FPQ pig thru an isolating resistor divider. That would be isolation for all the feedback around the -7319.

As with most FETs, RDS,ON is practically minimum at 10V VGS, so that part needs some finagling, but is more than doable.

Switch cannot be arbitrary. It should have a maximum bounce time of 5ms, to work with that 100ms next state charge capacitor time constant without trouble. A 5% decrease in repetitive state reinforcing gate drive is only slightly less perfect than a bounce-free switch.
Post by Anthony William Sloman
--
Bill Sloman, Sydney
Anthony William Sloman
2024-01-31 05:03:16 UTC
Permalink
Post by ***@gmail.com
Post by Anthony William Sloman
Post by Anthony William Sloman
I want to use an EC1 rotary encoder to control a battery powered device. The EC1 sports a momentary switch, rather than an on / off switch, however, so I need to add a circuit to latch the momentary pulse. Figure 3 on this page should work: http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch.
This is much too late to be useful, but you do need to work exactly what you are trying to. The first thing that worries me is that you don't spell out how long the momentary switch closes the contact.
You then go on to say you want the same momentary switch to turn off the lamp if you press it when the lamp is on.
Life gets a lot simpler if you set up micropower latch to switch between two states - lamp on and lamp off.
It's output can drive the transistor ( the FQP47P06 P-channel power MOSFET). If you have separate logic to treat an output from the momenetary contact as a latch toggling input - directing it to at the Set or Reset inputs to an RS latch - the design can be pretty straightforward.
You can buy a CMOS S/R latch, but even 4000 series CMOS has a maximum voltage rating of 18V.
There's nothing to stop you making up an CMOS S/R latch with higher voltage discrete N- and P-type MOS Fets, as shown here. but you need four of each sort, and parts that can take 25V from gate to source (and I can't think of any).
https://www.tutorialspoint.com/vlsi_design/vlsi_design_sequential_mos_logic_circuits.htm
It isn't going to be as cheap or as simple as what you've tried, but it is designable.
It might pay you to put in a second battery to power simple CMOS logic. A 9V lithium iron phosphate battery has a ten year life and 9V is compatible with standard CMOS and high enough to turn on a big MOS-Fet - I'd go for an N-MOS-Fet, They tend to be cheaper if you want to control 10A.
http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch
That circuit is a latch as good as any can be done with logic.
He hasn't been able to make it work. Using a few more parts that can be configured to behave reliably isn't remotely crazy.
Post by ***@gmail.com
https://www.mouser.com/datasheet/2/196/Infineon_IRF7319_DataSheet_v01_01_EN-3363056.pdf
https://www.mouser.com/datasheet/2/149/FQP47P06-1009447.pdf
The FPQ has 10x the gate charge and response time. In the Fig 3 circuit, it means the low power driver has run out of adequate drive by the time the FPQ starts to budge. Circuit then becomes junk.
So put in an explicit latch and let the latched output drive the power MOS Fet. Keep the slow turnout out if your control loop.
Post by ***@gmail.com
The IRF7319 is a really excellent design, it's cheap and readily available. It should be rewarded with a purchase preference. So how to make that work? Reconfigure Figure 3 to a low side switch with the N-FET of the -7319 driving the gate of the high-side FPQ pig thru an isolating resistor divider. That would be isolation for all the feedback around the -7319.
As with most FETs, RDS,ON is practically minimum at 10V VGS, so that part needs some finagling, but is more than doable.
Switch cannot be arbitrary. It should have a maximum bounce time of 5ms, to work with that 100ms next state charge capacitor time constant without trouble. A 5% decrease in repetitive state reinforcing gate drive is only slightly less perfect than a bounce-free switch.
If you want to use the same momentary switch to turn the lamp on, then later to turn it off again you do need to manage switch bounce. Using regular C/MOS parts does give you lots of options.
--
Bill Sloman, Sydney
Fred Bloggs
2024-01-31 16:05:21 UTC
Permalink
Post by ***@gmail.com
Post by Anthony William Sloman
Post by Anthony William Sloman
I want to use an EC1 rotary encoder to control a battery powered device. The EC1 sports a momentary switch, rather than an on / off switch, however, so I need to add a circuit to latch the momentary pulse. Figure 3 on this page should work: http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch.
This is much too late to be useful, but you do need to work exactly what you are trying to. The first thing that worries me is that you don't spell out how long the momentary switch closes the contact.
You then go on to say you want the same momentary switch to turn off the lamp if you press it when the lamp is on.
Life gets a lot simpler if you set up micropower latch to switch between two states - lamp on and lamp off.
It's output can drive the transistor ( the FQP47P06 P-channel power MOSFET). If you have separate logic to treat an output from the momenetary contact as a latch toggling input - directing it to at the Set or Reset inputs to an RS latch - the design can be pretty straightforward.
You can buy a CMOS S/R latch, but even 4000 series CMOS has a maximum voltage rating of 18V.
There's nothing to stop you making up an CMOS S/R latch with higher voltage discrete N- and P-type MOS Fets, as shown here. but you need four of each sort, and parts that can take 25V from gate to source (and I can't think of any).
https://www.tutorialspoint.com/vlsi_design/vlsi_design_sequential_mos_logic_circuits.htm
It isn't going to be as cheap or as simple as what you've tried, but it is designable.
It might pay you to put in a second battery to power simple CMOS logic. A 9V lithium iron phosphate battery has a ten year life and 9V is compatible with standard CMOS and high enough to turn on a big MOS-Fet - I'd go for an N-MOS-Fet, They tend to be cheaper if you want to control 10A.
http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch
That circuit is a latch as good as any can be done with logic.
He hasn't been able to make it work. Using a few more parts that can be configured to behave reliably isn't remotely crazy.
He couldn't pour piss out of a boot if the directions were written on the heel...
Post by ***@gmail.com
https://www.mouser.com/datasheet/2/196/Infineon_IRF7319_DataSheet_v01_01_EN-3363056.pdf
https://www.mouser.com/datasheet/2/149/FQP47P06-1009447.pdf
The FPQ has 10x the gate charge and response time. In the Fig 3 circuit, it means the low power driver has run out of adequate drive by the time the FPQ starts to budge. Circuit then becomes junk.
So put in an explicit latch and let the latched output drive the power MOS Fet. Keep the slow turnout out if your control loop.
Post by ***@gmail.com
The IRF7319 is a really excellent design, it's cheap and readily available. It should be rewarded with a purchase preference. So how to make that work? Reconfigure Figure 3 to a low side switch with the N-FET of the -7319 driving the gate of the high-side FPQ pig thru an isolating resistor divider. That would be isolation for all the feedback around the -7319.
As with most FETs, RDS,ON is practically minimum at 10V VGS, so that part needs some finagling, but is more than doable.
Switch cannot be arbitrary. It should have a maximum bounce time of 5ms, to work with that 100ms next state charge capacitor time constant without trouble. A 5% decrease in repetitive state reinforcing gate drive is only slightly less perfect than a bounce-free switch.
If you want to use the same momentary switch to turn the lamp on, then later to turn it off again you do need to manage switch bounce. Using regular C/MOS parts does give you lots of options.
--
Bill Sloman, Sydney
Anthony William Sloman
2024-02-01 03:41:01 UTC
Permalink
<snip>
Post by Fred Bloggs
Post by ***@gmail.com
Post by Anthony William Sloman
Post by Anthony William Sloman
https://www.tutorialspoint.com/vlsi_design/vlsi_design_sequential_mos_logic_circuits.htm
It isn't going to be as cheap or as simple as what you've tried, but it is designable.
It might pay you to put in a second battery to power simple CMOS logic. A 9V lithium iron phosphate battery has a ten year life and 9V is compatible with standard CMOS and high enough to turn on a big MOS-Fet - I'd go for an N-MOS-Fet, They tend to be cheaper if you want to control 10A.
http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/electronic-circuits/push-button-switch-turn-on/latching-toggle-power-switch
That circuit is a latch as good as any can be done with logic.
He hasn't been able to make it work. Using a few more parts that can be configured to behave reliably isn't remotely crazy.
He couldn't pour piss out of a boot if the directions were written on the heel...
That isn't an accurate or constructive observation. Brilliant people can get the circuit behavior they want out of very few parts. There aren't many of them.
The rest of us use a few more parts to put together circuits which are easier to understand and explain, so the service engineers can fix them when something breaks
--
Bill Sloman, Sydney
rhor...@gmail.com
2024-02-07 09:04:05 UTC
Permalink
Post by Anthony William Sloman
This is much too late to be useful, but you do need to work exactly what you are trying to. The first thing that worries me is that you don't spell out how long the momentary switch closes the contact.
At first blush, one might be inclined to ask, "How long does a finger press any button?" I think I know what you mean, however. Certainly most people pressing a button won't typically be able to reliably close a momentary switch and keep that contact for less than about 50 ms. It should be obvious that anyone who is not an idiot would experiment with closure times, and I am not an idiot. In the simulator, I emulated button closures as short as 1ms and as long as 10 seconds. The design to which I pointed, modified in order to work with the required voltages, cannot work. There may be some PFET transistors that high enough thresholds to allow them to work with voltages this high, but I know of none. Certainly I do not have any.
Post by Anthony William Sloman
You then go on to say you want the same momentary switch to turn off the lamp if you press it when the lamp is on.
Um, yeah, an On / Off switch is a pretty ubiquitous sort of control. Indeed, almost all implementations of switched rotary encoders employ the integrated switch in that way, the fact the encoders have momentary switches notwithstanding.
Post by Anthony William Sloman
Life gets a lot simpler if you set up micropower latch to switch between two states - lamp on and lamp off.
I am not entirely sure what you mean, here. I could use a separate SPST switch to power up the device, but that would use up more real estate on the back of the device, and real estate is quite limited. Not only that, but two separate controls for light power and intensity is a bit strange.
Post by Anthony William Sloman
It's output can drive the transistor ( the FQP47P06 P-channel power MOSFET). If you have separate logic to treat an output from the momenetary contact as a latch toggling input - directing it to at the Set or Reset inputs to an RS latch - the design can be pretty straightforward.
Yes, but this only works if the logic is energized when the device is shut down, or if the logic can be waked up with the momentary switch. The latter is what I have chosen to design using discrete components.
Post by Anthony William Sloman
You can buy a CMOS S/R latch, but even 4000 series CMOS has a maximum voltage rating of 18V.
Precisely. I might be able to beat the quiescent current draw using a clever power supply scheme and micropower logic, but this design uses less than 65 microamps, and that is pretty good, I think.
Post by Anthony William Sloman
It isn't going to be as cheap or as simple as what you've tried, but it is designable.
The design below seems to work pretty well, at least in the simulator. Do you know of something better / simpler? Do you have any ideas for improvement?

Loading Image...
Anthony William Sloman
2024-02-07 14:22:49 UTC
Permalink
Post by Anthony William Sloman
This is much too late to be useful, but you do need to work exactly what you are trying to. The first thing that worries me is that you don't spell out how long the momentary switch closes the contact.
At first blush, one might be inclined to ask, "How long does a finger press any button?" I think I know what you mean, however. Certainly most people pressing a button won't typically be able to reliably close a momentary switch and keep that contact for less than about 50 ms. It should be obvious that anyone who is not an idiot would experiment with closure times, and I am not an idiot,
Perhaps, but the the point of my question was that there is going to be a minimum "on" time that the circuit won't be able to detect.
What I had in mind
In the simulator, I emulated button closures as short as 1ms and as long as 10 seconds.
But did you allow for contact bounce? Most mechanical switches bounce when they first make contact, as the lump of moving bends as it hits the contact, and bounces off again breaking the contact for a few milliseconds after the first make. Dry reed switches do it, and one of the charms of mercury wetted dry-reed switches is that the mercury kills the bounce.,
The design to which I pointed, modified in order to work with the required voltages, cannot work. There may be some PFET transistors that high enough thresholds to allow them to work with voltages this high, but I know of none. Certainly I do not have any.
Post by Anthony William Sloman
You then go on to say you want the same momentary switch to turn off the lamp if you press it when the lamp is on.
Um, yeah, an On / Off switch is a pretty ubiquitous sort of control. Indeed, almost all implementations of switched rotary encoders employ the integrated switch in that way, the fact the encoders have momentary switches notwithstanding.
But the point was that the switch is quite likely to bounce.
Post by Anthony William Sloman
Life gets a lot simpler if you set up micropower latch to switch between two states - lamp on and lamp off.
I am not entirely sure what you mean, here. I could use a separate SPST switch to power up the device, but that would use up more real estate on the back of the device, and real estate is quite limited. Not only that, but two separate controls for light power and intensity is a bit strange.
It's just one latch, with two states - "lamp off" and "lamp on". Intensity doesn't come into it. The switch then manipulates the state of the latch, and the latch controls the current through the lamp.
Post by Anthony William Sloman
It's output can drive the transistor ( the FQP47P06 P-channel power MOSFET). If you have separate logic to treat an output from the momenetary contact as a latch toggling input - directing it to at the Set or Reset inputs to an RS latch - the design can be pretty straightforward.
Yes, but this only works if the logic is energized when the device is shut down, or if the logic can be waked up with the momentary switch. The latter is what I have chosen to design using discrete components.
The latch can be continously energised. Static CMOS logic draws only it's leakage current which would be less than the self-discharge current of the battery.

Leakage current specification for CMOS are a lot higher than devices actually draw. It takes time to measure a low leakage current, and the manufacturers minimise testing time by picking a current that they can be certain the device meets while not spending too much time on it.
You can buy a CMOS S/R latch, but even 4000 series CMOS has a maximum voltage rating of 18V.
Precisely. I might be able to beat the quiescent current draw using a clever power supply scheme and micropower logic, but this design uses less than 65 microamps, and that is pretty good, I think.
Pity it didn't work.
Post by Anthony William Sloman
It isn't going to be as cheap or as simple as what you've tried, but it is designable.
The design below seems to work pretty well, at least in the simulator. Do you know of something better / simpler? Do you have any ideas for improvement?
http://siliconventures.net/images/Flashlight%20Switch%20Circuit.PNG
It's a mess. If I put it into LTSpice I could form an opinion, but I'm not going to bother. If you did, post the .asc file as a string of text - we do that here regularly - and I will play with it, and probably redraw the circuit in a way that made it more intelligible. Service engineers get snotty if you don't.

The "Arduino" symbol is particularly opaque. The BC846PWD dual transistor is merely drawn in a thoroughly confusing way, Both bases and both emitters are tied together but you have drawn the part in a way that obscures these connections. Stacking the transistors one above the other would let you make this obvious, but you've slavishly copied the symbol from the data sheet and made life much more difficult for the reader than it needed to be.
--
Bill Sloman, Sydney
Fred Bloggs
2024-02-07 18:47:37 UTC
Permalink
Post by Anthony William Sloman
This is much too late to be useful, but you do need to work exactly what you are trying to. The first thing that worries me is that you don't spell out how long the momentary switch closes the contact.
At first blush, one might be inclined to ask, "How long does a finger press any button?" I think I know what you mean, however. Certainly most people pressing a button won't typically be able to reliably close a momentary switch and keep that contact for less than about 50 ms. It should be obvious that anyone who is not an idiot would experiment with closure times, and I am not an idiot,
Perhaps, but the the point of my question was that there is going to be a minimum "on" time that the circuit won't be able to detect.
What I had in mind
In the simulator, I emulated button closures as short as 1ms and as long as 10 seconds.
But did you allow for contact bounce? Most mechanical switches bounce when they first make contact, as the lump of moving bends as it hits the contact, and bounces off again breaking the contact for a few milliseconds after the first make. Dry reed switches do it, and one of the charms of mercury wetted dry-reed switches is that the mercury kills the bounce.,
The design to which I pointed, modified in order to work with the required voltages, cannot work. There may be some PFET transistors that high enough thresholds to allow them to work with voltages this high, but I know of none. Certainly I do not have any.
Post by Anthony William Sloman
You then go on to say you want the same momentary switch to turn off the lamp if you press it when the lamp is on.
Um, yeah, an On / Off switch is a pretty ubiquitous sort of control. Indeed, almost all implementations of switched rotary encoders employ the integrated switch in that way, the fact the encoders have momentary switches notwithstanding.
But the point was that the switch is quite likely to bounce.
Post by Anthony William Sloman
Life gets a lot simpler if you set up micropower latch to switch between two states - lamp on and lamp off.
I am not entirely sure what you mean, here. I could use a separate SPST switch to power up the device, but that would use up more real estate on the back of the device, and real estate is quite limited. Not only that, but two separate controls for light power and intensity is a bit strange.
It's just one latch, with two states - "lamp off" and "lamp on". Intensity doesn't come into it. The switch then manipulates the state of the latch, and the latch controls the current through the lamp.
Post by Anthony William Sloman
It's output can drive the transistor ( the FQP47P06 P-channel power MOSFET). If you have separate logic to treat an output from the momenetary contact as a latch toggling input - directing it to at the Set or Reset inputs to an RS latch - the design can be pretty straightforward.
Yes, but this only works if the logic is energized when the device is shut down, or if the logic can be waked up with the momentary switch. The latter is what I have chosen to design using discrete components.
The latch can be continously energised. Static CMOS logic draws only it's leakage current which would be less than the self-discharge current of the battery.
Leakage current specification for CMOS are a lot higher than devices actually draw. It takes time to measure a low leakage current, and the manufacturers minimise testing time by picking a current that they can be certain the device meets while not spending too much time on it.
You can buy a CMOS S/R latch, but even 4000 series CMOS has a maximum voltage rating of 18V.
Precisely. I might be able to beat the quiescent current draw using a clever power supply scheme and micropower logic, but this design uses less than 65 microamps, and that is pretty good, I think.
Pity it didn't work.
Post by Anthony William Sloman
It isn't going to be as cheap or as simple as what you've tried, but it is designable.
The design below seems to work pretty well, at least in the simulator. Do you know of something better / simpler? Do you have any ideas for improvement?
http://siliconventures.net/images/Flashlight%20Switch%20Circuit.PNG
It's a mess. If I put it into LTSpice I could form an opinion, but I'm not going to bother. If you did, post the .asc file as a string of text - we do that here regularly - and I will play with it, and probably redraw the circuit in a way that made it more intelligible. Service engineers get snotty if you don't.
The "Arduino" symbol is particularly opaque. The BC846PWD dual transistor is merely drawn in a thoroughly confusing way, Both bases and both emitters are tied together but you have drawn the part in a way that obscures these connections. Stacking the transistors one above the other would let you make this obvious, but you've slavishly copied the symbol from the data sheet and made life much more difficult for the reader than it needed to be.
That's not a latch.
--
Bill Sloman, Sydney
Anthony William Sloman
2024-02-08 02:39:41 UTC
Permalink
<snip>
Post by Fred Bloggs
Post by Anthony William Sloman
The "Arduino" symbol is particularly opaque. The BC846PWD dual transistor is merely drawn in a thoroughly confusing way, Both bases and both emitters are tied together but you have drawn the part in a way that obscures these connections. Stacking the transistors one above the other would let you make this obvious, but you've slavishly copied the symbol from the data sheet and made life much more difficult for the reader than it needed to be.
That's not a latch.
Why would you think it was? In fact the two complementary transistors involved steer the current from switch in one two different directions depending on the state of the circuit (which depends on the time since the last switch closure). There may be a latch function embedded in the circuit - as the OP claims - but I'm not interested enough to dig into that mess to try and find it.
--
Bill Sloman, Sydney
Fred Bloggs
2024-02-09 11:58:57 UTC
Permalink
Post by Anthony William Sloman
<snip>
Post by Fred Bloggs
Post by Anthony William Sloman
The "Arduino" symbol is particularly opaque. The BC846PWD dual transistor is merely drawn in a thoroughly confusing way, Both bases and both emitters are tied together but you have drawn the part in a way that obscures these connections. Stacking the transistors one above the other would let you make this obvious, but you've slavishly copied the symbol from the data sheet and made life much more difficult for the reader than it needed to be.
That's not a latch.
Why would you think it was? In fact the two complementary transistors involved steer the current from switch in one two different directions depending on the state of the circuit (which depends on the time since the last switch closure). There may be a latch function embedded in the circuit - as the OP claims - but I'm not interested enough to dig into that mess to try and find it.
Okay, so turning a flashlight on and off is getting beyond you these days.
Post by Anthony William Sloman
--
Bill Sloman, Sydney
Anthony William Sloman
2024-02-09 13:36:17 UTC
Permalink
Post by Fred Bloggs
Post by Anthony William Sloman
<snip>
Post by Fred Bloggs
Post by Anthony William Sloman
The "Arduino" symbol is particularly opaque. The BC846PWD dual transistor is merely drawn in a thoroughly confusing way, Both bases and both emitters are tied together but you have drawn the part in a way that obscures these connections. Stacking the transistors one above the other would let you make this obvious, but you've slavishly copied the symbol from the data sheet and made life much more difficult for the reader than it needed to be.
That's not a latch.
Why would you think it was? In fact the two complementary transistors involved steer the current from switch in one two different directions depending on the state of the circuit (which depends on the time since the last switch closure). There may be a latch function embedded in the circuit - as the OP claims - but I'm not interested enough to dig into that mess to try and find it.
Okay, so turning a flashlight on and off is getting beyond you these days.
Ridiculously complicated scheme for doing it do exist to be simplified. There's not a lot of point in analysing such scheme, and the original poster doesn't seem to be persuaded that he ought to do it. Your claim that the "circuit isn't a latch" wasn't backed up by any kind of analysis.

The circuit diagram he posted was crawling with big capacitors and large resistors, most of which are likely to be unnecessary. It's a hard -to-comprehend mess, and he really should try to do better.

This is exactly the kind of "design" that needs to be ripped up and replaced by something better.

My suggestion was to use the momentary switch to toggle an explicit latch, but the off-shelf parts you'd buy in to do that won't survive a 19V to 25V supply voltage.
--
Bill Sloman, Sydney
Fred Bloggs
2024-02-09 13:41:02 UTC
Permalink
Post by Anthony William Sloman
Post by Fred Bloggs
Post by Anthony William Sloman
<snip>
Post by Fred Bloggs
Post by Anthony William Sloman
The "Arduino" symbol is particularly opaque. The BC846PWD dual transistor is merely drawn in a thoroughly confusing way, Both bases and both emitters are tied together but you have drawn the part in a way that obscures these connections. Stacking the transistors one above the other would let you make this obvious, but you've slavishly copied the symbol from the data sheet and made life much more difficult for the reader than it needed to be.
That's not a latch.
Why would you think it was? In fact the two complementary transistors involved steer the current from switch in one two different directions depending on the state of the circuit (which depends on the time since the last switch closure). There may be a latch function embedded in the circuit - as the OP claims - but I'm not interested enough to dig into that mess to try and find it.
Okay, so turning a flashlight on and off is getting beyond you these days.
Ridiculously complicated scheme for doing it do exist to be simplified. There's not a lot of point in analysing such scheme, and the original poster doesn't seem to be persuaded that he ought to do it. Your claim that the "circuit isn't a latch" wasn't backed up by any kind of analysis.
The circuit diagram he posted was crawling with big capacitors and large resistors, most of which are likely to be unnecessary. It's a hard -to-comprehend mess, and he really should try to do better.
OP sounds a lot like "Ricky".
Post by Anthony William Sloman
This is exactly the kind of "design" that needs to be ripped up and replaced by something better.
My suggestion was to use the momentary switch to toggle an explicit latch, but the off-shelf parts you'd buy in to do that won't survive a 19V to 25V supply voltage.
--
Bill Sloman, Sydney
whit3rd
2024-02-07 18:08:10 UTC
Permalink
Um, yeah, an On / Off switch is a pretty ubiquitous sort of control. Indeed, almost all implementations of switched rotary encoders employ the integrated switch in that way, the fact the encoders have momentary switches notwithstanding.
The design below seems to work pretty well, at least in the simulator. Do you know of something better / simpler? Do you have any ideas for improvement?
http://siliconventures.net/images/Flashlight%20Switch%20Circuit.PNG
Whoa, that's a lot. Couldn't you use something more HV-suitable as a switch, like
an SCR? Two transistors and it has momentary-ON solved, and if you crowbar the
SCR it turns off (yet another momentary switch can do that).
To make a latch-like device, you can do the Eccles-Jordan thing with
two identical transconductors cross-coupled, or the Schmitt trigger with emitter coupling, or
the SCR with one NPN and one PNP.

To momentary switch, the SCR is really quite convenient, uses the load current to keep it
active instead of steady power-supply drain.
Jan Panteltje
2024-02-08 05:15:59 UTC
Permalink
On a sunny day (Wed, 7 Feb 2024 10:08:10 -0800 (PST)) it happened whit3rd
Um, yeah, an On / Off switch is a pretty ubiquitous sort of control. Inde=
ed, almost all implementations of switched rotary encoders employ the integ=
rated switch in that way, the fact the encoders have momentary switches not=
withstanding.
The design below seems to work pretty well, at least in the simulator. Do=
you know of something better / simpler? Do you have any ideas for improvem=
ent?
http://siliconventures.net/images/Flashlight%20Switch%20Circuit.PNG
Whoa, that's a lot. Couldn't you use something more HV-suitable as a swit=
ch, like
an SCR? Two transistors and it has momentary-ON solved, and if you crowba=
r the
SCR it turns off (yet another momentary switch can do that).
To make a latch-like device, you can do the Eccles-Jordan thing with
two identical transconductors cross-coupled, or the Schmitt trigger with em=
itter coupling, or
the SCR with one NPN and one PNP.
To momentary switch, the SCR is really quite convenient, uses the load cur=
rent to keep it
active instead of steady power-supply drain.
I do not have the original post, but for a toggle you could use a CMOS D-flipflop
inverted Q output to the D input, switch with debounce capacitor between ground
to clock input, resistor of a few hundred k to the chip's + that is
powered from the input via a zener and resistor.
The output can then do something like this via for example an opto-coupler
or any other way f course.:
Loading Image...
Or just use a Microchip PIC.
Anthony William Sloman
2024-02-08 07:26:56 UTC
Permalink
<snip>
Post by Jan Panteltje
I do not have the original post, but for a toggle you could use a CMOS D-flipflop
inverted Q output to the D input, switch with debounce capacitor between ground
to clock input, resistor of a few hundred k to the chip's + that is
powered from the input via a zener and resistor.
The output can then do something like this via for example an opto-coupler
https://panteltje.nl/panteltje/cb/tx_power_switch2.jpg
Or just use a Microchip PIC.
The power supply is a 19V to 25V battery and the OP didn't want the control to draw current when the lamp wasn't lit.

CMOS is limited to an 18V maximum rail voltage. I proposed throwing in a 9V lithium iron phosphate cell just to manage the on/off switching, but that didn't go down well.
--
Bill Sloman, Sydney
whit3rd
2024-02-09 20:17:25 UTC
Permalink
Um, yeah, an On / Off switch is a pretty ubiquitous sort of control. Indeed, almost all implementations of switched rotary encoders employ the integrated switch in that way, the fact the encoders have momentary switches notwithstanding.
The design below ...? Do you have any ideas for improvement?
http://siliconventures.net/images/Flashlight%20Switch%20Circuit.PNG
Whoa, that's a lot. Couldn't you use something more HV-suitable as a switch, like
an SCR?
This is the SCR equivalent circuit, that takes high-side switching to put current into the
gate for turn-on of a low-side SCR. Just connect to the PNP base and the same
circuit does high-side turn on in response to a momentary low-side ground connection.

http://electronic-projects.50webs.com/transistor-circuit-substitute-for-scr.htm>
To momentary switch, the SCR is really quite convenient, uses the load current to keep it
active instead of steady power-supply drain.
Alas, while that solves turn-on of HV DC system, it isn't easy to turn off.
Gate turnoff is possible, but traditionally shunned (Sony televisions were notorious
a while because of that).
piglet
2024-02-11 20:59:15 UTC
Permalink
Post by ***@gmail.com
Post by Anthony William Sloman
This is much too late to be useful, but you do need to work exactly what you are trying to. The first thing that worries me is that you don't spell out how long the momentary switch closes the contact.
At first blush, one might be inclined to ask, "How long does a finger press any button?" I think I know what you mean, however. Certainly most people pressing a button won't typically be able to reliably close a momentary switch and keep that contact for less than about 50 ms. It should be obvious that anyone who is not an idiot would experiment with closure times, and I am not an idiot. In the simulator, I emulated button closures as short as 1ms and as long as 10 seconds. The design to which I pointed, modified in order to work with the required voltages, cannot work. There may be some PFET transistors that high enough thresholds to allow them to work with voltages this high, but I know of none. Certainly I do not have any.
Post by Anthony William Sloman
You then go on to say you want the same momentary switch to turn off the lamp if you press it when the lamp is on.
Um, yeah, an On / Off switch is a pretty ubiquitous sort of control. Indeed, almost all implementations of switched rotary encoders employ the integrated switch in that way, the fact the encoders have momentary switches notwithstanding.
Post by Anthony William Sloman
Life gets a lot simpler if you set up micropower latch to switch between two states - lamp on and lamp off.
I am not entirely sure what you mean, here. I could use a separate SPST switch to power up the device, but that would use up more real estate on the back of the device, and real estate is quite limited. Not only that, but two separate controls for light power and intensity is a bit strange.
Post by Anthony William Sloman
It's output can drive the transistor ( the FQP47P06 P-channel power MOSFET). If you have separate logic to treat an output from the momenetary contact as a latch toggling input - directing it to at the Set or Reset inputs to an RS latch - the design can be pretty straightforward.
Yes, but this only works if the logic is energized when the device is shut down, or if the logic can be waked up with the momentary switch. The latter is what I have chosen to design using discrete components.
Post by Anthony William Sloman
You can buy a CMOS S/R latch, but even 4000 series CMOS has a maximum voltage rating of 18V.
Precisely. I might be able to beat the quiescent current draw using a clever power supply scheme and micropower logic, but this design uses less than 65 microamps, and that is pretty good, I think.
Post by Anthony William Sloman
It isn't going to be as cheap or as simple as what you've tried, but it is designable.
The design below seems to work pretty well, at least in the simulator. Do you know of something better / simpler? Do you have any ideas for improvement?
http://siliconventures.net/images/Flashlight%20Switch%20Circuit.PNG
Your X1 complementary NPN/PNP voltage follower has the bases floating
when the button isn't pressed, they could pickup noise.

The button current is very low and may not be enough to make good
contact with time and corrosion, many precious metal contacts have some
minimum operating current.

The zener D4 will almost certainly be horribly leaky at those micro-amp
currents and not work the way you expect.

Here is one way of doing something similar, using a NPN/PNP latch
triggered by a short button press but reset on an extended button press.
The standby current is zero. The button current can be many milliamps to
tolerate dirty or worn contacts. I separated the latch from the PMOS
load switch but you might be able to combine and eliminate the PNP - I
wasn't sure if the load had a lot of capacitance etc.

<Loading Image...

piglet
Loading...