# Where do I place the on/off switch in a multi voltage circuit?

I've got a simple Arduino setup where I need to supply a 3.3V Arduino with adequate power - and at the same time provide higher voltage to a sensor which needs 5V.

The Arduino is powered by bypassing the regulator (via VCC, not RAW pin). Connecting it to 3 of 4 batteries thus provides it with a range of roughly 4.5V - 2.7V over the life of the batteries. (Tolerance for ATMega 328P is 1.8V to 5.5V)

The Sensor needs a minimum of ~4.5Volts (up to 12V and more) and I solve this by adding another battery, adding voltage up to 6V (3.6V when batteries are empty, so it will start to behave erratic earlier).

Where do I place the switch in such a multiple batteries, multi voltages circuit?

Having it on the VCC/positive lines would mean I need a switch that cuts/connects two lines at once, a Double Pole Single Throw (DPST) switch.

Having a switch on the GND/negative line would break the circuit, but I've read that connecting VCC first (which this would effectively do) is bad practice and might damage components (which it seems it doesn't in my case, I tried it, but still..). Also would it drain batteries somehow?

for now, do not suggest changing the circuit altogether, for example with a step-up converter for the sensor. I need to keep voltage fluctuation down in its circuit (I think), in a simple way. I left out radio in the schematic above. TX would cause a drop in voltage and disturb the sensor. Also, running the Arduino at 5V with a step-up for the whole circuit seems to be no option. The added battery for the sensor equalizes voltage and/or noise (?) in the circuit, it simply works (at least from my novice point of view) and one monolithic power source didn't, in my tests. Something from the step up disturbed the sensor as well and my trial and error experiments with capacitors didn't solve it. Also, more back and forth: having the Arduino behind a regulator means I can't measure battery without external voltage divider.

Just a little side-question:

I've measured that the 3 batteries drain a little faster than the one "sensor-battery". Means: the added single battery would always have voltage above the pack of three. Is this a safe circuit? Or will there be something like inverse voltage at some point? Or will my batteries melt when they start to get more disparate/unbalanced?

• It's considered poor practice to wire up cells in series but then tap different loads into the middle of the battery pack, for reasons you have already realized in your last paragraph. If you insist on adhering to poor practices, you are going to run into these problems with little recourse. Mar 20, 2019 at 19:32
• Don't do this. Use an LM1117 to regulate your 5V down to 3.3V--or use a switching regulator if you're concerned about efficiency. Mar 20, 2019 at 19:58
• The LM1117 (any LDO really) would be better for noise relative to a switching regulator. Simpler and cheaper too. Mar 20, 2019 at 19:59
• I've found this multi-bat/tap-different loads setup here, by Yveaux, who seems a knowledgeable tinkerer. Is it just poor practice (but one can live with it) or bad practice (read it as "dangerous"), with Alkaline/NiMh batteries? Mar 20, 2019 at 20:04
• For alkaline, I don't know about dangerous since it takes a fair amount to make them burst into flames, but that setup is one that can cause damage to the batteries. The issue with breaking current in the ground path isn't discharging of the batteries; It's with the power up/down sequencing of the circuits connected to it. It also makes more noise since you have extra resistance in the ground path which all circuits are using as their reference voltage. Mar 20, 2019 at 20:27

simulate this circuit – Schematic created using CircuitLab

Figure 1. A redrawn circuit with correct battery orientation and conventional component layout for ease of reading.

simulate this circuit

Figure 2. (a) The usual and proper way to switch a dual supply. (b) Switching the negative leaves 1.5 V permanently connected between the two chips.

Others have pointed out the problems that creating a dual supply with batteries can cause. It's not a good idea. Far better to have one supply and an LDO regulator.

• In Circuit B, when the switch is off, the ‘micro’ also has reverse polarity of the 1.5v on its supply pins. Mar 20, 2019 at 21:40
• Thanks, Howie. It could be anywhere between 0 and -1.5 V depending on the relative conductance of each device. Either way, it's a mess. Mar 20, 2019 at 21:42
• I think Figure 2a is OK apart from the uneven battery discharge. Mar 20, 2019 at 21:57
• Oh man, I didn't even notice that issue with (b). Mar 20, 2019 at 22:03
• @Transistor: Multiple issues with 2b)! But figure 2a) is OK, from a switch point of view. Understood. I'd need a DPST switch. Mar 20, 2019 at 22:16