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?