element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
BeagleBoard
  • Products
  • Dev Tools
  • Single-Board Computers
  • BeagleBoard
  • More
  • Cancel
BeagleBoard
Blog BBB - Rechargeable on-board battery system
  • Blog
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
BeagleBoard requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
Author: shabaz
Date Created: 9 Aug 2013 11:53 PM
Views: 2395
Likes: 18
Comments: 129
  • beaglebone_black
  • bbb
  • bb_black
  • beagle_bone_black
  • ti
Related
Recommended

BBB - Rechargeable on-board battery system

shabaz
shabaz
9 Aug 2013

Note April 2017: There are different revisions of the BeagleBone Black since this post was written in 2013, and without testing them all, it is the user's decision whether to try this solution or not. The revision changes are listed here and a possible option for at least some revision boards is shown in the photo here but I've not investigated this. The newer BeagleBone Blue already has a battery connection, so that is another option.

 

This posting is about implementing a rechargeable battery system for the BeagleBone Black. It is simple, safe and very low cost (less than 6 Euro).

 

 

First, some brief information about the power circuitry on the BBB.

 

The BBB has a built-in power management IC (PMIC) based on the TI TPS65217C device. This device contains multiple switch-mode regulators and LDO regulators to provide all voltage levels needed for the entire board. It handles wake-up using a push-button fitted on the BBB. Automatic power-down via the button requires some software to be implemented (to do the equivalent of 'shutdown now' from the command line). When the button is pressed, an interrupt is generated and the microprocessor is supposed to query the PMIC (via I2C) to learn that the button was pressed, and kick off the shutdown sequence. In the event of a failure here, the power can be switched off by holding the button down for 8 seconds.

The IC also contains built-in battery charging capability.

Apart from the USB requirement of 5V, there is no need to run the BBB from 5V; it can happily run from a lower supply. This means that a single 3.7V cell could be used to power the entire board. No need to step-up to 5V or to run dual cells and step-down to 5V, both of which could have been inefficient.

Why is this useful?

It makes it an excellent platform for outdoor/portable use.

For indoor use a battery is useful because it serves as a backup supply in case the main power (from a mains powered supply or from USB) gets disconnected. It could prevent filesystem corruption. If the main supply gets disconnected, the battery immediately takes over. In fact, I permanently leave the battery connected even when I'm running from the mains supply, in case I forget to safely shutdown the board.

What battery can be used?

Any small Lithium Ion (Li-Ion) or Lithium Polymer (Li-Po) single cell can be used, preferably as long as it has a built-in protection circuit. If it doesn't have an in-built circuit, it is highly advisable that one with a built-in thermistor is used. A cell in the range 700mAH to around 2AH is advisable. The one that I used in the photo above is from Olimex part code BATTERY-LIPO1400mAh. It should last around 3.5 hours (EDIT: Now been measured, it lasts 2 hours 50 minutes - see notes below, and comments below) on a full charge (not measured) and should fully charge in around 2 hours. This particular battery is just the right size to fit in between the two rows of headers and is flush so that a cape can still be plugged on top. So, the entire thing can fit inside any enclosure.

You will also need a connector (see next section) and one resistor.

Construction detail

The BBB has four holes that are suitable for connecting up the battery. They are detailed in the BBB system reference manual (SRM):

This is what they look like:

The Olimex Li-Po has a built-in protection circuit, so I soldered a 10k resistor to TS and GND to simulate the thermistor. (EDIT: You may or may not wish to do this, please study Li-Po and use your own judgement - see comments below) It is desirable to use a connector for the Li-Po.

The LiPo connector was convenient to solder to pins TP6 and TP8, and then  a zero-ohm link between TP5 and TP6 on the underside.

Here is how it was done step-by-step (there are just two steps):

1. Solder the 10k resistor, and a zero-ohm link (both are achieved on the underside of the board) as shown here in the yellow box. These are simple 0603 resistors; I used a 1% tolerance resistor, but 5% should be fine.

2. Solder in the connector.

This is straightforward, but complicated slightly by the fact that the connector has 2mm pin spacing, but the board has 0.1" spacing. It means that the pins on the connector need to be splayed or bent into the correct spacing. The connectors are available in vertical mount or right-angle (RA) mount. If you use a vertical mount connector, there may not be enough space to splay the pins. Instead, I used a right-angle connector and bent the pins into a vertical orientation, and then I had space to bend the pins and still have the connector flush with the board as shown here. You can see another view of the connector from the first photo.

I'm fairly sure that the desired connector is JST 'PH' series.

 

That's it; plugging in the battery, the board worked instantly. Note that the Li-Po charge method is usually to have a constant current supplied to the battery until it reaches a certain, very precise voltage. After that the charger switches to a constant-voltage mode. For the Li-Po battery that I used, the charger needs to be set to 4.2V, but the BBB by default sets it to 4.1V (It can be set to 4.2V via I2C control but today it doesn't). I'm not sure what the impact of this is (beyond storing less charge), but I believe it is safe. I have been using it daily for three months and the battery is always cool to touch.

Controlling the PMIC

The TPS65217C PMIC is very programmable; it has dozens of configuration settings specifically for charging and it has safety timer capability. The PMIC is configured upon startup via I2C. There are three I2C busses on the BBB, and one is dedicated to on-board peripherals. Control of the PMIC is not normally possibly by the user; it requires driver code or possibly there is access by the device tree infrastructure. Checking the .dts file in /boot did not reveal how to control the battery charger functionality. There are two current Google Summer of Code (GSoC) projects that touch on PMIC:

1. IIO, ADC, PMIC, LCD debug/patchwork (summary page, blog page) - Zubair Lutfullah

2. MINIX I2C drivers (summary page, blog page) - Thomas Cort

Hopefully the guys working on the projects (Zubair and Thomas) can offer some advice on how to set the level to 4.2V. Zubair's project also includes how to use the in-built ADC inside the AM3359 to monitor voltages.

Notes

There really should be some more detail including measurements to show how long the battery lasts and to observe the charging status (via I2C reads). Unfortunately I didn't have time to collect this information. But I've been using it for three months regularly and it functions well.

EDIT: The following simple test was conducted using the Olimex battery referred to above.

1. Power up the BBB using the DC power supply and let it charge the battery while powering the BBB

2. After about 4-5 hours, the DC supply was disconnected, and a script was run on the BBB to log the current date/time to a file, every minute. The script would sleep in-between. The Ethernet connection was left up, and the BBB was left alone until the battery died, and then the log file was examined.

 

#!/bin/bash
while true; do
date >> log.txt
sleep 60
done

 

The result was that the log file showed that the BBB ran for 2 hours 30 minutes before it died. After this, the test was repeated. The second time, it ran for 2 hours 50 minutes. The discrepancy may be because this battery has never been fully charged followed by such a long discharge, and so perhaps it is related to that. No test has been run with the Ethernet disconnected, but the BBB should run for longer in that case of course.

In a third test, the battery again ran for  2 hours 50 minutes (to within 1 minute). Again, this was with the Ethernet interface up.

Anonymous

Top Comments

  • shabaz
    shabaz over 8 years ago in reply to morgaine +2

    Hi Morgaine,

     

    Thanks!

    That's a good link and tip. I too had found the connector tight.

     

    Hi John,

     

    (Replying here so that we can retain the battery comments in a single location):

     

    John Alexander wrote:

     

                           

     

    How…

  • shabaz
    shabaz over 8 years ago in reply to fustini +2

    Hi Drew,

     

    I'm not sure where the 500mV number could be from. The charge voltage will go up to 4.2V, or at least it should, but today is 4.1V until the PMIC is programmed for a 4.2V threshold). Apparently…

  • mcb1
    mcb1 over 8 years ago in reply to shabaz +2

    Nice project.

     

    There are LDO regulators that can be lower than 500mV.

     

    We had a very interesting talk about LiPo/LiOn batteries by the battery expert at a local large firm that has them in their radios.

    The…

Parents
  • fustini
    fustini over 8 years ago

    Gerald Coley comments on Google+: https://plus.google.com/u/0/117542001281850354871/posts/jUkFsbVJVHQ

    "A 3.7V battery into a LDO with 500MV drop out designed to create the 3.3V. It is a math issue"

    The battery is at 4.2V right?

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
Comment
  • fustini
    fustini over 8 years ago

    Gerald Coley comments on Google+: https://plus.google.com/u/0/117542001281850354871/posts/jUkFsbVJVHQ

    "A 3.7V battery into a LDO with 500MV drop out designed to create the 3.3V. It is a math issue"

    The battery is at 4.2V right?

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
Children
  • shabaz
    shabaz over 8 years ago in reply to fustini

    Hi Drew,

     

    I'm not sure where the 500mV number could be from. The charge voltage will go up to 4.2V, or at least it should, but today is 4.1V until the PMIC is programmed for a 4.2V threshold). Apparently according to some Varta documentation, a LiPo voltage can go from 4.2V fully charged, to 2.85V fully discharged, and 3.7V is a nominal value. So, perhaps my battery is being under-utilised and I'm charging before it is fully discharged (not necessarily a bad thing - apparently for a high number of cycles, a LiPo should be charged when it is at about 30% of capacity). When the battery is fully charged, I'll try to time it, by making it constantly log or something.

     

    All I can say is it works for me with a single-cell LiPo - I did check the schematic, and didn't see any LDO apart from those inside the PMIC which I checked in the datasheet, and saw a very low dropout value, far lower than 500mV. Maybe I misinterpreted something in the doc or perhaps missed some external LDO on the schematic and it's just lucky for me that it is on a threshold that works :-(

     

    I will also try with a different LiPo, but sadly those don't have a protection circuit, so I've been meaning to throw them out. I have a Li-Ion which I could charge and try.

     

    Here is a clearer photo I just took of the BBB with this mod (using the Olimex battery), I was SSH'd into it over the network at the time too. (The three wires sticking out is just a hack to see the I2C bus contents, because the on-board peripheral I2C bus is not brought out to a header).

     

    • Cancel
    • Up +2 Down
    • Reply
    • More
    • Cancel
  • mcb1
    mcb1 over 8 years ago in reply to shabaz

    Nice project.

     

    There are LDO regulators that can be lower than 500mV.

     

    We had a very interesting talk about LiPo/LiOn batteries by the battery expert at a local large firm that has them in their radios.

    The battery should never exceed what the manufacturer stated, and some are 4.2v, some are 4.1v maximum.

    If they are discharged below the recommended value they require a special charger. Much below that and its not recoverable.

    You charge them with constant current until they reach the float voltage, then then change to constant voltage charging.

    The time for inital and until full capacity is about 2C no matter what rate you set the constant current section to. (ie faster at one end, slower at the other)

     

    Reducing the maximum charge voltage will reduce the amount of energy or cycle, but exponentially increases the number of charge/discharge cycles the battery will take before dying.

    This reduction can be as little as 0.1v.

     

    A fully charged LiPo/LiOn etc is ready to go bang, and obviously is at its most dangerous in this state, store them with half charge was the suggestion.

    All the li batteries are similar, just different amounts of energy available.

    .

    Hopefully I remembered it all correctly.He had some other tips for multi cell batteries....

     

    The purpose of the talk was some of the guys were looking at making their own chargers with cells purchased from ebay or DX.

    These are basically unknown brands, and he recommended trying to find the battery manufacturer (from the markings on the cells) and check what their specs are.

     

    HobbyKing (for us in the colonies) are a better source with more info if there are concerns.

     

    BTW the RC boys always charge outside and use a bucket of sand to put them out......

    Having said that they are usually unprotected multi-cell batteries designed for high discharge currents.

     

    Mark

    • Cancel
    • Up +2 Down
    • Reply
    • More
    • Cancel
  • shabaz
    shabaz over 8 years ago in reply to mcb1

    Hi Mark,

     

    Thanks for the very good information!

     

    I agree totally, and it's really not worth saving a small amount of money for the risk that the battery may not be of good quality, or of unknown spec.

    I once say a battery exploding in a lab in what should have been a controlled charge, but had been mistakenly set to the wrong current by someone (this was not LiPo

    in this instance) and it was not pleasant - batteries within the pack shot their insides out one-by-one until things had cooled down.

     

    With the Olimex one, I left the BBB powered up plugged into DC power overnight (i.e. about 5 hours) and then disconnected the DC power this morning, and started a script that

    just logs the current date/time every minute into a file and sleeps in-between. So it's not doing anything at all.. the network cable was plugged in so Ethernet was up, it may

    save some power if unplugged.

     

    It was running for 1 hour and 20 mins (I was SSH'd in and could see the file growing) before I had to leave to catch a train. I left it running, I'll know more tonight. Sadly I don't

    have high-res voltmeter/ammeters for logging.

    Also, I think for your project, this shows the need for high res voltmeter/ammeter and possibly logging capability during testing.

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
  • mcb1
    mcb1 over 8 years ago in reply to shabaz

    Shabaz

    Interestingly the multi-cell batteries our man spoke of had a flameproof thick cardboard between them to stop the heat transfer in case one went up.....

     

    I have a high res voltmeter, maybe I could use the camera to photograph it .... sort of the minder minding the minder.

    I have been thinking of using a hall effect current meter, but the local offering are +-5A which is too high....I need to look further.

     

    e14 have a good range of Tenma that are cheap but 10M input impedance ( http://uk.farnell.com/tenma/72-7770/multimeter-digital-hand-held-1999/dp/7430566?Ntt=7430566 ), which do simple voltage measurements.

    Cheapest logging version seems to be an Agilent http://uk.farnell.com/agilent-technologies/u1231a/multimeter-digital-handheld/dp/1903369  with IR-USB at 76 pounds.

    Cable is extra.

     

    I've added one into my basket as it's starting to look necessary for a few things.

     

     

    cheers

    Mark

    • Cancel
    • Up +2 Down
    • Reply
    • More
    • Cancel
  • shabaz
    shabaz over 8 years ago in reply to shabaz

    Hi Drew,

     

    It's hard to tell (I may have missed something further, since I didn't make the design decisions!) but I checked the schematic, and as Gerald says, there is a U4 device which I had overlooked. It specified 500mV dropout max when supplying 500mA at 25dec C (and a lower dropout is specified at different current) but I've don't know the maximum load the circuit supplying - according to the schematic, it looked like the two main devices are the eMMC and the LAN chip. I've pasted the information on them below. I couldn't see a 'max' specification for the eMMC.

     

    Regarding the NTC resistor safety, as I understand, different chargers have different strategies for identifying end of charge, and some have some have a level of protection features too, like a safety timer. Some charger IC's are very basic, and do not have any input for an NTC nor a safety timer. The one on the BBB has a protection feature of a safety timer, and for the termination strategy it uses the charge current, when it drops below a certain amount, the charger switches off (it is configurable, and there is a note recommending not to set it at the lowest threshold).

    However, the PMIC is very programmable, and I don't know if these features are programmed or not at startup. They may not be configured today. If the charge termination is not configured and the safety timer is not configured, then it will supply a constant voltage to the LiPo battery, which may compromise safety. If at 4.2V the battery was consuming the maximum that it could draw from the PMIC (700mA I think?) then this is 3W of power that needs to go somewhere. It could explode, or it could dissipate as heat.

     

    But, the battery has another level of protection features too, in this case overcharge protection and short circuit protection, but I don't know more on this. I'm not an expert to suggest an NTC output is mandatory to be added to a battery which already contains a protection circuit (and I have no knowledge of the specifics of the protection circuit in the battery). Maybe it does, I'd have to read up on the topic to know this with more confidence.

     

    So, at a hardware level, it seems as if it is possible to run off a single Li-Po with a reasonable level of performance, but this is just a first-level inspection (and from trying it out), with no good measurements or knowledge of the circuit in detail. User beware.

     

    At a software level it needs to be investigated if the PMIC is configured for safety, and I hope someone does take this on and makes it at least configurable and to document it. I don't think it is, because it is set to 4.1V for example, and this needs to be 4.2V, and it may confuse the charge strategy algorithm and the protection circuits. So some protection should be taken - like an in-built protection circuit, an NTC, or more, but I don't know the extent.

     

    My LiPo (which isn't fully charging since it needs 4.2V), lasted for exactly 2.5 hours today according to the log, so this is a useful amount of time from something that takes up such little space.

    I will charge it up again today and then let it run tomorrow too. I'd like to take some better measurements and results, but this would take a while and I don't think I have all the equipment needed!

     

    LDO:

    LAN:

     

    eMMC:

    PMIC:

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
Element14

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 © 2022 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

  • Facebook
  • Twitter
  • linkedin
  • YouTube