Accurately Read Battery Voltage with an Arduino and Voltage Divider | Pro Mini | 18650 | ATmega328p
Vložit
- čas přidán 20. 08. 2024
- Lets look at how to track Arduino VCC and accurately measure battery voltage using a voltage divider.
Hope you learn something new. cheers!!!
Libraries and Code Example:
github.com/Ner...
~~~~ Tools and Parts Used in this Video (AliExpress Affiliate)~~~~
RD6018W 60V 18A Bench Power Supply
s.click.aliexp...
Breadboard
s.click.aliexp...
Alligator Clips
s.click.aliexp...
UT61E Plus Multimeter
s.click.aliexp...
Jumper Wires
s.click.aliexp...
Kindly support us on patreon here: / delali
----------------------------------------
Other Channel Gear and Equipment's (Affiliate)
AliExpress
~~~~ Multimeters ~~~~
UT204 Plus Clamp Multimeter
s.click.aliexp...
~~~~ Oscilloscope ~~~~
DSO FNIRSI PRO Oscilloscope
s.click.aliexp...
~~~~ Soldering and Welding Kit ~~~~
DH30 Max Portable Battery Spot Welder Kit
s.click.aliexp...
KSGER T12 STM32 V3.1S Electric OLED Soldering Station
s.click.aliexp...
~~~~ Testers ~~~~
USB Adjustable Discharge Load
s.click.aliexp...
RD UM34C USB Tester
s.click.aliexp...
USB Tester with Current Voltage Indicator
s.click.aliexp...
Qualcomm QC2.0 & 3.0 | 5V / 9V / 12V / 15V / 20V Trigger
s.click.aliexp...
~~~~ Others Tools ~~~~
Xiaomi Mijia Screw Driver Kit
OLD Version s.click.aliexp...
NEW Version s.click.aliexp...
NEW Electric Version s.click.aliexp...
Non-slip Metal Scalpel Knife Set with 40 Blades
s.click.aliexp...
All Channel Gear on Amazon
Amazon : www.amazon.com...
----------------------------------------
Don't forget to LIKE, SHARE and SUBSCRIBE
Follow us @diydelali on Facebook, Twitter and Instagram
Channel Theme Song: Entire by Quincas Moreira
#Arduino #VoltageDivider #ATmega328p #BatteryMonitoring
#arduino #18650 #readvoltage #batterymeasurement #promini
#arduinoprojects #voltagedivider #promini #atmega328p #arduinotutorial #arduinoprojectsforbeginners #arduinoprogramming #howtouseanarduinotoreadbatteryvoltage #howtousevoltagedividerandarduinotoreadbatteryvoltage #readvoltagewitharduino #delali
arduino,arduino projects,18650,voltage divider,arduino voltage divider,pro mini,atmega328p,3.3v 8mhz,arduino tutorial,how to use an arduino to read battery voltage,how to use voltage divider and arduino to read battery voltage,read voltage,read voltage with arduino,Arduini Projects,delali,arduino project,how to,how to use an arduino and voltage divider to read battery voltage,how to monitor arduino battery voltage with voltage divider
This is a beautiful channel
Thanks fam.
You powered the pro mini with more than 3.3v in the beginning, but with a current limit. Is this why it didn’t break? Or Why is it ok to power 3.3v pro mini with ~4V? Great channel and vids btw keep it up!
I powered the pro mini with a current limit to ensure it doesnt get damaged incase i dont something wrong along the process of making the video. It was just a safety precaution.
Thanks for the kind words too. I appreciate your feedback. Cheers!!
assuming battery level with just measuring the voltage is not a very correct approach. Because voltage discharge level is not linear. to calculate the exact power level you also have to measure the current.
In my case i'm just trying to measure the battery voltage, so the non linearity of battery discharge doesnt matter much. It might matter if i was trying to calculate and estimate how long before the battery gets to a fully discharged state.
I hope you get what i mean.
Excuse me one question, why you didnt use the function "map" to get the battery percentage?
It doesn't work I tried the same and couldn't find answer why online. So went to basics and divided the value against the total times 100. This worked for me atleast
I didnt use the map() function becuase there was no need for making the Atmega328p do more work. I wanted to keep the code simple.
I believe this:
((batt_volt - lowBat )/ (fullBat - lowBat)) * 100
is simpler than this:
map(batt_volt - lowBat, batt_volt - lowBat, fullBat - lowBat, 0, 100)
Mad respects brother! mad respects!
Thank you fam❤️
Please dont forget to subscribe. Cheers!!
Thank you very much
You are welcome.
Please don't forget to subscribe. Cheers!!
@@Delali of course, already done , keep up
question: would this problem exist if you used a separate power source for the arduino and not use the battery?
No it wont exist.
If the power source never dips below the 3.3v output peg the microcontroller requires as reference then this problem goes away.
Can I measure without DC power supply? Anyone done it with nano 5v?
Yes you can. The battery will be the power source and the entity being measured at the same time.
Unless i've misunderstood your question.
Hello. Can i connect with you please. I just started learning Arduino and I'm all about 18650 battery. I want to do a lot with Arduino with 18650. If you don't mind.
Please check the about page of this channel for my email.
How about the same for esp32? i'm unable to use the program for esp32?
The code is meant for the Arduino line of boards. I belive the ESP has a different architecture.
Is this still a problem if you use two cells feeding a voltage regulator that then feeds the arduino?
As I understand it the problem arises because a Lion cell drops below 3.3V as it discharges this messing with the analog ref. Correct?
Yes. Correct.
If you use two cells in series, the good news is you have more time before the combined voltage dips below the voltage regulators desired input.