Low Power High Voltage Flip Flop

149 views
Skip to first unread message

rhor...@gmail.com

unread,
Jan 30, 2023, 4:16:01 AMJan 30
to
I have a situation where I need to change a momentary switch to an on / off switch. This is ordinarily very easy using a JK Flip Flop, but there is a twist. The device runs on a 6S Lithium battery, so the voltage will vary from about 18V to 25V or so. In addition, I need the power control circuit to use very little current - on the order of 100 uA - when off. It can use much more power when on - 20 mA or so is no problem.

Anthony William Sloman

unread,
Jan 30, 2023, 4:43:30 AMJan 30
to
On Monday, January 30, 2023 at 8:16:01 PM UTC+11, rhor...@gmail.com wrote:
> I have a situation where I need to change a momentary switch to an on / off switch. This is ordinarily very easy using a JK Flip Flop, but there is a twist. The device runs on a 6S Lithium battery, so the voltage will vary from about 18V to 25V or so. In addition, I need the power control circuit to use very little current - on the order of 100 uA - when off. It can use much more power when on - 20 mA or so is no problem.

You should be able to build a J/K flip-flop with discrete transistors - there are N-channel and P-channel MOSFETs that can take that kind of voltage.

The gate-oxide isn't that robust, so you might need level shifters to make the logic work. It won't have to be that fast, so the level shifters won't need a lot of current.

Classic CMOS is good for logic rails up to about 18V, but if there a 25V version I haven't heard of it.

--
Bill Sloman, Sydney

Tauno Voipio

unread,
Jan 30, 2023, 6:14:41 AMJan 30
to
On 30.1.2023 11.15, rhor...@gmail.com wrote:
> I have a situation where I need to change a momentary switch to an on / off switch. This is ordinarily very easy using a JK Flip Flop, but there is a twist. The device runs on a 6S Lithium battery, so the voltage will vary from about 18V to 25V or so. In addition, I need the power control circuit to use very little current - on the order of 100 uA - when off. It can use much more power when on - 20 mA or so is no problem.

You may need to build a debounce circuit for the switch, else
the response may be erratic, as the F/F will count the parity
of the contact bounces.

--

-TV

Fred Bloggs

unread,
Jan 30, 2023, 6:51:07 AMJan 30
to
On Monday, January 30, 2023 at 4:16:01 AM UTC-5, rhor...@gmail.com wrote:
> I have a situation where I need to change a momentary switch to an on / off switch. This is ordinarily very easy using a JK Flip Flop, but there is a twist. The device runs on a 6S Lithium battery, so the voltage will vary from about 18V to 25V or so. In addition, I need the power control circuit to use very little current - on the order of 100 uA - when off. It can use much more power when on - 20 mA or so is no problem.

You may think you need that, but actually you don't. You can most likely replace your existing switch with one of the exact same form factor that serves the on/off function. It will be called a "latching" on/ off switch.

Ricky

unread,
Jan 30, 2023, 8:15:05 AMJan 30
to
On Monday, January 30, 2023 at 5:16:01 AM UTC-4, rhor...@gmail.com wrote:
> I have a situation where I need to change a momentary switch to an on / off switch. This is ordinarily very easy using a JK Flip Flop, but there is a twist. The device runs on a 6S Lithium battery, so the voltage will vary from about 18V to 25V or so. In addition, I need the power control circuit to use very little current - on the order of 100 uA - when off. It can use much more power when on - 20 mA or so is no problem.

There are a number of simple circuits using a pair of transistors, which will do what you need. They take advantage of charge being stored on a capacitor to change the state of the circuit with the same push button. A Google search turned up a number of possibilities. The FET based designs can be very low power when off, however, you will need to find FETs with gate to source voltage ratings to match your power source. I would look for at least 30V.

https://www.google.com/search?client=firefox-b-1-d&q=push+button+on/off+circuit

Here's a page with FET devices. The link is long, so you may need to patch it up from this post.

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

Figure 3 has the basic circuit. Other variations add different features. Figure 9 works with higher power source voltages. If you don't have a low voltage regulator, you can use resistors to step down the output voltage.

--

Rick C.

- Get 1,000 miles of free Supercharging
- Tesla referral code - https://ts.la/richard11209

bitrex

unread,
Jan 30, 2023, 10:08:37 AMJan 30
to
On 1/30/2023 4:15 AM, rhor...@gmail.com wrote:
> I have a situation where I need to change a momentary switch to an on / off switch. This is ordinarily very easy using a JK Flip Flop, but there is a twist. The device runs on a 6S Lithium battery, so the voltage will vary from about 18V to 25V or so. In addition, I need the power control circuit to use very little current - on the order of 100 uA - when off. It can use much more power when on - 20 mA or so is no problem.


Is a latching relay too simple a solution:

<https://www.electronicdesign.com/technologies/analog/article/21806385/relaybased-onoff-flipflop-remembers-state-during-power-failure>

John Larkin

unread,
Jan 30, 2023, 10:27:39 AMJan 30
to
On Mon, 30 Jan 2023 01:15:57 -0800 (PST), "rhor...@gmail.com"
<rhor...@gmail.com> wrote:

>I have a situation where I need to change a momentary switch to an on / off switch. This is ordinarily very easy using a JK Flip Flop, but there is a twist. The device runs on a 6S Lithium battery, so the voltage will vary from about 18V to 25V or so. In addition, I need the power control circuit to use very little current - on the order of 100 uA - when off. It can use much more power when on - 20 mA or so is no problem.

You may not want to use this

https://www.dropbox.com/s/okjq1x7q0ftbfig/Momentary_Nfet.jpg?raw=1


but it's a fun circuit.

A version with two fets would stay on/off forever.

rhor...@gmail.com

unread,
Jan 30, 2023, 11:43:59 PMJan 30
to
On Monday, January 30, 2023 at 3:43:30 AM UTC-6, bill.... wrote:
Yeah, that is my notion. I need some details.

rhor...@gmail.com

unread,
Jan 30, 2023, 11:52:31 PMJan 30
to
On Monday, January 30, 2023 at 5:51:07 AM UTC-6, Fred Bloggs wrote:
> On Monday, January 30, 2023 at 4:16:01 AM UTC-5, rhor... wrote:
> > I have a situation where I need to change a momentary switch to an on / off switch. This is ordinarily very easy using a JK Flip Flop, but there is a twist. The device runs on a 6S Lithium battery, so the voltage will vary from about 18V to 25V or so. In addition, I need the power control circuit to use very little current - on the order of 100 uA - when off. It can use much more power when on - 20 mA or so is no problem.
> You may think you need that, but actually you don't. You can most likely replace your existing switch with one of the exact same form factor that serves the on/off function. It will be called a "latching" on/ off switch.
I guess I failed to mention it is not a simple switch. It is a rotary encoder with a momentary push button. If there is a rotary encoder of roughly the same size (~ 25mm with a ~6mm shaft) with an on/off switch rather than a momentary switch, I would love to use it. The design uses an EC11 rotary encoder.

Ricky

unread,
Jan 30, 2023, 11:59:57 PMJan 30
to
What is your notion? 4000 series CMOS won't handle the battery voltages you are talking about. You would need to add two transistors and a voltage regulator to make a 4000 series part compatible with high side switching your 25V power rail. You can do the same job with just the two transistors, no regulator and no 4000 series CMOS. I provided links to some sample circuits.

Maybe you could provide a bit more feedback of what you see here that you like and don't like, and why? Feedback would help a lot.

--

Rick C.

+ Get 1,000 miles of free Supercharging
+ Tesla referral code - https://ts.la/richard11209

rhor...@gmail.com

unread,
Jan 31, 2023, 2:16:22 AMJan 31
to
On Monday, January 30, 2023 at 7:15:05 AM UTC-6, Ricky wrote:
That is EXACTLY what I need. Thanks! My circuit already uses a FQP47P06 MOSFET to switch the power. All I need to do is add one resistor, one FET, one resistor, and one capacitor. Perfect. Indeed, it is better than perfect. The device is controlled by an Arduino. With this I can monitor the battery voltage and shut down the system when the batter gets dangerously low. I knew there had to be a simple answer.

rhor...@gmail.com

unread,
Jan 31, 2023, 2:31:44 AMJan 31
to
On Monday, January 30, 2023 at 9:08:37 AM UTC-6, bitrex wrote:
No, but my dislike for mechanical relays aside, the current carrying capacity of any mechanical relays small enough to fit in the space I have is probably too small. This needs to handle several amperes peak. They are also rather expensive. I would much rather have a solid state solution. Ricky's solution is simple, elegant, and very inexpensive. It only requires the addition of three 3mm long elements costing less than $0.30, total, to my existing design. The fact they are surface mount doesn't hurt, either. This is about as elegant as it gets.

rhor...@gmail.com

unread,
Jan 31, 2023, 3:56:30 AMJan 31
to
On Monday, January 30, 2023 at 10:59:57 PM UTC-6, Ricky wrote:
No, your idea (figure 3) is perfect. Adding in control from the (existing) Arduino gives me:

http://siliconventures.net/images/Flashlight%20Switch.PNG

I don't know if there is a better solution than the opto-coupler, but it is definitely a quick and easy solution to interface with the Arduino.

John Walliker

unread,
Jan 31, 2023, 5:46:30 AMJan 31
to
Won't the phototransistor get unhappy with reverse bias? A better optocoupler would
use a symmetric photofet. Something like the H11F1 would work, but there are others.

John

Ricky

unread,
Jan 31, 2023, 2:35:31 PMJan 31
to
If isolation is not required, and a common ground is used, there are analog switches which should handle 25V. But I would not say an opto is overkill. At least a transistor short won't fry the Arduino.

--

Rick C.

-+ Get 1,000 miles of free Supercharging
-+ Tesla referral code - https://ts.la/richard11209

whit3rd

unread,
Feb 1, 2023, 12:19:09 AMFeb 1
to
On Tuesday, January 31, 2023 at 2:46:30 AM UTC-8, John Walliker wrote:
> On Tuesday, 31 January 2023 at 08:56:30 UTC, rhor...@gmail.com wrote:
> > On Monday, January 30, 2023 at 10:59:57 PM UTC-6, Ricky wrote:
> > > On Tuesday, January 31, 2023 at 12:43:59 AM UTC-4, rhor... wrote:
> > > > On Monday, January 30, 2023 at 3:43:30 AM UTC-6, bill.... wrote:
> > > > > On Monday, January 30, 2023 at 8:16:01 PM UTC+11, rhor.. wrote:
> > > > > > I have a situation where I need to change a momentary switch to an on / off switch. This is ordinarily very easy using a JK Flip Flop, but there is a twist. The device runs on a 6S Lithium battery, so the voltage will vary from about 18V to 25V or so. In addition, I need the power control circuit to use very little current - on the order of 100 uA - when off. It can use much more power when on - 20 mA or so is no problem.
> > > > > You should be able to build a J/K flip-flop with discrete transistors - there are N-channel and P-channel MOSFETs that can take that kind of voltage.
> > > > >

> > ...(figure 3) is perfect. Adding in control from the (existing) Arduino gives me:
> >
> > http://siliconventures.net/images/Flashlight%20Switch.PNG
> >
> > I don't know if there is a better solution than the opto-coupler, but it is definitely a quick and easy solution to interface with the Arduino.

> Won't the phototransistor get unhappy with reverse bias?

I'm not seeing any way C1 can pull down the phototransistor emitter; the DC bias doesn't work with
the connections as shown.

Ricky

unread,
Feb 1, 2023, 2:29:28 AMFeb 1
to
I don't follow. The only thing the phototransistor can do is pull down the gate of X2 when activated. That will let the Arduino turn off the power source. Because the phototransistor is bipolar, it won't be able to pull up on the X2 gate to turn on the power source. I'm not sure how C1 limits anything. It provides the current to drive the X2 gate (over driving R3 for a moment) until the circuit can switch. It also debounces the push button.

--

Rick C.

+- Get 1,000 miles of free Supercharging
+- Tesla referral code - https://ts.la/richard11209

whit3rd

unread,
Feb 1, 2023, 3:45:13 AMFeb 1
to
If the C1 capacitor starts at 25V bias, when does it ever drop to lower voltage? How much
lower? Do you expect to pull down that emitter on the optoisolator through the load, with reverse-breakdown
of the base-emitter?

Ricky

unread,
Feb 1, 2023, 9:05:38 AMFeb 1
to
When the power controller is off, the cap is charged to the incoming voltage. When the controller is on, the gate of X1 is pulled low by X2 and the cap is discharged to ground through X2.

This is essentially the same circuit as one made with a pair of inverters in a loop, forming a bistable device. One inverter charges a cap, and the switch loops that back to that inverter's input, forcing the inverter to change state. Then the circuit is stable in the other state. No matter which state the circuit is in, the switch forces it to the opposite state, because it "transports" the state from the output of one inverter to the input of the same inverter.

I think you are looking at R1 as if it controls the voltage on the battery. X2 controls that voltage. Keep in mind that X1, X2 and R3 form a bistable element.

--

Rick C.

++ Get 1,000 miles of free Supercharging
++ Tesla referral code - https://ts.la/richard11209

Piglet

unread,
Feb 1, 2023, 9:43:19 AMFeb 1
to
On 31/01/2023 08:56, rhor...@gmail.com wrote:
> No, your idea (figure 3) is perfect. Adding in control from the (existing) Arduino gives me:
>
> http://siliconventures.net/images/Flashlight%20Switch.PNG
>
> I don't know if there is a better solution than the opto-coupler, but it is definitely a quick and easy solution to interface with the Arduino.

Those polarities look wrong?

The opto coupler transistor will reverse zener so circuit will always
switch on when supply is above circa 8-9V. One solution might be to add
a diode in series with either emitter or collector. If the intention is
for arduino to only switch off and only manual switch on allowed then
you could return the opto coupler emitter to ground instead. If so and
the arduino 0V is same as switch ground then you could even substitute
the opto with an NPN or Nch mosfet.

piglet

whit3rd

unread,
Feb 1, 2023, 10:18:36 AMFeb 1
to
On Wednesday, February 1, 2023 at 6:05:38 AM UTC-8, Ricky wrote:
> On Wednesday, February 1, 2023 at 4:45:13 AM UTC-4, whit3rd wrote:
> > On Tuesday, January 31, 2023 at 11:29:28 PM UTC-8, Ricky wrote:
> > > On Wednesday, February 1, 2023 at 1:19:09 AM UTC-4, whit3rd wrote:
> > > > On Tuesday, January 31, 2023 at 2:46:30 AM UTC-8, John Walliker wrote:
> >
> > > > > > http://siliconventures.net/images/Flashlight%20Switch.PNG
> > > > > >
> > > > > > I don't know if there is a better solution than the opto-coupler, but it is definitely a quick and easy solution to interface with the Arduino.
> > > >
> > > > > Won't the phototransistor get unhappy with reverse bias?
> > > > I'm not seeing any way C1 can pull down the phototransistor emitter; the DC bias doesn't work with
> > > > the connections as shown.
> > > I don't follow. The only thing the phototransistor can do is pull down the gate of X2 when activated. That will let the Arduino turn off the power source. Because the phototransistor is bipolar, it won't be able to pull up on the X2 gate to turn on the power source. I'm not sure how C1 limits anything. It provides the current to drive the X2 gate (over driving R3 for a moment) until the circuit can switch. It also debounces the push button.
> > If the C1 capacitor starts at 25V bias, when does it ever drop to lower voltage? How much
> > lower? Do you expect to pull down that emitter on the optoisolator through the load, with reverse-breakdown
> > of the base-emitter?
> When the power controller is off, the cap is charged to the incoming voltage. When the controller is on, the gate of X1 is pulled low by X2 and the cap is discharged to ground through X2.
>
> This is essentially the same circuit as one made with a pair of inverters in a loop, forming a bistable device.

AHA, I see it now. I was thinking this was a flip-flop of the usual type, two PMOS or two NMOS,
rather than one of each. I didn't see all the arrows.

Clive Arthur

unread,
Feb 1, 2023, 11:05:32 AMFeb 1
to
On 30/01/2023 09:15, rhor...@gmail.com wrote:
> I have a situation where I need to change a momentary switch to an on / off switch. This is ordinarily very easy using a JK Flip Flop, but there is a twist. The device runs on a 6S Lithium battery, so the voltage will vary from about 18V to 25V or so. In addition, I need the power control circuit to use very little current - on the order of 100 uA - when off. It can use much more power when on - 20 mA or so is no problem.

Maybe you can change your requirement. For example, instead of a
toggle, use a momentary push for on and a long push for off. That might
be easier and might lend itself more readily to an op-amp circuit.

--
Cheers
Clive

rhor...@gmail.com

unread,
Feb 2, 2023, 2:58:47 AMFeb 2
to
On Tuesday, January 31, 2023 at 1:35:31 PM UTC-6, Ricky wrote:
> On Tuesday, January 31, 2023 at 6:46:30 AM UTC-4, John Walliker wrote:
Yeah, exactly. "Not that the Arduino is exactly expensive, but the relay is cheap insurance. The ground is common, but the supply rail is not, of course. The opto-coupler also insures no part of the circuit draws any current when the switch is off. According to circuit analysis, the current leakage should be under 2uA. That way exceeds the design parms. I love it!

Ricky

unread,
Feb 2, 2023, 3:21:13 AMFeb 2
to
So your intent is that the Arduino only turns the circuit off? I don't think the opto as drawn can turn it on.

--

Rick C.

--- Get 1,000 miles of free Supercharging
--- Tesla referral code - https://ts.la/richard11209

rhor...@gmail.com

unread,
Feb 2, 2023, 3:33:55 AMFeb 2
to
On Wednesday, February 1, 2023 at 8:43:19 AM UTC-6, erichp... wrote:
That is a good point. Of course by design intent the Arduino won't be able to turn the circuit on; it won't be active. Maybe an FET output opto-isolator?

rhor...@gmail.com

unread,
Feb 2, 2023, 3:40:23 AMFeb 2
to
On Thursday, February 2, 2023 at 2:21:13 AM UTC-6, Ricky wrote:
Correct. No matter how the circuit gets drawn, the Arduino will be dead when power is off, so it can't turn on the device in any case. It doesn't matter, however. The only control I want the Arduino to have is the ability to shut down to protect the battery from over-discharge. The person holding the unit will turn it on and off, except when the battery is low.

Ricky

unread,
Feb 2, 2023, 11:45:05 AMFeb 2
to
You never said the Arduino is powered by this power source. If so, the Arduino doesn't need isolation. A simple transistor can ground the gate of X2, turning it, and the entire power unit off. Optoisolators are more expensive than transistors, buy a good margin... not to mention smaller.

--

Rick C.

--+ Get 1,000 miles of free Supercharging
--+ Tesla referral code - https://ts.la/richard11209
Message has been deleted

rhor...@gmail.com

unread,
Feb 3, 2023, 3:47:40 AMFeb 3
to
On Thursday, February 2, 2023 at 10:45:05 AM UTC-6, Ricky wrote:
Yeah, I guess that's right. I'm not sure why I didn't think of it. I suppose I was stuck on the idea of shorting the switch, but of course that is only required for turning the power both on and off. So there is a better solution. I already sent the design out for printing, but I will update V2 with a BCX70K. I can get them for less than $0.02.
Reply all
Reply to author
Forward
0 new messages