# Simple Measuring Voltage Circuit Problem

So, i built this simple circuit for measuring voltage from a battery pack to an arduino. The thing is, i want to measure the first cell and then the voltage from the whole battery pack: using two transistors for changing the voltage divider input (check the image so that you know what i mean). I do not want to apply a constant load to the battery, that's why i'm using transistors to turn on and off the voltage divider circuit.

Here's the scheme:

I'm using a simple calculation when reading from pin A0: 0-1023 (analog range) reading to 0-25 volts (as the voltage divider is at a 5:1 ratio). My question isn't about the code. Here's the situation:

When both transistors are off, i get a 0 Volts reading (as it should). When the first transistor is on, and the second is off, i get a ~4.2v reading (as it should.) The problem is when the second transistor is on (and the first is off). I get the SAME reading (~4.2v) instead of 8.4v (the whole bpack voltage).

Adding diodes between each collector and the voltage divider for protection didnt alter my results. I'm really confused about this... Any help would be much apreciated!

The emitter of an NPN transistor is always 0.65volt lower than the base.
If you're putting 5volt on the base, guess what the voltage on the emitter is.
Leo..

Draw the circuit on a blank sheet of printer paper
take a photo
Either they are wired in parallel or they are not.
If they are, the only way to measure one battery and NOT the other is to disconnect them from each other
with a relay.
I see no such relay.
Second, you need two voltage dividers, one for each battery.
Third, transistors are not necessary if you have separate voltage dividers.
Fourth, your resistor values are way to low. you should be using nothing less than 20k (assuming no transistors, which BTW are not the right device for this application. (Analog switch would be be much
better (CD4016)

Try this.
1k resistor from A0 to ground.
Sources of two logic level mosfets to A0.
Gates to two digital output pins.
One drain with ~3k2 resistor to 4.2volt battery.
Other drain with ~7k4 resistor to 8.4volt battery.
1.1volt Aref selected in setup().
Leo..

Hi All,
If you want to accurately measure a voltage,
DO NOT use any active or non-linear devices
in the measuring circuit. Using a transistor,
FET or diode will introduce unknowns into
the process! You only need a simple resistor
voltage divider and for best accuracy, use
the same divider for both measurements.
Transistors and diodes change their voltage
drops depending on current flow through them
and temperature.
Herb

herbschwarz:
If you want to accurately measure a voltage, DO NOT use any active or non-linear devices in the measuring circuit. Using a transistor, FET or diode will introduce unknowns into the process!

If that is a <1ohm Rds(on) fet used to switch a voltage divider (post#3), then there will be no problem.
If that is a transistor with saturation voltage and base current added to the voltage divider, then yes.
Leo…