Advertisement

#160 Arduino Battery (🔋 VCC) Monitor - No external components required

#160 Arduino Battery (🔋 VCC) Monitor - No external components required Know when your batteries are going flat in your Arduino ATMega328P projects

$8 off your first order at LCSC Electronics with

Get a timely warning before your batteries go flat!

All this plus more in my GitHub:


List of all my videos
(Special thanks to Michael Kurt Vogel for compiling this)


Battery-powered, Deep Sleep Arduino (ATMega328P) projects are great but how do you know when the batteries are nearly depleted?

In the last video #159 we explored a simple, battery-powered project using an ATMega328P, as found in every Arduino UNO and Nano. Many times I was asked how I could detect the battery voltage and warn the user that it was time to replace the batteries.

In this video I show how we can do that with no extra components, all by the magic of the bandgap voltage set on the AREF pin, either internally or externally.

ATMEL decided not to precalibrate the AREF voltage (cheapskates!) so each chip has to calibrated first using a one line sketch. Easy stuff. And whilst reading the voltage might look a bit esoteric, you don't have to understand all the code - just use it as a function in your sketch or include a small library.

LINKS LINKS LINKS

500pcs 10 Values 0.1uF~10uF 50V Ceramic Capacitor Assortment Kit *Includes 10 Values $8.35


100Pcs 10Value 16V Tantalum Capacitor Assorted


ATMega328P Data Sheet


What's a Bandgap Voltage Reference?


Nick Gammon's page on ADC


Arduino Forum on the same subject


Arduino's page on Reference Voltage (AREF)


All this plus more in my GitHub:


If you like this video please give it a thumbs up, share it and if you're not already subscribed please consider doing so and joining me on my Arduinite journey

List of all my videos
(Special thanks to Michael Kurt Vogel for compiling this)


My channel and blog are here:
------------------------------------------------------------------


------------------------------------------------------------------

Arduino,AREF,ATMEGA328P,ATMEGA2560,ADCMUX,Low battery warning,Battery checker,Battery Monitor,Internal Reference Voltage,Beginners,electronics,C++,microcontrollers,programming,Battery powered project,

Post a Comment

0 Comments