Accurately Read Battery Voltage with an Arduino and Voltage Divider | Pro Mini | 18650 | ATmega328p

Поділитися
Вставка
  • Опубліковано 2 жов 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

КОМЕНТАРІ • 25

  • @Magne-ficent
    @Magne-ficent 4 дні тому

    How are you getting vcc max value of 3.303 volts? Is that max voltage through the voltage divider?

  • @gloriagbagbo-pf1of
    @gloriagbagbo-pf1of Рік тому +3

    This is a beautiful channel

  • @khaleef_hrm
    @khaleef_hrm Рік тому +2

    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.

    • @Delali
      @Delali  Рік тому +1

      Please check the about page of this channel for my email.

  • @woll757
    @woll757 Рік тому +2

    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!

    • @Delali
      @Delali  7 місяців тому +1

      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!!

  • @iamfyrus
    @iamfyrus 10 місяців тому +1

    Can I measure without DC power supply? Anyone done it with nano 5v?

    • @Delali
      @Delali  7 місяців тому

      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.

  • @andresmateo4281
    @andresmateo4281 Рік тому +2

    Excuse me one question, why you didnt use the function "map" to get the battery percentage?

    • @jakesllama
      @jakesllama 11 місяців тому +2

      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

    • @Delali
      @Delali  7 місяців тому +1

      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)

  • @aherte1257
    @aherte1257 Рік тому +1

    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.

    • @Delali
      @Delali  7 місяців тому +1

      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.

  • @tybozo
    @tybozo 11 місяців тому

    question: would this problem exist if you used a separate power source for the arduino and not use the battery?

    • @Delali
      @Delali  7 місяців тому

      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.

  • @sivaforu2004
    @sivaforu2004 Рік тому

    How about the same for esp32? i'm unable to use the program for esp32?

    • @Delali
      @Delali  7 місяців тому +1

      The code is meant for the Arduino line of boards. I belive the ESP has a different architecture.

  • @samithetechsavvy6485
    @samithetechsavvy6485 7 місяців тому +1

    Thank you very much

    • @Delali
      @Delali  7 місяців тому +1

      You are welcome.
      Please don't forget to subscribe. Cheers!!

    • @samithetechsavvy6485
      @samithetechsavvy6485 7 місяців тому +1

      @@Delali of course, already done , keep up

  • @autonoob
    @autonoob 8 місяців тому +1

    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?

    • @Delali
      @Delali  7 місяців тому +1

      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.

  • @robotboy3525
    @robotboy3525 Рік тому +1

    Mad respects brother! mad respects!

    • @Delali
      @Delali  7 місяців тому +1

      Thank you fam❤️
      Please dont forget to subscribe. Cheers!!