I'm doing a school project and my part is to make a monitor for the current power production and battery percentage. The problem i read is that while charging, the voltage i'll be measuring measuring at the battery will be the charging voltage and not what is currently available in the battery. I have one INA219 at before the battery to measure the production and another on the battery, is there a way to get the current battery voltage?
Stop charging. Measure voltage. Stop measuring. Start charging.
What is the the easiest, automatic way?
In order to measure the battery voltage, the charger needs to be disconnected from the battery.
For informed suggestions, post a schematic diagram of the complete circuit, with pins, parts and connections clearly labeled. Hand drawn is preferred.
All my commercial chargers work that way. I suspect there is a specific circuit to accomplish that. I would do a Google search.
Why automatic? Why can you not disconnect, measure and reconnect by hand?
Why easiest? The answer to quickest and easiest is: buy a monitoring charger for your batter(y).
Your request is going against your teacher's instructions, who assigned you to make this discovery and gave supporting information to you, including battery type. If you were supplied with the INA219, draw a picture of your monitor circuit, then draw a picture of how you will disconnect and reconnect both charger and monitor. Mashup. Profit.
This could become a real problem. It appears you are using voltage as a battery charge percentage. That is not true on all chemistries. Consider looking up a coulomb counter, these would be more accurate.
Check the INA228, it has registers to read coulombs and energy
You are correct; thanks for catching that. I wasn’t aware of that part. From a quick look and based on your reputation, it seems you have also developed another great library.