How to Read Battery Voltage with Arduino (Measure Over 5V Safely!)
Автор: Flames n' Stuff
Загружено: 21 апр. 2025 г.
Просмотров: 2 350 просмотров
This video shows how to measure voltages using an Arduino, including how to safely read voltages over 5V using a simple two-resistor voltage divider. I’m using an Arduino Nano, but this works on basically any board with analog inputs (A0–A5). We start by measuring voltages under 5V directly, then move on to higher voltages like two 18650 batteries in series by scaling them down with resistors. My code will be in a pinned comment.
One important thing not covered in the video: the Arduino’s voltage reference might not be exactly 5V. You should measure the actual Vcc of your board using a multimeter and use that value in your calculations instead of just 5.0 — that’ll make your readings much more accurate. If you want even better results, try averaging several readings together in code to smooth out noise. And if your Arduino always reads a little too high or low, you can tweak your result by adding or subtracting a small offset. Also, to get the most accurate readings you want to try and divide voltages to be as close to 5V as possible.
This kind of voltage monitoring is super useful for battery-powered projects, like if you want your Arduino to flash a warning LED when your battery gets low. Thanks for watching, and feel free to ask anything in the comments. Flame out!
0:00 Intro
0:31 Circuit under 5v
0:51 Over 5V theory
1:49 Circuit over 5V
2:14 Code
4:19 Testing
5:18 Outro

Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: