Things seem to work, and the battery voltage goes up and it runs on battery for some timeframe that I have yet to test but the battery seems to max out at 4.00V and not the 4.2V that the code is expecting so that tutorial code is showing a 77% charge max.
So, questions.
Is this battery trash and only gets to 4V?
Is that tutorial outdated in some way?
Am I doing something wrong?
This is across 2 MKR1010 boards and 2 of the same batteries with the same code.
I'm charging from a Windows PC via whatever USB, a Macbook USBC, and a normal Anker USB charging brick.
I have not taken the volt meter to it yet, I'm somewhat expecting that since defective hardware, defective battery, charger, and code are all excluded that either the tutorial math is wrong or it's just the battery model/manufacturer is just poor so I have not tested the battery directly.
If you all feel that it's a crap battery, what would be the recommendation for the largest (reasonably priced) mAh so that this doesn't have to get charged much. Maybe what manufactuer should I be looking at? And yes, I'm doing the low power, deep sleep, etc. But charging is still a task and if it's 2 times a year vs monthly, that's a huge difference to management.
This is what I am leaning towards, just a cheap battery that can't be filled fully/correctly.
Alright, I caved and measured the 2 pins where the battery connects and they do seem to indicate close to 4.2V.
So, is the tutorial wrong?
Are there updated variable values?
This is the output from the tutorial when I had it offline for about 2 hours, so slightly less than 4.0 but measured I'm ar about 4.2V.
17:28:10.881 -> The ADC on PB09 reads a value of 4072.00
17:28:10.881 -> Which is equivialent to 3.28V.
17:28:10.881 -> This means the battery voltage is 3.98V.
17:28:10.881 -> Battery charge level is 75%.```
Be sure you have the appropriate protection circuity, Li burns with a brilliant color that once you see it you will never forget it. Without the protection you are unknowing playing with an uncontrollable fire.
I'm going to go very nieve here and say that the listing for the battery says " * Overcharge, over-discharge, over-current, short circuit protection, over temperature protection."
However, I'll take this opportunity to ask if there is anything in the code that I should put into place to put in a second level of safety?
Does the MKR1010 charging circuit account for any protection?
I let the battery drain and the MKR1010 power down to see what the low is read at when it is powered back on.
Based on the tutorial code, it's at 3.44V and has 15% charge.
I did not measure with a multimeter, but since the Arduino was powered down, I'm guessing 3.2V?
The ADC on PB09 reads a value of 3518.00
Which is equivialent to 2.84V.
This means the battery voltage is 3.44V.
Battery charge level is 15%.
So......
Is the tutorial wrong or is the battery trash and only 3.4V -> 4.0V instead of 3.2V -> 4.2V?
Since the Arduino was off and the code showed 3.4V when reconnected, I'm thinking that the tutorial is wrong.
As I'm new to using Arduinos, does anyone have battery measuring code that might be more reliable/accurate than what is in the tutorial?
Maybe the R1 and R2 values are based on pre-production values?
int R1 = 330000;
int R2 = 1000000;
Does anyone have insight in measuring the battery on the MKR1010?
Referenced but maybe not emphasized enough, LiPo or LiOn batteries can be very volatile. They should be charged with a charger that detects the number of cells, programmed to the capacity of the battery and monitors individual cell voltage as it charges and balances the cell voltage.
The radio control hobbyist use these and place them in special containers for charging and storage. Damaged batteries have burned down houses and automobile repair shops.
Without analyzing everything, it appears the R1 and R2 values are selected to provide 3.3 volts to the processor. Measuring this or the 4.2 LiPo battery level indicates full charge, preferably measure 4.2.
Analog scaling 4.2 to fully charged in your sketch and 3.3 volts representing the minimum or level to recharge the battery.
To be honest, this is literally playing with fire.
Regardless of the algorithm, I wouldn’t attempt it.
Power the circuit from the LiPo if that’s your best option, monitor the voltage and indicate when to recharge, use a relatively safe LiPo charger to charge the battery.