Chat freely about anything...

User avatar
By Anto85esp
#95161 Hi everyone, I'm new to this forum. I've done a long search to find an answer but can't seem to figure it out. My intention is to power a wemos d1 mini from a recharged battery from a solar panel. In the various tests, if I disconnect the wemos from a power source (electrical socket or solar panel exposed to the sun) I have a percentage of battery discharge, but if everything is connected to the power supply, I have the voltage in volts of the power supply itself. In practice I would like, if possible, that when recharging a battery, for example discharged, I should see the percentages rising and not immediately 100% (given that it is charging) despite the battery being at 50%. The scketch is not perfect and the connection diagram is attached.
Attachments
(1.94 KiB) Downloaded 61 times
TestBatteria.jpg
User avatar
By QuickFix
#95178 The board you're using is a single cell battery charger with a power supply that always tries to output 3.7V; whenever there's enough juice inside the battery and/or there's sunlight on the solar panels, you will see this voltage and that's why it's always showing at 100%.

What you can do (not tested this myself though), is:
  • Connect the ADC directly over the battery (not the OUT-terminals, if you're using the PCB with the DW01 and 8205 MOSFET protection circuit).
  • Lift the CE pin (pin 8) of the TP4056 and pull it HIGH with a 10k, or so, resistor)
  • Connect a free GPIO pin of the ESP to this same CE pin of the TP4056
  • In your firmware, before you take a measurement, pull the GPIO pin LOW to temporary disable the charger
TP4056-Sch.png
Schematic of TP4056 charger boards, with and without protection circuit
Attachments
TP4056 data sheet
(59.49 KiB) Downloaded 65 times
User avatar
By Anto85esp
#95186 Satisfactory answer! Obviously I don't have the skills to put your theory into practice. At this point I ask myself: surely someone will have noticed this "problem" and will have made a guide to remedy it, or not? Basically, I would like to view the battery charge from Home Assistant. With what I have achieved, I could have an idea only when the sun has set. Or maybe there are other ways to get what I want to do?
User avatar
By donbrew
#95199 If you really have it wired like the illustration there should be no problem reading the battery voltage. However, I bet you have the Regulator output connected to A0 not the battery.

I do exactly the same thing. Theoretically the 2 positive pins on the TP4056 are connected But the grounds are not. I connect directly from the battery + to 100K to A0.
I use a 5 volt step up module instead of all of that circuitry. They cost about $1 each on Amazon.