I have been struggling to design this switch for a while and I would appreciate any help.

Problem Background:

I'm designing a power system for a submersible, using the Mini-box OpenUPS battery management PCB. The connection diagram for OpenUPS as well as its link are shown as below:

OpenUPS Connection Diagram

The link: https://www.mini-box.com/OpenUPS

A 14.4V 4S 1800mAh Li-Po Battery will be attached to this board. But before we turning on this PCB, we have no direct access to the battery power. (Yes, I can re-direct the wire from the battery to somewhere else, but that will not be a good ideal for our design) The board can be turned on by shorting the two control pins at J8. The open circuit voltage across these two pins is about 14.4V; when the two pins are shorted, the current flowing through is around 135mA. The physical switch that mounted on the submersible is a High Pressure Waterproof Switch from Blue Robotics. A picture is shown below:

image of switch

When the dial is turned all the way in, the circuit will be closed. For the sake of robustness, the dial is required to be turned all the way in when it is underwater. Before turning this PCB on, all pins except J8 remain at 0V.

Problem Statement:

The functionality for this switch we want will be as following:

Operation on the Switch: Prior putting the submersible underwater, the switch will remain closed first (closed circuit), we will loosen the dial for around 1s (open circuit), and then turn it all the way in (closed circuit).

Desired Response for Circuit: Two pins on J8 are disconnected when dial is turned in, then shorted when dial is loosened.

Attempted Solution: I have tried using a 2N3906 PNP transistor to control the circuit (14.4V power control pin serves as VCC, another pin as ground, then diagram is shown below), the schematic is shown below:


simulate this circuit – Schematic created using CircuitLab

However, I encountered the following problem: Initially, the PCB is off and the switch is open. There's somehow about 50uA \$I_{EC}\$ leakage, and that will not trigger the PCB to turn on. When switch is closed, there's around 134mA \$I_{EC}\$ and PCB is turned on. But when switch is open again, the 50uA \$I_{EC}\$ will remain the two pin shorted, and PCB will not function in this state. I experiment with it a little bit and found that even if there's 1uA, it is enough for these two pins to remain shorted after PCB is triggered.

I'm wondering how I should solve this problem or is there an alternative design for it?

  • 1
    \$\begingroup\$ I am confused. Why doesn't the switch simply short the two pins on the pcb? Why the transistor? \$\endgroup\$ – Math Keeps Me Busy Apr 16 at 1:27
  • \$\begingroup\$ Hello! I mentioned that in the Desired Response for Circuit, our design requires that when switch is open, the two pin is shorted, thus I cannot just simply connect the switch to the two pins \$\endgroup\$ – Maxwell Z. Apr 16 at 8:01
  • \$\begingroup\$ Could you double check the schematic in your question. I don't think it does what you think it does, and it doesn't match the behavior you described. Also, I have not been able to find a datasheet for the OpenUPS. do you know the minimum current across J8 that will turn on the PCB? Alterrnatively, the lowest resistance across J8 that will NOT turn on the PCB? (You could try large values, and work down until it turns on). \$\endgroup\$ – Math Keeps Me Busy Apr 16 at 13:41
  • \$\begingroup\$ Hi you might want to note that J8 expects to receive a momentary closure (and timeouts that can be adjusted in the OpenUPS's firmware, via their program and the miniUSB port). An on/off switch connected across here is not what you want. \$\endgroup\$ – Daniel Chisholm Apr 16 at 13:58
  • \$\begingroup\$ @MathKeepsMeBusy Hi, I'm really sorry, I messed up the position of the switch... Just corrected in the schematic. You can find a hardware manual under the download section in the link I posted. You have to open 'Hardware Manual' tab in a new window to start downloading. As for the minimum current, I have not tested yet, I'll post it once I measure it! Thank you so much for your response! \$\endgroup\$ – Maxwell Z. Apr 16 at 19:07

You have done a good job at defining the task, but not the interface logic levels and outputs. Please update your specs

  • for more test results in case something is damaged on your interface measure Iin, as Vin is varied from 14.2 to 0V with a variable current limited supply to get a better handle on the problem performed with a triangle ramp in << 5 seconds. Use a transistor to control the current. (Since the user manual is vague) Also, confirm the pressure switch does not leak uA.

  • 50uA if fails for Return to High seems too sensitive and 143 mA seems too high for a logic low Start switch.

From the OPN-USB Manual for J8 p5/12

Starting and Stopping with battery power….

If everything correctly configured pressing shortly the J8 button will turn on the output,
and your UPS will be started, energy will be flowing from the battery to the output.

Long pressing (5 sec) J8 button will initiate shut down of the UPS. A pulse is sent 
to the motherboard than the UPS waits a predetermined UPS_HARDOFF_TOUT (60s by
default) before the output voltage is turned off.

i.e. Start is ---_ ---- and Stop is ----______------- , where --- = open switch and ___ is closed switch yet pressure sense is normally open with dial in-tight and switch closes to 0V to exceed long duration >5s to Stop OpenUSB power.

Your problem is commonly defined in datasheets as\$I_{CBO}\$ which is the collector-base cutoff current at rated Vce max voltage with Ie=0.

This is due to the “Early Effect” as a reverse diode leakage across the CB junction which has a load line dependent on Vce.

Although the 2N3906 is rated at 50uA it is only rated at Vce=-40V so choosing a higher voltage say >100 V , you will find components with lower max Icbo leakage , which also rises above 25’C much lower.

For example if it says 250nA at -300V, this is equivalent to >1GOhm but again will rise in temp and this may be nominal. This also makes it sensitive to stray EMI during this state with electromagnetic noise coupling so shielded twisted pair may be needed if there is any EMI nearby during this state.

You can lower the input impedance by using a Common Base mode driving the emitter as a switch with some bias R divider on the base from 12V to Gnd such that using hFE = 10% of linear hFE max would get reasonable Vce(sat) to drive 125mA with the switch.

This should solve the leakage problem.


I suspect your actual circuit looks more like below with ground switched power activation but unfortunately with 50uA (rated? or measured?) leakage to ground somewhere.

The 2N3906 is one such path.

enter image description here

Not a solution, just maybe an answer to define the problem.

  • 1
    \$\begingroup\$ Tony, look at the circuit. It doesn't do what the OP is hoping it would do. \$\endgroup\$ – Math Keeps Me Busy Apr 16 at 13:14
  • \$\begingroup\$ Which part did I not understand? @MathKeepsMeBusy \$\endgroup\$ – Tony Stewart EE75 Apr 16 at 15:24
  • \$\begingroup\$ Does the circuit act like a closed switch when the physical switch is open and vice-versa? \$\endgroup\$ – Math Keeps Me Busy Apr 16 at 15:28
  • \$\begingroup\$ It's a Start/Stop duration short/long both low. so I think they are using it properly. @MathKeepsMeBusy \$\endgroup\$ – Tony Stewart EE75 Apr 16 at 16:20
  • \$\begingroup\$ It's a negative logic dial so in tight is open circuit (14.2 pullup) and loose dial or tight overpressure is closed switch. Seems OK., @MathKeepsMeBusy \$\endgroup\$ – Tony Stewart EE75 Apr 16 at 16:37

Well, there is always a way to invert a switch without too much issues. One way would be for you is to use a ZVNL120A in the circuit below:


simulate this circuit – Schematic created using CircuitLab

It doesn't seem much. But here is an example of the circuit with an led, when lit it would be the equivalent to a switch closed across your 14V logic,When not lit, the equivalent switch across the 14V logic would be open.

  • \$\begingroup\$ Hey, thank you so much for your help, I will try to use a FET instead of a BJT to see if it works! \$\endgroup\$ – Maxwell Z. Apr 20 at 23:28
  • \$\begingroup\$ BJT or Transistors require a bias. FETs or MOSFETs don't need a bias to operate. \$\endgroup\$ – David Mikeska Apr 21 at 15:09

The following circuit may work for you.

It relies two assumptions.

  1. at least one of the pins in J8 is always above 3V.
  2. You can access the board's ground and wire it to this circuit.

If these assumptions are not met, then you will not be able to use this circuit.


simulate this circuit – Schematic created using CircuitLab

How it works.

We are assuming that at least one of the input lines IN1 or IN2 is always above 3V.

Diodes D1 and D2 select the higher input voltage and use it as the power rail for an inverter consisting of M3 and M4.

R1 and SW1 provide the input for the inverter.

Resistors R2 and R3 limit shoot-through current when the inverter is transitioning from one state to another.

The output of the inverter drives the gates of M1 and M2 which comprise an analog switch.

When SW1 is closed, the gates of M3 and M4 are at ground. M3 will conduct, and M4 will be off. The gates of M1 and M2 will be one Schottky diode drop below the higher input voltage, and so they will be off.

When SW1 is open, the gates of M3 and M4 are high. M3 will be off, but M4 will conduct. The drains of M3 and M4 will be near ground, and so will the gates of M1 and M2. M1 and M2 will be on.

  • Note: all MOSFETs should be logic level.
  • Note: M4 is an N-channel MOSFET! (all the others are P-channel)

There will be some leakage current through R1 when SW1 is closed. If the value of R1 is too low, the circuit connected to IN1 and IN2 may give false results. If the value is too high, the circuit may be sluggish. I chose a value of 1M\$\Omega\$ because it seemed to be a good compromise, but it may need to be tweaked.

Edit: Added resistors to limit shoot-through current in inverter when inverter is transitioning between states.

  • \$\begingroup\$ Hey, thank you so much for your response. It seems that one of the J8 pin is power control which has a voltage of 14.4V (let's call it pin1), and another pin (lets call it pin2) seems to be connected to the board GND, it was measured to be 0V across the GND. Between pin2 and ground, there's a 100K ohm resistance and about 134nF capacitance. If I connect the pin 1 to GND, the board seems to enter the same initiation phase where LED lights up same as when I short pin 1 and pin 2, but not matter how long I short pin 1 to GND, the board will neither turn on nor enter the deep sleep mode \$\endgroup\$ – Maxwell Z. Apr 20 at 23:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.