Reply by rhor...@gmail.com February 3, 20232023-02-03
On Thursday, February 2, 2023 at 10:45:05 AM UTC-6, Ricky wrote:
> On Thursday, February 2, 2023 at 3:40:23 AM UTC-5, rhor... wrote: > > On Thursday, February 2, 2023 at 2:21:13 AM UTC-6, Ricky wrote: > > > On Thursday, February 2, 2023 at 2:58:47 AM UTC-5, rhor... wrote: > > > > 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: > > > > > > On Tuesday, 31 January 2023 at 08:56:30 UTC, rhor... 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. > > > > > > > > > > > > > > > > > > > > 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 > > > > > > > > > Yeah, that is my notion. I need some details. > > > > > > > > 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 > > > > > > > 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. > > > > > > 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. > > > > > 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 > > > > 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! > > > 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 > > 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. > 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
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 by rhor...@gmail.com February 3, 20232023-02-03
On Thursday, February 2, 2023 at 10:45:05 AM UTC-6, Ricky wrote:
> On Thursday, February 2, 2023 at 3:40:23 AM UTC-5, rhor... wrote: > > On Thursday, February 2, 2023 at 2:21:13 AM UTC-6, Ricky wrote: > > > On Thursday, February 2, 2023 at 2:58:47 AM UTC-5, rhor... wrote: > > > > 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: > > > > > > On Tuesday, 31 January 2023 at 08:56:30 UTC, rhor... 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. > > > > > > > > > > > > > > > > > > > > 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 > > > > > > > > > Yeah, that is my notion. I need some details. > > > > > > > > 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 > > > > > > > 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. > > > > > > 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. > > > > > 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 > > > > 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! > > > 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 > > 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. > 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
Well, the issue is the potential on both sides of switch 1 is much higher than the Arduino can handle if exposed directly, and even with the base or drain isolated by a resistor, a transistor is either always going to be on or else can never be turned on. Two complementary transistors could do it, but the opto-isolator is a bit more elegant. An H11F1M should do nicely, and I just happen to have a ton of them on hand.
Reply by Ricky February 2, 20232023-02-02
On Thursday, February 2, 2023 at 3:40:23 AM UTC-5, rhor...@gmail.com wrote:
> On Thursday, February 2, 2023 at 2:21:13 AM UTC-6, Ricky wrote: > > On Thursday, February 2, 2023 at 2:58:47 AM UTC-5, rhor... wrote: > > > 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: > > > > > On Tuesday, 31 January 2023 at 08:56:30 UTC, rhor... 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. > > > > > > > > > > > > > > > > > > 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 > > > > > > > > Yeah, that is my notion. I need some details. > > > > > > > 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 > > > > > > 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. > > > > > 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. > > > > 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 > > > 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! > > 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 > 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.
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
Reply by rhor...@gmail.com February 2, 20232023-02-02
On Thursday, February 2, 2023 at 2:21:13 AM UTC-6, Ricky wrote:
> On Thursday, February 2, 2023 at 2:58:47 AM UTC-5, rhor... wrote: > > 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: > > > > On Tuesday, 31 January 2023 at 08:56:30 UTC, rhor... 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. > > > > > > > > > > > > > > > > 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 > > > > > > > Yeah, that is my notion. I need some details. > > > > > > 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 > > > > > 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. > > > > 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. > > > 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 > > 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! > 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
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.
Reply by rhor...@gmail.com February 2, 20232023-02-02
On Wednesday, February 1, 2023 at 8:43:19 AM UTC-6, erichp... wrote:
> On 31/01/2023 08:56, rhor... 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
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?
Reply by Ricky February 2, 20232023-02-02
On Thursday, February 2, 2023 at 2:58:47 AM UTC-5, rhor...@gmail.com wrote:
> 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: > > > On Tuesday, 31 January 2023 at 08:56:30 UTC, rhor... 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. > > > > > > > > > > > > > > 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 > > > > > > Yeah, that is my notion. I need some details. > > > > > 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 > > > > 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. > > > 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. > > 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 > 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!
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
Reply by rhor...@gmail.com February 2, 20232023-02-02
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: > > On Tuesday, 31 January 2023 at 08:56:30 UTC, rhor... 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. > > > > > > > > > > > > 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 > > > > > Yeah, that is my notion. I need some details. > > > > 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 > > > 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. > > 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. > 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
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!
Reply by Clive Arthur February 1, 20232023-02-01
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
Reply by whit3rd February 1, 20232023-02-01
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.
Reply by Piglet February 1, 20232023-02-01
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