![battery status meter battery status meter](https://www.droking.com/image/cache/product_image/200073_16-1000x1000.jpg)
![battery status meter battery status meter](https://i5.walmartimages.com/asr/6aadab00-8be9-4a10-8560-54a0549f4dd4.2d60e40233d614a3685edd4e0d4918ba.jpeg)
Once again, to measure such batteries we need to hook our sense pin before it gets regulated, between the battery positive terminal and the voltage regulator positive input VIN or RAW and, as before, we require two resistors to reduce the voltage to acceptable values: Whenever your battery maximum voltage exceeds the onboard regulator (if there is any) an external voltage regulator is required.
![battery status meter battery status meter](https://i5.walmartimages.com/asr/062b46e7-595e-4008-8ba3-cabf571e72b0_1.bb9bae9475fbe9ea024f78d6ef6e3e75.jpeg)
Higher than 5V, with external voltage regulator On the other end, going too high on the resistor values will impede the library from getting accurate readings. The values of R1 and R2 determine the voltage ratio parameter for this library: for information about this value refer to the section below.īecause the resistors in this configuration will constantly draw power out of your battery, you shouldn't pick values under 1k Ohm, or you'll deplete your batteries much faster than normal. What does that mean when it comes to measuring your battery level? We need to measure the battery voltage before it gets boosted, which means your sense pin must be connected between the battery positive terminal and the booster positive input and we don't need any additional components as the voltage is already in the acceptable range: Voltage sources made of single cell LiPo or LiIon, along with some single or multi-cell NiCd configurations (like up to 3 AA or AAA), are not able to provide the suggested 5.0 volts input to your board and a voltage booster can solve your problem. The sense pin wiring can vary depending on your battery configuration, but here are a few examples based on the assumption you are using a 5V board: in case of a 3.3V board you should be performing the necessary adjustments. To improve this we suggest using the VoltageReference library to obtain a better calibration value for all analog readings. If you want your readings to be more accurate we strongly suggest to calibrate the library by providing your board reference voltage: most of the times you assume your board has exactly 5V between Vcc and GND, but this is rarely the case. The library requires at least 1 analog pin (we will call this the sense pin) and no less than 2 pieces of info on your battery: the voltage you will consider the minimum acceptable level, below which your project/product becomes unreliable and should be shut down, and the maximum voltage you can expect when the battery is fully charged.Īdditionally, you can provide a second pin (either analog or digital) to activate the battery measurement circuit (we call it the activation pin), useful in all those situations where you can sacrifice a pin to further increase your battery duration. Higher than 5V, with external voltage regulator.Higher than 5V, with internal voltage regulator.In reality, the relation between battery capacity and its voltage is better represented by a curve and there are many factors affecting it: current drawn, temperature, age, etc. The big assumption here is that battery capacity is linearly correlated to its voltage: the assumption itself is wrong, but in most cases it's close enough to reality, especially when it comes to the battery higher capacity side. The principle is simple: we are going to measure our battery capacity by measuring the voltage across the battery terminals. This is a simple Arduino library to monitor battery consumption of your battery powered projects, being LiPo, LiIon, NiCd or any other battery type, single or multiple cells: if it can power your Arduino you can monitor it! Please, before submitting a support request read carefully this README and check if an answer already exists among previously answered questions: do not abuse of the Github issue tracker.