Thank you @Jane, @Donald23173 and James46717 (and my apologies for the late reply). Your replies make sense, and particularly thankyou Jane for the diagram and Donald for the suggestions. I think I’ll grab the INA3221 so I can measure the battery as well as the solar panel.
I’m quite excited by this, as I’ve now had my sensor powered by a solar-charged battery for over a month and it’s still going. Fingers crossed this is a viable, very-long-term solution.
(For those interested, it’s an ultrasonic sensor to measure the amount of water in our water tanks).
OMG ! On re-reading the datasheet for this DFR0559 I just found something hidden away which I think should be significant.
I expect you noticed the regulated 5V header pins, and read that you can use the blue GND and EN pins to turn on/off the regulated 5V pins. Nowhere in the documentation is the BAT pin defined or even mentioned.
Way down at the bottom of the document is a section headed “Build a low power environment monitor station” with a diagram and explanation of providing 5V power and GND to sensors from these regulated pins rather than in the i2c cables. Given that my ESP32 powers off when in deep sleep, and hence is no longer powering i2c … it seemed rather pointless to complicate the wiring this way.
But tucked away is the innocuous looking comment “Use the analog input A1 to monitor the battery voltage (equivalently the battery capacity)” and in the wiring diagram that we see the Arduino A1 is connected to the Sunflower’s BAT pin. And yes, a multimeter across those pins reveals the battery voltage.
Maybe my interpretation is wrong, but it seems like the blue GND and BAT pins are designed to provide a way for the microcontroller to monitor battery voltage. So why would DFRobot hide this information instead of making it a feature ???
… now back to the drawing board to see how much circuitry needed to detect the battery voltage I can remove
I had to reread that wiki entry four times to be certain that was correct. You’re absolutely right, between that comment about analog A1 and the wiring diagram below, that must mean the BAT pin is designed for voltage measurement.
But why on Earth write it like this? The labelling on this module is already confusing, more than one person has asked if the BAT IN symbol means that batteries can only power the device, but having such useful information nestled down the bottom of the page in the Applications section is just wild.
I might go ahead and update the product page on our website to make this clearer. This product is great but the wording leaves so much to be desired.
… and after I had been so vocal complaining that the Solar Power Manager has no way of measuring the battery voltage, and why would they assume we don’t want our microcontroller to know when the battery is going to cut off. oops!
Mind you, I come from a programming background, so I think in digital terms (like an i2c interface) rather than Analogue. It also doesn’t help that I’m using ESP32s which have only 1 (or sometimes 2) ADC pins.
Originally I said there is NO way to measure the battery voltage. I meant the actual voltage across the battery terminals. I still stand by that.
VBAT connects to the battery +ve directly but the battery -ve connects through a mosfet and DW06D Battery Protection IC. If the IC triggers, GND will be disconnected potentially removing power from the monitoring circuit.
So you can monitor VBAT giving an indication of battery state up to a point.
The disadvantage of this board is the solar panel must be around 5V or 6V.
Its big brother DFR0535 is a much better design, provides 3 standard voltages 3.3V 5V 12v and accepts a wide range of solar panels voltages.