I have Feather nRF52840 connected to BME280 and bq24074 universal USB / Solar / LiPo charger and a battery.
Using this code:
Code: Select all
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include <Arduino.h>
...
V= readVBAT()/1000.0;
I.e. purely on battery I get 3.908V
But what happens once I connect i.e. the USB port on the charger board? What is the voltage that is reported?
Well, I suspect it is the voltage from the USB supply. (somewhat down scaled to a range suitable for the feather)
In that case the function returns 4.397V
But to control the charge of the battery I would like to know the actual charge status of the battery while it is being charged. Is there a way to do that? Maybe to do some code to estimate how long until fully charged.
Feather board pin '3V' is wired to BME280 'VIN'.
I was thinking there should be a connection to the charger board to provide the battery voltage state. Maybe would be nice to have some smarts in the charger and I2C port to talk about some interesting charger observations?
Cheers,
Gert