Measuring Battery Voltage Is Simple, Or Is It?

FiftyThree
Aug 17, 2015 · 6 min read
Inside Pencil by FiftyThree stylus
Inside Pencil by FiftyThree stylus
Inside Pencil by FiftyThree stylus
LED display recording the battery voltage for Pencil
LED display recording the battery voltage for Pencil
LED display recording the battery voltage for Pencil
Image for post
Image for post
//Positive (+) to pin A0
//Negative (-) to GND
void setup() {
Serial.begin(9600);
analogReference(INTERNAL);
}
void loop() {
Serial.println(analogRead(A0)/1023.0*5.0);
}
//Case closed... or not
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

A Space to Create - FiftyThree's Blog

Makers of Paper and Paste

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store