I'm not quite sure if capacity is the right word. Anyway, I want to make a phone battery bank with an LED strip on the side displaying how much capacity the batteries have. Is there a way to read the batteries' capacity and output an int between 0-100 to control the LEDs? Also, how do you recharge batteries through just wiring and a microUSB port?
Please correct me if capacity is not the right word. Also, I am kind of experienced in soldering and programming, but not arduinos.
It depends on the type of batteries in your "bank". Lipos are relatively easy to "read" because with them the battery voltage is a reasonable indicator of the amount of charge left in them. But they have to be charged carefully
Other types like NiMH are easier to charge but with NiMH the only real way to know how much charge they have left is to have recorded how much has been used since they were last charged and that's a rather trickier job.
Steve
You could use voltage as an indicator of the remaining capacity, but keep in mind that the cell voltage depends on the load:
Typical Discharge Curves of a 2000mAh Li-Ion Battery
Most smart devices (cell phones, laptops etc., even power banks with some smart circuitry) calculate the remaining capacity by measuring the current and voltage going in and out of the battery. If you integrate the product of the voltage and current, you get the total energy. You can then measure the energy that goes into the battery, and then measure the energy while it's discharging, you can subtract them to get an estimate of the remaining energy in the cells. (Keep in mind that charging Li-Ions isn't 100% efficient, so you'll have to make up for that in your calculations, because Ein > Eout.)
To charge Li-Ions, you need a CC/CV charger and some protection circuitry. If you don't charge it the right way, they can easily explode or catch fire, it's seriously dangerous.
I sometimes use these modules (they're all over ebay):
They include a 1A charger and a protection circuit (over current and over discharge).
It might look like an interesting project to make your own power bank, however, I would never trust my own projects and these Chinese modules enough to put a Li-Ion bomb in my pocket. Li-Ion accidents happen all the time (cfr. Samsung Note 7, exploding hover boards ...), so I always use commercial power banks from respected brands.
Pieter