I am trying to make a voltage meter for monitoring the voltage on a 3 cell LiPo using an Arduino nano.
The JST-XH connector has four pins, the first (P1) for ground (G), the second (P2) for the first cell (C1), the third pin (P3) for the second cell (C2), and the fourth pin (P4) for the third cell (C3).
Of course with multi-cell LiPos, if you are measuring the voltage from the ground pin, the 2nd pin will give me C1, the third pin will give me C1+C2, and the fourth pin will give me C1+C2+C3.
To get all the voltages under 5v, so the ADC on the Arduino Nano can read them:
I have P3 (C1+C2) running through a voltage divider (r1 = 100k and r2 = 100k) so that the voltage is halved. Output of the voltage divider is connected to A6 on the board.
I have P4 (C1+C2+C3) running through a voltage divider (r1 = 200k and r2 = 100k) so that the voltage is 1/3. Output of the voltage divider is connected to A3 on the board.
P2 (C1) is connected directly to A7 on the board, because it is already under 5v.
I then take care of calculating each individual cell’s voltage level in the code.
The issue is: before I have powered the board up, when I plug the LiPo into the port, the board suddenly turns on.
As you can see from the attached Fritzing, the circuit is fairly simple. There are other components on the board, as you can see from the attached picture, but other than the Ground, the circuit is isolated from everything else.
Is is possible the board is being powered from an I/O pin?
Because later on I will be powering the board through a 5v regulator on an ESC that is itself being powered by the LiPo, there is a risk of shorting out a high capacity LiPo, which is never fun.
I don’t want to move forward until I have this figured out.