element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
element14's The Ben Heck Show
  • Challenges & Projects
  • element14 presents
  • element14's The Ben Heck Show
  • More
  • Cancel
element14's The Ben Heck Show
Forum LCD battery monitor
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join element14's The Ben Heck Show to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 5 replies
  • Subscribers 31 subscribers
  • Views 716 views
  • Users 0 members are here
  • frontpage
Related

LCD battery monitor

Former Member
Former Member over 10 years ago

HI new to element14 and hooked with tbhs.

 

I have a quick question about trying to display realtime battery status

  on an LCD,

 

i don't think that displaying battery percentage or voltage is great for my intended application

so i would like to display the time remaining to recharge in hours and mins.

 

MAny thanks

 

dave, UK

  • Sign in to reply
  • Cancel
  • shabaz
    0 shabaz over 10 years ago

    Hi Dave,

     

    This involves knowing how much energy is stored inside a battery and the amount of power being delivered. These are complicated things (involves voltage and current measurement and integration) and since batteries are chemical devices some knowledge would also be needed of temperature, cycles, etc and how it affects the amount of energy that can be stored or used. Having said that, there are off-the-shelf chips that can support some of this to an extent, (for certain battery types) however most (possibly all) are small surface-mount devices. For further reading, check out (say) TI devices here: http://www.ti.com/lsds/ti/power-management/battery-fuel-gauge-overview.page

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to shabaz

    Thanks for getting back to me so quickly shabaz

    getting a feeling I might be biting off more than I can chew with this idea.

     

    as it stands I'm still testing a few LEDS and batteries

     

    im thinking of building the power-plant out of ether

    14.4v 3000mah  nimh  D cells (12x1.2 volt)

    or

     

    14.8v 7800mah li-ion  26550 cells 4x3.7volt)

     

    voltage may change

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to Former Member

    Are you looking for the time until you need to recharge your batteries (remaining run time)?

    If so, this problem can be greatly simplified by converting everything into power (Watts).

    The answer won't be perfect, but it may be good enough depending on the application.

    Minutes are being used to make the math easy, but in a real application the sampling rate would probably need to be higher.

     

    I am mostly thinking out loud, so please bear with me...

     

    Energy and Power are in the same units of Watts. Energy is giving and power is taking.

    We could calculate the energy contained in the battery and then keep accounting of how that power is spent over time.

    Every time we make a measurement, we can update the energy remaining in the battery and then make a calculation of how long that energy will last at the current burn rate.

     

    Let's use your first battery configuration as an example.

    The total energy in the battery pack is;

     

    14.4v x 3Ah = 43.2vAh or for our purposes, 43.2Wh.

     

    So, we can use up 43.2 W for one hour.

    This can be divided up however we like.

    If we consumed 10W of power, the system would run for 43.2Wh/10W = 4.32 hours

    At 14.4W load, it would run for 3 hours...

     

    If you hook up the battery pack to your gizmo and then measure voltage and current after one minute and get;

    14.4v and 1A, then we have been using roughly 14.4 Watts of energy over the first minute of use.

    Since there are 60 minutes in an hour, we have consumed 14.4W/60min/hour = 0.24Wh.

    The power remaining in the battery is 43.2Wh-0.24Wh = 42.96Wh

    At our current burn rate, that would last for 42.96Wh/14.4W = 2.983 hours. (2.983 hours remaining until it needs to be recharged)

     

    Now, we make another measurement of voltage and current a minute later and get;

    14.4v and 1A again. so power usage is currently 14.4v x 1A = 14.4 Watts

    We can repeat the calculation except we plug in the Watts remaining and the new values for voltage and current and we get;

    42.96Wh - (14.4W/60) = 42.68Wh remaining

    42.68Wh/14.4W = 2.964 hours remaining.

     

    If the load now decreases, the remaining time may increase.

    Let's say we next get 14.3v and 0.8A, 14.3vx0.8A = 11.44W  11.44W/60 = 0.191 Wh consumed

    Time remaining = (42.68-0.191)/11.44 = 3.714 hours remaining...

     

    If the load goes up or down, the time remaining will decrease or increase along with the load.

    As long as the power use isn't fluctuating wildly and voltage and current measurements are made often enough, it could work.

    It would take a little playing around as to the best sampling rate for your circuit. (1 second, 10 seconds...?)

    With a higher sampling rate, you made need to use variable type double instead of regular floating point so that the error doesn't run away.

    Also, how your circuit is intended to perform may need to be considered.

    If you are using the batteries to drive a constant voltage or current power supply, such as a constant current power supply for LEDs, the above method may work very well.

     

    There is only one way to find out!

     

    To measure the battery pack voltage you can use a voltage divider to bring the level down to below 5 volts and then use some math.

    At 14.4v, something like 200k and 100k voltage divider, taking the measured voltage off of the 100k resistor should work nicely.

    For the current, you would need a very low value resistor in series with your circuit and then multiply the voltage reading across it with an op-amp before using the A/D on the Arduino.


    There are many IC's out there as well. Finding one for your application would require a little research.


    I don't know if I helped or not, but it was fun to think about!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • lotusf33t
    0 lotusf33t over 10 years ago in reply to Former Member

    David Milunic wrote:

     

    ...

    Energy and Power are in the same units of Watts. Energy is giving and power is taking.

     

    Nope - Energy is Joules. You can also express it in Watt-hours, why will become apparent in a moment...

    1 Watt is 1 Joule/second, that is energy per unit time or the rate of energy flow. So Power times time, like Watt-hours, is energy/time*time or just energy. Makes sense? You're doing great, but I could not leave you hanging and spreading incorrect engineering/physics.

     

    We could calculate the energy contained in the battery and then keep accounting of how that power is spent over time.

     

    Exactly!

     

    Every time we make a measurement, we can update the energy remaining in the battery and then make a calculation of how long that energy will last at the current burn rate.

     

    Let's use your first battery configuration as an example.

    The total energy in the battery pack is;

     

    14.4v x 3Ah = 43.2vAh or for our purposes, 43.2Wh.

     

    So, we can use up 43.2 W for one hour.

    This can be divided up however we like.

    If we consumed 10W of power, the system would run for 43.2Wh/10W = 4.32 hours

    At 14.4W load, it would run for 3 hours...

     

    If you hook up the battery pack to your gizmo and then measure voltage and current after one minute and get;

    14.4v and 1A, then we have been using roughly 14.4 Watts of energy over the first minute of use.

    Since there are 60 minutes in an hour, we have consumed 14.4W/60min/hour = 0.24Wh.

    The power remaining in the battery is 43.2Wh-0.24Wh = 42.96Wh

    At our current burn rate, that would last for 42.96Wh/14.4W = 2.983 hours. (2.983 hours remaining until it needs to be recharged)

     

    Now, we make another measurement of voltage and current a minute later and get;

    14.4v and 1A again. so power usage is currently 14.4v x 1A = 14.4 Watts

    We can repeat the calculation except we plug in the Watts remaining and the new values for voltage and current and we get;

    42.96Wh - (14.4W/60) = 42.68Wh remaining

    42.68Wh/14.4W = 2.964 hours remaining.

     

    If the load now decreases, the remaining time may increase.

    Let's say we next get 14.3v and 0.8A, 14.3vx0.8A = 11.44W  11.44W/60 = 0.191 Wh consumed

    Time remaining = (42.68-0.191)/11.44 = 3.714 hours remaining...

     

    If the load goes up or down, the time remaining will decrease or increase along with the load.

    As long as the power use isn't fluctuating wildly and voltage and current measurements are made often enough, it could work.

    It would take a little playing around as to the best sampling rate for your circuit. (1 second, 10 seconds...?)

    With a higher sampling rate, you made need to use variable type double instead of regular floating point so that the error doesn't run away.

    Also, how your circuit is intended to perform may need to be considered.

    If you are using the batteries to drive a constant voltage or current power supply, such as a constant current power supply for LEDs, the above method may work very well.

     

    There is only one way to find out!

     

    To measure the battery pack voltage you can use a voltage divider to bring the level down to below 5 volts and then use some math.

    At 14.4v, something like 200k and 100k voltage divider, taking the measured voltage off of the 100k resistor should work nicely.

    For the current, you would need a very low value resistor in series with your circuit and then multiply the voltage reading across it with an op-amp before using the A/D on the Arduino.


    There are many IC's out there as well. Finding one for your application would require a little research.


    I don't know if I helped or not, but it was fun to think about!

    The whole idea of gas gauging batteries has been fascinating to me for a long while...different battery chemistries are easier to work with depending on the way the operating battery impedance varies with current, temperature, and state of charge. Li-ion batteries don't help you out too much in this regard...

    I really like Li-Fe-PO4 batteries for their nice voltage curve on charge and discharge, they pretty much point accurately at state of charge without too much work input. Metal-Hydride cells too. And lead-acid. Lithium-Ion, notoriously flat and unresponsive until they die, so counting W-h is about where you are stuck. Have fun, and keep your physics straight!


    Regards,


    Jack

    AI6BZ

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to lotusf33t

    Hi Jack,

     

    Thanks for the correction to the energy definition.

    The "give and take" analogy was for accounting purposes only to make the logic a little more straight forward to a seemingly dauntless task.

     

    The simplest LiPo battery fuel gauge that I have seen out there is based on the Maxim MAX17043.

    It can be had already mounted on a carrier board for just a few dollars.

     

    I have not played with the LiFePO4 batteries yet. Have you had much of an issue with fake LiFePO4 batteries?

    All of the 18650 Li-ion batteries that I purchase these days get tested with a nifty little LiitoKala tester as soon as they arrive.

    It does a pretty good job of weeding out junk.

     

    Regards,

     

    - David

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube