Can I measure lithium ion cell voltage with Arduino ADC which is used to power the same Arduino through a boost module (XL6009)? The output voltage of boost module is 9 volts.

  • Sidenote: why are you boosting the voltage to 9V (and presumably using the voltage regulator on the nano to bring it back to 5V)?
    – Gerben
    Sep 24, 2018 at 18:26
  • @Gerben Because the lithium ion cell voltage can be in the range of 3-4.2 volts depending upon the charge level. So to operate the analog circuit (using LM358) and Arduino nano at a stable voltage I have to boost the input voltage. Plus the XL6009 module will keep the output voltage stable at 9V regardless of the input voltage. Sep 25, 2018 at 5:41

1 Answer 1


I'm the author of a library called BatterySense and you can use it to achieve your goal. In the repository Readme you can also find wiring diagrams and usage examples, but to give you a rough idea...

  1. Verify the negative side of your battery has continuity to the GND pin of your Arduino: you need to identify if the boost module is messing the common ground, but if you have continuity then you are fine
  2. Add a connection from the battery positive terminal going into one of the Arduino analog pins
  3. Use the BatterySense library to get the battery voltage and percentage level
  • Thanks so much OP and Roberto. I also want to measure a LiPo that is powering my Arduino. Great library, I've just checked it out. I suspect that I have the case where my battery negative terminal is not directly connected to GND, as part of the design, sot hat an over-discharge protection IC can do it's job. Any suggestions for that scenario? Here's the Circuit and PCB easyeda.com/GreatScott/… which is linked to from GreatScott!'s excellent youtube video here youtube.com/watch?v=Fj0XuYiE7HU
    – legoblocks
    May 15, 2020 at 8:52
  • I believe you might get more visibility if you post a proper question rather than a comment, may be referring to this question and answer in yours... I don’t know how you can work around with a non shared GND, but I’ll definitely interested in the answers you’ll get ;-) May 15, 2020 at 11:57
  • Thanks Robert, that's a great suggestion. I'll experiment with measuring the voltage with and without the over-discharge protection IC, trying it anyway, as I suspect the arduino will only be measuring the voltage when it's actually on, and therefore connected to ground via the MOSFET that the protection IC turns on and off. If it gives weird results / there's some difference in the measured battery voltage, then I'll post a new question. Thanks again, will tag you / this!
    – legoblocks
    May 16, 2020 at 2:25
  • Cool library guy. +1 Oct 8, 2020 at 2:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.