Hey guys. I recently got Lolin D32 from Wemos and I've been suggested to use USB powerbank over LiFePO4 batteries. But I was really hoping I could use the board's battery voltage monitoring feature.
So, I was wondering, how easy would it be to read the voltage level off from the USB port without additional voltage dividers and whatnot? I don't think it's possible to use wires to connect the USB port cable (from the power bank) to the PH-2 2.0mm battery connector port (without some extra adapters at least), right?
You can see that power comes in through VBUS, passes through D2 and is made available, for reading, at VIN. You could, try it and see if it works, use VIN as your USB thingy to monitor the USB power thing. You'll have to account for the Vdrop of D2.
You can see that power comes in through VBUS, passes through D2 and is made available, for reading, at VIN. You could, try it and see if it works, use VIN as your USB thingy to monitor the USB power thing. You'll have to account for the Vdrop of D2.
I tried to look more into that but I couldn't find a way to measure the VIN directly. I tried a sketch that reads voltage from pin 35 and when hooked to a PC it's giving me 4-5V values. But I also read that it might give false values if the pin is wrong.
So, I'm not sure if this could actually be this simple?
I forgot to mention on OP that my electronics-knowledge is very beginner-level so I couldn't read it from the schematics myself nor could I find it by Googling either. Any ideas?
Or you can solder a wire to D2 to read the VBUS, connect the other end of the wire to the LiPo Fuel gauge input, and no need for a D2 Vdrop compensation value.
Or you can solder a wire to D2 to read the VBUS, connect the other end of the wire to the LiPo Fuel gauge input, and no need for a D2 Vdrop compensation value.
I wish I could try that but for my budget it's expensive. I was sort of hoping it wouldn't require buying additional items. I gotta keep that option in mind though for sure.
Regarding post #1, sorry I must have misunderstood you, did you mean I could read VIN programmatically without additional wiring/connections, and "simply" note the voltage drop on D2 on the code? If so then I must've misunderstood couple of articles that I thought said that VIN can't be directly read. Might have been different boards then.
Looking at the schematic from the link provided would allow you to answer those questions for yourself.
I am saying, I could put power into the USB connector and measure the voltage at VIN (To measure the voltage at VIN, I'd run a connection from VIN to one of the A:D inputs), using the on board A:D converter and display the value on a screen. Of course reading the power at VIN would not be ideal because of D2 but that issue can be compensated for by measuring the Vdrop across the diode D2 and compensate for the Vdrop in code.
.
ARGH! I typed out a response here, tried to post it, and the forum ate it, with a bunch more information, but I don;t have the time to type it out again.
You cannot measure the state of charge on a USB power bank by measuring the voltage on the output, it goes through a DC-DC converter, and will output a constant 5v right up until the power bank detects that the batteries are dead and turns off in order to protect the batteries from overdischarge.