Hello.
I have two INA219 sensors, 18V/40W solar panel, solar charger controller and 12V lead acid battery. I want to measure the voltage / current on the battery and the same on the solar panel. I use the circuit that is attached in the attachments.
Battery measuring works nice, but solar panel voltage measuring is wrong. It shows same voltage as battery (so 12V), even if solar voltage gives for example only 5V. I think that solar charger controller somehow blocks voltage measuring, or is my circuit bad? Thank you.
The charge controller probably has the + of the panel directly connected to the + of the battery,
and controls/regulates the negative wire of the panel.
Commonly done, because then you can use an N-channel fet (cheaper/better) for regulation.
But that means you can't use the INA for panel voltage.
You might be able to use the A/D of the ESP for panel voltage, but that requires a 3-resistor setup because black-wire panel voltage can vary between 12volt (night) and -10volt (full sun, full battery).
I wouldn't bother with panel voltage, because all that matters is panel output current.
Leo..