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
BeagleBoard
  • Products
  • Dev Tools
  • Single-Board Computers
  • BeagleBoard
  • More
  • Cancel
BeagleBoard
Blog BBB - Rechargeable on-board battery system
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join BeagleBoard to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: shabaz
  • Date Created: 9 Aug 2013 11:53 PM Date Created
  • Views 19493 views
  • Likes 18 likes
  • Comments 129 comments
  • 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).

 

image

 

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):

image

This is what they look like:

image

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.

image

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.

image

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.

  • Sign in to reply

Top Comments

  • shabaz
    shabaz over 12 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 12 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 12 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.…
  • Former Member
    Former Member over 10 years ago

    I'm attempting to run the BBB off of battery only, but I seem to be missing a step.

     

    After plugging in the battery, the board is not reacting. I soldered the resistors and the JST battery connector, then plugged in a fully charged 3.7V lipo battery.

     

    Any insight?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • w6wdh
    w6wdh over 10 years ago in reply to shabaz

    Hi shabaz,

     

    The problem is in the Debian 3.8 (Wheezy) kernel.

     

    The kernel does not shut down properly.  There is a known bug that causes a kernel panic on shutdown:  http://bugs.elinux.org/issues/39

    Apparently some PMIC code is not being executed after the panic, so the +3.3V power and the +5V power do not get turned off, and that drains the battery.

    Output from the kernel serial debug port on my BeagleBone Black:

     

    root@beaglebone:~# halt

     

    Broadcast message from root@beaglebone (ttyO0) (Wed Feb 17 18:08:06 2016):

    The system is going down for system halt NOW!

     

    root@beaglebone:~# Sending SIGTERM to remaining processes...

    Sending SIGKILL to remaining processes...

    Unmounting file systems.

    Unmounted /sys/fs/fuse/connections.

    Unmounted /dev/mqueue.

    Unmounted /sys/kernel/security.

    Unmounted /sys/kernel/debug.

    Disabling swaps.

    Detaching loop devices.

    Detaching DM devices.

    [  390.811724] (NULL device *): gadget not registered.

    [  390.824449] Power down.

    [  390.829354] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000

    [  390.829354]

    [  390.838921] [<c00114f1>] (unwind_backtrace+0x1/0x9c) from [<c04d0add>] (panic+0x59/0x15c)

    [  390.847463] [<c04d0add>] (panic+0x59/0x15c) from [<c0033a8f>] (do_exit+0x5ff/0x68c)

    [  390.855459] [<c0033a8f>] (do_exit+0x5ff/0x68c) from [<c003dfe1>] (sys_reboot+0xf9/0x174)

    [  390.863909] [<c003dfe1>] (sys_reboot+0xf9/0x174) from [<c000c841>] (ret_fast_syscall+0x1/0x46)

     

    This is output from the standard Debian 3.8 kernel image from November 2015, with 'apt-get update' and 'apt-get upgrade' done in the vain hope that a patch for this bug would have been applied.

     

    Robert Nelson investigated the bug (see the bugs.elinux.org link).  He measured the +5V current drain at 0 Amps after the panic, and figured that the board shut down OK.

    Perhaps he did not check to see what happens if a battery is attached.

    He also said the problem is fixed in the 3.12/3.13 kernel releases.

     

    I downloaded Debian image 8.3 from the http://beagleboard.org/latest-images site and got kernel 4.1.15 (Jessie).

    Good news!  It does shut down properly and the battery current drops to 40 µA.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 10 years ago in reply to w6wdh

    I don't see this behaviour at all : (

    Here are my results (tested tonight), measured with a Fluke 175 on the 10A range since I didn't want to exceed its other 400mA range. So my resolution is 1mA for these measurements, and there will be a few counts error.

    My battery was not fully charged (have not used it in months) but was not fully discharged either.

    Software image: bone-debian-8.3-lxqt-4gb-armhf-2016-01-24-4gb.img running from microSD card, not eMMC, since my BBB is the older 2GB eMMC variant, and I have not made the mods for battery capability on my 4GB model yet.

     

    These steps were done in sequence, one after the other:

     

    1. DC jack connected, Battery connected, Linux running: -150mA (a negative value since it is in the charging direction)

    2. Press power switch and wait for Linux to shutdown

    3. After graceful shutdown is complete: Around 1mA

    4. Press power switch again, and let Linux start up: -150mA (Battery charging)

    5. Disconnect DC jack: 330mA briefly, then drops to around 160mA as Linux shuts down gracefully

    6. After graceful shutdown is complete: 1mA

    7. With DC jack still disconnected, press power switch: 350mA or so (fluctuates up to 400mA occasionally)

    Linux is now running, and current is around 330mA but drops to 180-200mA as the clock slows down (presumably)

    8. Press power switch, and measure after graceful shutdown: 1mA

     

    All the time I did this test, I was monitoring the console (i.e. serial) from header J1, so I could see for sure that Linux booted up to the Linux login prompt (also logged in with my username/pass to confirm) and to see when it had powered off.

     

    What I observed after Linux had started:

    Debian GNU/Linux 8 beaglebone ttyS0
    
    
    BeagleBoard.org Debian Image 2016-01-24
    
    
    Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian
    
    
    default username:password is [debian:temppwd]
    
    
    The IP Address for usb0 is: 192.168.7.2
    beaglebone login:

     

    Shutdown messages (snippet of last few messages):

    [  OK  ] Reached target Shutdown.
    [  OK  ] Reached target Final Step.
             Starting Power-Off...
    [   65.477395] musb-dsps 47401c00.usb: otg: usb_otg_unregister_hcd: device not registered to otg core
    [   65.607753] reboot: Power down

     

    For the test I had nothing connected to the BBB apart from the battery of course, and the serial cable, and the DC jack power was connected/disconnected as mentioned above.

     

    I can't think what is different between your setup and mine that could cause the discrepancy : (

    My battery was a typical LiPo, 3.7V 2000mAH rating, connected into the BBB using the procedure mentioned in the blog post.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • w6wdh
    w6wdh over 10 years ago in reply to shabaz

    Hi Shabaz,

     

    Indeed, the short and the 10 kΩ thermistor are attached to the battery side connector, to make the battery removable.

     

    The 75 KΩ resistor is called for by the Texas Instruments TPS65217 Power Management IC data sheet, which says (page 31):

    By default, the [TPS65217] device is setup to support a 10 kΩ NTC with a B-value of 3480. The NTC is biased through a 7.35-kΩ internal resistor connected to the BYPASS rail (2.25 V) and requires an external 75-kΩ resistor parallel to the NTC to linearize the temperature response curve.

     

    TPS65217 data sheet, portion of Figure 15. NTC Bias Circuit:

     

    image

     

    I have a 10 kΩ NTC (negative temperature coefficient) thermistor taped onto the LiPo cell with Kapton tape, and a 75 KΩ resistor (0603 size) soldered on the BeagleBone Black between TP7 and TP8.

     

    I made up an extension cable for the battery connector so I can connect a digital voltmeter (set to measure DC amps) in series with the battery and measure the battery current.  I removed the cape, so it's just the bare BeagleBone Black Rev C.

     

    The battery current measurement results with no cape connected:

     

    39.3 µA     Connect battery, connect +5V to power jack, boot Debian Linux, measure battery current

    36.3 mA     Push POWER switch S3 and wait for Linux to shut down, measure battery current

    36.0 mA     Connect battery, connect +5V to power jack, boot Debian Linux, disconnect +5V from power jack, wait for Linux to shut down, measure battery current

    21.9 µA      Continuing from last measurement, disconnect battery and then reconnect it, measure battery current

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 10 years ago in reply to w6wdh

    Hi Bill,

     

    I've not checked in a while, but last time I measured (a few months back) current consumption dropped to

    tens of micro-amps in the shutdown state with the battery connected (and others saw it drop to under a mA too according

    to some comments further above). I don't have any capes connected for my measurement. What was the reason for the 75k resistor?

    The 10k resistor was needed because it simulates the expected value for a thermistor at room temperature.

    75k could be an error condition (but would need to check the PMIC datasheet).

    If you're trying to cater for both scenarios (with and without battery connected) you might need to attach the

    10k resistance (i.e. a resistor or thermistor) and short on the battery side of the connection, not on the BBB side if

    you wish to make it removable. In other words, no need for a 75k on the BBB (unless you have a specific reason, or

    some information in the PMIC datasheet).

    Can you confirm current without the cape connected, just to double-check that you too can reach similar levels of

    current consumption?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • 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