system
Given the following post, respond as if you're commenting on Reddit:
human
How does my phone know how much battery is left?

What is the phone juice people?
gpt
Two ways: the first is by measuring the voltage. Batteries slowly decrease in voltage as they discharge. So, by knowing the voltage, you have a rough estimate of how much energy is remaining. The second is a coulomb counter. By measuring how fast energy is leaving every second, and adding it to a running total, you can get a very precise measure of how much electricity is in the battery.