Why would the output value of a voltage divider increase when the source voltage decreases?

I have this small robotics hobby project. That robot is powered from multiple sources, main power line is 12 V, either a lead-acid battery or a wall-wart 12 V power supply.

I wanted to measure the voltage of the input power using ADC of one of the MCUs I have inside (PIC18F), but it is a 5 V MCU and on top of that I am using the internal voltage reference for ADC so that it's more accurate, which is 4 V, so I need to divide the input voltage into something lower than 4 V.

For that I create a trivial voltage divider from 2 resistors, 10 kΩ and 4.7 kΩ resistor, which seemed to work. The problem I was facing was that the value returned by the ADC was getting higher when the load on the robot increased and the input voltage decreased.

I was originally thinking the problem was with my MCU programming, but then I connected a multimeter to that same pin and saw that indeed the voltage divider output voltage is increasing as the input voltage decreases - basically when the input was about 12 V the output of divider was around 3.8 V, and when the system was under load (I was moving some servos) and the input dropped to 11 V, thr output of voltage divider got over 4 V (it was connected using the wall wart, will test with battery later). Why is this? How is it even possible?

• A diagram of how your system is connected would be helpful in diagnosing the problem you are experiencing.
– vir
Aug 1, 2022 at 20:58
• @vir I can try to make some, but it's huge... there are 4 different MCUs and raspberry with many sensors, servos and motors, I can try to simplify it, but it will probably take me a couple of days to draw it.
– Petr
Aug 1, 2022 at 20:59
• My gut feeling is you have some sort of ground bounce problem where the ground reference voltage of your MCU is rising because you are using a common return connection to your main power input. The increased current of your servos could therefore create a non-trivial change in the potential between your MCU's ground and the power supply's return line. A high level block diagram and picture of how everything is connected would go a long way towards confirming this or suggesting some other issue.
– vir
Aug 1, 2022 at 21:04