Uninterruptible Power Supply (UPS) for BeagleBone Black – a DIY Project

Authors: Michel and Gernot

The following DIY manual describes an easy-to-implement battery backup module for the BeagleBone Black. This can be useful in certain applications, such as out-door usage where constant power is not present and it is not desirable to just drop power on the BBB board. It was built for a RasPBX setup with the motivation to have a safely powered BBB in all situations. The BBB is unfortunately suceptible to slowly rising supply voltage when powered on. It sometimes does not boot at all, which can be a serious problem after a power glitch. On top, voltage irregularities can cause the device to crash as well.

The battery backup can be applied to any BBB installation, running RasPBX, the original Anstrom Linux or any other distribution. However, USB devices cannot be used while running on battery, as the UPS does not power the USB host port.

The 1950 mAh Li-Ion battery used in this example keeps the board powered for more then 6 hours when running idle most of the time. It is currently in stock for around 36 Euros at Farnell.

The instructions are based on Shabaz’ work documented on Element 14, and have been slightly modified with a different circuitry and used battery type.

WARNING: The modifications presented here can destroy your BBB when not done carefully! The authors of this article are not responsible for any hardware defects that might occur when implementing these modifications. BeagleBone Black power supply MUST be removed before working on it

Another BeagleBone UPS with more simple components is described further down in this topic. In this other small projet 2 leads battery is used instead of 3 leads battery. A Bill of Material is also available. After checking this main tutorial, it is perhaps interesting to have a look at this other small tutorial

Tools

ups2

  • Saw
    • Solder wire
    • Side cutter
    • Soldering iron
    • Wire stripper
    • Screwdriver
    • Metal file
    • Nail file

Bill of Material

Bill of MaterialLithium-ion batteries from Panasonic including NTC, leads and JST connector are available with the following nominal capacity:

  • 1200 mAh (Panasonic CGA-633450)
  • 1950 mAh (Panasonic CGA-103450)

Make sure to buy one of the batteries described by these data sheets: 1200 mAh, 1950 mAh

Prototyping Board

The small prototyping board has been built with a saw and a metal file. All the used components are generally available in local electronic stores. The multi-stranded wires were taken from an old defective PC power supply.

ups5

This is a part of the Texas Instruments TPS65217C block diagram. A bridge between BAT and BAT_SENSE must be soldered on the BBB board.

HOW TO

ups6

The used Adafruit enclosure needs to be modified as shown. Cut off acrylic sheets of
this particular enclosure at the sides. To protect the acrylic sheets during the job, leave the brown adhesive paper on. The red hatched parts need to be removed.

Enclosure Notch

If the enclosure and the BBB are already mounted, it is safe to disassemble them and prepare the enclosure sides as described (see red marks).

Enclosure Mounted

This shows the modified enclosure and the BBB reassembled without the top cover.

Prototyping Board 2

Before soldering components, verify that no tiny copper parts may fall from the small board onto the BBB when installed (possible damage!!). If necessary, use the metal file to carefully remove copper parts that the saw didn’t correctly cut. Clean the board when done.

The components (connector, capacitor, resistor and coloured leads) must be placed along the copper strips parallel to the coloured lines as shown. Also have a look at the solder side further down.
CAUTION: Set the shrouded header in the same position as the picture displays it. When battery connector is plugged into the JST shrouded header, the coloured leads must match the coloured strips as shown. Incorrect header positioning will damage your BBB! The electrolytic capacitor is polarised. Its negative pole needs to be connected to the “GND” copper strip. The shortest lead connected to the capacitor body is the negative pole. Take a look at one of the previous pictures to avoid wrong insertion. Watch the small minus sign on the capacitor side to clearly identify it’s negative pole. Magnify the picture if necessary.

Header

If a header is going to be used, remove one header pin as displayed before soldering. This is done to ensure a safe connection in the correct orientation. A polarising key must be inserted into the matching connector.

IMPORTANT: DO NOT TRY TO DRILL LARGER HOLES. This will damage the BBB because it is probably built with a multi layer PCB. Existing metal coating, within the holes, builds electrically conductive connections between different layers and may not be removed by drilling larger holes.

Although this is not recommended, It is easier and cheaper to directly solder the three leads onto the BBB. In this case the small Harwin crimp housing doesn’t need to be mounted on the three leads (check previous pictures). Before soldering the leads, have a look at the following picture and description.

Bridge

When soldering the coloured leads, a bridge must be made on the BBB between TP5 and TP6 as shown.
Tip: strip off a longer wire part from the red lead before soldering it and use it to make the bridge. Insert the red lead into the TP5 board hole, fold it on the solder side so that the TP5 and TP6 connection can be soldered at the same time.

Leads Soldered

Red lead from the small board connects on both TP5 and TP6 on solder side, yellow lead on TP7, black lead on TP8.

Solder Side

Connect the battery to the shrouded header and place the small board between the enclosure sides and available notches. Place the battery cables into the cable notch.

Battery on Side

Place the battery along the enclosure side, where temperature is lower than on top. The Lithium-ion battery fastened on that side will probably last longer.
Don’t place it inside the enclosure! Eventual battery leaks may damage the BBB.

 

10 thoughts on “Uninterruptible Power Supply (UPS) for BeagleBone Black – a DIY Project

  1. Pingback: วิธีสร&#365...

  2. Pingback: Link: Uninterruptible Power Supply (UPS) for BeagleBone Black – a DIY Project » TechNotes

  3. Ivan

    Hi! Thanks for this manual. But I have a problem. At first I was acting on instructions element14. I used 6000 mah Chinese battery from the tablet and chip U4 TL5209 burned. Please tell me how to use my battery properly. I am unable to order the battery Panasonic.

    Reply
    1. Odobenus

      The TPS65217C power management IC on the BBB has a maximum rating of 3000mA for battery input and a recommended maximum of 2000mA. The element 14 tutorial also suggests a 700mA to 2000mA battery.

      Reply
  4. Michel

    Hello Ivan,

    Sorry that you burned a regulator on your BBB with Element14 instructions.

    But that is precisely because Panasonic battery datasheet was matching TPS65217C PMIC (Power Management Integrated Circuit) requirements that I used it to built this small UPS.
    Check these requirements page 28 of the Texas Instruments tps65217c datasheet.

    Most 3.7V Li-ion or Li-Polymer have only 2 leads. It’s probably the case with your 6000 mAh battery.

    So I suppose you own a 3.7V Li-ion battery with two leads ?

    This kind of battery has certainly onboard security circuit with integrated thermistor or separate security PCB that is placed beside the battery . But in that case, you cannot connect one of the thermistor pole to BBB TP7 connection because the third lead (thermistor) is missing. Element14 instructions suggest to solder a 10 kOhm resistor to simulate this thermistor but a warning tells: “you may or may not wish to do this”.
    That’s what I didn’t wish to do. Without direct NTC connection, the PMIC is not aware of the battery temperature. That’s why I modified slightly the circuitry and used a different battery type.
    In most case that’s perhaps not a problem to put a resistor simulating the thermistor because it seems that the 1400 mAh battery used in Element14 instructions kept a resonnable temperature (Shabaz writes:…I have been using it daily for three months and the battery is always cool to touch). Nevertheless, that’s not the way the onboard TPS65217C is managing power and security. Element14 topic doesn’t describe rising temperature value during charging process. Temperature is, in this case, always rising.

    The other issue, in Element14 instructions, is the SMD resistor soldered between TP7 and TP8. In case of incorrect soldering method, the TP8 connector pin may apply a mecanical stress on the 75 kOhm resistor when battery connector is plugged in or removed. The mechanical stress can change the resistor value if it’s damaged during these operations. Shabaz (Element14 instructions) soldered certainly correctly the SMD resistors (also the 0 Ohm resistor). He probably takes care when connecting or disconnecting the battery and he assumes that his battery is “healthy”. I prefer to think about the worst case in order to prevent users to get fire in their home. That’s the reason why I used a separate small PCB

    I had a look at Farnell’s web site and discover that both 1200 mAh and 1950 mAh are temporarly out of stock. I can understand that it’s a problem for the UPS circuit as most Li-ion or Li-Po batteries are sold with 2 leads.

    I don’t know your 6000mAh battery specifications, so you must be careful when trying to connect your battery.

    I would try to solder an NTC parrallel ( electrically parrallel ) to the 75 kOhm resistor on the small PCB (DIY tutorial).Extension leads length could allow to attach this NTC to battery body. Why this complicate solution ? Batteries may not be documented when embedded in tablets! I want to ensure safety because these batteries may cause heat, explosion and fire if not connected with the correct circuitry .
    I know, it is not an easy task to get these NTC. Local electronic stores don’t use to sell these passive devices.

    I made extensive search to find a electronic distributor selling worldwide to private user. It seems that the following compagny sells quite everywhere: http://www.reichelt.de
    They sell 10 kOhm NTC but transport costs may quickly rise for foreign countries

    I wouldn’t use the white shrouded header type B3B-XH-A on the small PCB. It has anyway three connections and is useless for 2 leads battery.
    So please follow the general DIY UPS guidelines

    1) Power OFF your BBB
    2) As previously mentionned use a 10 kOhm NTC that matches TPS65217C requirements for the NTC specifications at page 28 of the datasheet. If it is the case, connect two extension leads to it and solder them so that the NTC is connected parrallel to the 75 kOhm resistor. Caution: when the small DIY PCB is back in place in Adafruit enclosure, the NTC must be tied to the battery with a sticky isolating tape. That’s the only way to ensure proper temperature sensing
    3) Check your cabling.
    4) Depending of the solution you choose (Red, yellow, black wires soldered on the BBB or crimp housing type M20-1070200 + header soldered on the BBB board), connect the PCB wires (red, yellow, black) to PT5, PT7 and PT8.
    5) Find a sytem that enables you to easely connect or disconnect the battery+ wire to the BAT+ copper strip on the small prototyping PCB.
    6) Also connect the battery- (minus) wire to the GND copper strip on this PCB with the same system.
    7) Power ON your BBB with 5V power supply and depress power button if the BBB didn’t start automatically (may be the case with some older BBB rev version).
    8) If everything was correctly done, the onboard TPS65217C chip will begin charging the battery.

    Bear in mind that these instructions were not yet tested with a two leads battery and there is no warranty that you will reach the result you expected. Also don’t put the battery inside the enclosure but on side of it.

    Last but not least, remember that this small UPS will not power the 5V USB port when “battery mode only” is running.

    Kind regards.
    Michel.

    PS: if I have some time in the following weeks I’ll try to build a UPS with RS-Components battery order number 791-6460 (12,38 EUR) and will check the above mentionned NTC. That could help most private users to more easely build BeagleBone Black UPS.

    Reply
  5. Hannes

    Hi Michel,

    did you have the time testing the above mentioned circuit with a NTC and two wire batteries?

    Reply
  6. Michel

    Hello Hannes,

    Yes I could test a circuit with an NTC and a two wires battery but not with the above mentioned battery and not with the same small PCB that you can see in the DIY project.
    Why ? Because it seems difficult to get some of its components for private people.
    Crimp housing, crimp socket, connectors, even two wires battery are difficult to find. So I decided to get rid of most connectors that were part of the first project. For this new circuit, I just bought the 2 wires battery, 580 mAh 3.7V, from a “hobby shop” (mini RC helicopter spare part). My local electronic store provided the NTC. Also have a look at: http://www.reichelt.de for 10KOhms NTC with B Value= 3977 K
    Instead of writing a long text about this new small circuit, I ‘ll try to take some pictures of it and post them on this forum if you want it ?

    Kind regards

    Michel.

    Reply
  7. Hannes

    Hello Michel,

    thank you very much for your answer. I had the configuration without the NTC running for some days. I have trouble with my BBB but it is not related to the battery management (even works with the battery attached, but does not when only powered from the mains).

    It would be great to see some pictures. Thanks in advance,

    Reply
  8. Michel

    Hello Hannes,
    Sorry to respond so late but I am quite busy at the moment. I really want to give the most complete information about this UPS topic
    In order to help private people to get components at a reasonnable price, and get at the same time a Li-ion battery, I am still trying to find a distributor able to sell outside its own country. Distributor like Sparkfun doesn’t sell Li-ion battery in all points of sale. GoTronic doesn’t sell in foreign countries because of IATA Dangerous Goods Regulations related to lithium batteries. RS-Components doesn’t sell to private people. Some private owners of a BeagleBone Black have limited access to Farnell distributor in a couple of countries…
    http://www.conrad.de in Germany sells batteries and also NTC but a bit expansive for what is to be measured. No need to get precise temperature measures. Important is to stop charging when temperature is too high.
    I got all passive components from http://www.reichelt.de (specially the NTC). They sell outside Germany but they don’t sell 2 leads Li-ion batteries with correct capacitance (+/- 2000 mAh). Anyway they do provide a SANYO 18650 PCB (Li-ion – 2600 mAh) rechargeable battery without leads (price: 11,13 EUR). Buying a battery holder HA 1X18650 SA can solve the problem (price: 1,83 EUR). Correct wire size should connect the battery holder to the small PCB. Isolated wires from a defective PC power supply may be used for that task.

    So stay tuned for the tutorial.
    Kind regards
    Michel.

    WARNING: The modifications presented here can destroy your BBB when not done carefully! The authors of this article are not responsible for any hardware defects that might occur when implementing these modifications. BeagleBone Black power supply MUST be removed before working on it

    BILL OF MATERIAL (distributor: http://www.reichelt.de )
    | Item number | Short description | Price per Unit | Quantity
    | NTC-0,2 10K | NTC-resistor, 0,2W, 10 K-Ohm | 0,37 € | 5
    | SM 10/16RAD | Subminiature-Elko, radial, 10µF/16V capacitor | 0,05 € | 5
    | 1/4W 75K | Carbon resistor 1/4W, 5%, 75 K-Ohm | 0,10 € | 5
    | JUMPER 2,54GL SW | Shorting bar with handle, black | 0,04 € | 5
    | UP 730EP | Strip grid board epoxy, single sided 160×100 mm | 4,12 € | 1
    | SDH 4,8 SW | 1 Pack 2:1 shrink tube, 4,8 mm black | 0,37 € | 1
    | SL 2X17G 2,54 | 2x17pol.-pin header, straight, RM 2,54 | 0,16 € | 1
    | BL 2X25G8 2,54 | 2x25pol.jacknl., straight, RM 2,54, H: 8,5mm | 0,63 € | 1
    | | | |
    | SANYO 18650 PCB | Sanyo Li-Ion highend 18650 cell with PCB | 11,13 € | 1
    | HA 1X18650 SA | Battery holder for 1×18650 cell, 6,35 mm connect. | 1,83 € | 1
    | | | |
    | LITZE SW | Insulated copper wire, 10m, 1×0,14 mm, black | 0,75 € | 1
    | LITZE GE | Insulated copper wire, 10m, 1×0,14 mm, yellow | 0,70 € | 1
    | SDH 1,6 SW | 10 Pack 2:1 shrink tube, 1,6 mm black | 0,25 € | 1

    COMMENT: don’t be astonished to get other prices when buying devices from this BOM. In reality Reichelt applies specific VAT rules related to country destination. For example the JUMPER 2,54GL SW will cost (incl. VAT) 0,04 EUR in Germany, 0,041 EUR in Belgium and 0,042 EUR in Danemark ! Bear in mind that Reichelt requests order for a minimum of 10 EUR and variable transport costs depending on country destination. With items quantities listed in the first BOM part, you can build a least five BBB UPS (excl. battery 18650, excl. battery holder and excl. battery holder leads).

    If you use yellow and black insulated wires,from this BOM, connecting NTC to small UPS PCB, you will also need to use matching shrink tube 1,6 mm black.
    If you use, as I did it, multi-stranded wire AWG 20 ( http://en.wikipedia.org/wiki/American_wire_gauge ) from an old defective PC power supply, don’t waste your money and simply don’t buy both insulated copper wire packs and shrink tube 1,6 mm. But keep shrink tube 4,8 mm as you will use it for bigger wire size (AWG20 for exemple).
    If, you don’t own solid wire (single core wire) to build the two bridges on PCB, just use the resistor remaining leads or capacitor remaining leads to build these bridges. A small shrink tube can insulate them before soldering. For the purpose of this small UPS topic, I used colored wires related to BAT+ voltage (red) and GND (black) but, of course, both could have the same color.
    In any case don’t use wires from this BOM to connect a battery holder to the small PCB mainly for safety purpose (wire size, insulation thickness and rated temperature withstand).
    The best choice for a battery holder would be silicone rubber insulated wires but they are difficult to find in small quantities and are also expensive.
    Don’t hesitate to put some shrink tube on NTC leads and separately on battery leads to protect them from cutting enclosure edges (Adafruit enclosure). Use a metal file to slightly round enclosure cutting edges

    Items in the list can be checked on http://www.reichelt.de .
    Just fill the “search field” on that web site with “item number” from the above first column list (copy and paste).
    If you do know other distributors that sell also multi-stranded wires AWG20 yellow and black in small quantities, don’t hesitate to post a comment on this site.
    It took me quite a lot of time searching a distributor selling almost everywhere in the world to private people. I gave up searching as I found this one, but I suppose that Reichelt is not the only one.
    http://www.elv.de is also well known and seems to sell outside Germany but their web site is displayed only in German. Take care with “rechargeable battery”, it’s called “Akku” in German. This company sells a 3,7V Li-ion 18650 sized battery wherelse I bought the 3,6V labelled version by Reichelt. This 3.6V battery withstands anyway the 4,2V max charging voltage (datasheet in German). There is a typo related to the battery internal resistance in this datasheet. It should be 151 mOhm and not 151 MOhm. This 2600 mAh Li-Ion battery keeps the board powered for more then 7 hours when running idle most of the time. The following picture shows the first prototyping board with a 3,7V 580 mAh Li-ion battery.

    For safety purpose, remember that soldering battery leads will be done in the final soldering step .

    Micro BeagleBone Black UPS

    Bear in mind that this small PCB is a DIY prototype. I am not very satisfied with its mechanical stability inside Adafruit enclosure. A better design should be to enlarge the board, put a second header and a jumper near Adafruit enclosure side to mecanically balance the PCB. Enclosure top cover should then better maintain it when closed.

    HOW TO

    Micro BeagleBone Black UPS - PCB details

    Two notches in a small prototyping board (continuous strip, hole spacing: 2.54 mm x 2.54 mn) (0.1 in x 0.1 in) are made with a small saw. Counting the hole number is an easy method to locate component position. When proceeding, two copper strips must be cut in the middle between holes as shown on above picture. A board corner needs to be removed for safe soldering process (size of 2×2 holes).
    Before soldering components, verify that no tiny copper parts may fall from the small board onto the BBB when installed (possible damage!!). If necessary, use the metal file to carefully remove copper parts that the saw didn’t correctly cut. Clean the board when done.
    The board itself will be populated with a 75 KOhm resistor, 10 µF electrolytic capacitor, NTC leads, BAT+ and GND bridges .
    The following passive components will also be used and are rated 3A:
    - 2,54mm (0.1 in) pitch DIL Vertical Socket
    - 2,54mm (0.1 in) pitch header
    - 2,54mm (0.1 in) jumper
    Jumper is shown in one of the last pictures. It will be removed when battery is not in use and BBB mains supply disconnected. That is safe to avoid battery discharge. Even if not used, charging battery from time to time is recommanded.

    If other components are used, it is safer not to operate components rated less than 3A .
    In fact, charging current won’t probably exceed 500 mA. BBB consumption will probably be +/- 320 mA running RasPBX (with network connection only) but safety is a major concern. This UPS is mainly built to keep a running RasPBX during and after power outage (no data corruption).

    Micro BBB UPS Socket

    In order to cut a 2×2 socket, remove 2 pins before cutting with the saw as described on left picture. When done, one header pin is removed from the small socket as described on right picture. It is suggested to immediately place a polarizing key on top of this socket in the space left by header pin (see following picture). A wood toothpick with some glue at one end will easily fit in it. Don’t force it in the socket. After glue drying time, cut and remove wood toothpick. Doing this immediately will hopefully prevent future wrong socket positioning on PCB before soldering.

    Micro BeagleBone Black UPS - Zoom view

    Electrolytic capacitor needs its minus pole to be connected to GND copper strip. Check its “minus” sign on it before soldering.

    CAUTION: battery leads without connector has a serious drawback. Battery is generally loaded when leads are soldered on the PCB. This can cause personal injury during soldering process if not done carefully. Even if feasible, soldering battery leads is not a safe choice. If no other solution is available (for example using an empty battery holder with leads) follow these steps:

    - If possible wear safety glasses before doing the job.
    - Before soldering battery leads, make sure that all other components are correctly soldered on the PCB (including NTC leads)
    - Battery “plus” lead (+ sign) is then soldered first on PCB (battery red lead in general) meanwhile battery “minus” pole (- sign) is isolated from any PCB strip.
    - Check if neighbour copper strip, that has to be left isolated from power supply (see one of the previous picture comment), has not been accidentally soldered to battery “plus” copper strip .
    - Check also if neighbour GND copper strip has not been accidentally soldered to BAT+ copper strip. If possible, isolation measurement should be done with an Ohmmeter. If a short circuit has been detected, this fault has to be repaired first.
    - After this test and eventually repair, battery black lead (minus pole) should be soldered on the most outer PCB hole as shown on above pictures. The PCB corner was removed specially to avoid short circuit between “plus” and “minus” pole during soldering process. That’s why BAT+ pole must be soldered and checked before soldering BAT “minus” pole (GND).

    Micro BBB UPS Header

    Micro BBB UPS Bridge

    The PCB is just plugged into the 3 header pins to mount on BeagleBone Black (see picture).
    Tip: a nail file is used to smoothly round the header pins edges on their solder side, so they easily fit in BBB holes (TP5, TP7, TP8 holes). Also not to forget is the bridge to be soldered between TP5 and TP6 (on BBB solder side).
    IMPORTANT: DO NOT TRY TO DRILL LARGER HOLES. This will damage the BBB because it is probably built with a multi layer PCB. Existing metal coating, within the holes, builds electrically conductive connections between different layers and may not be removed by drilling larger hole diameters.
    ADVICE: I discourage soldering the small black socket onto BBB board and mating header on the small UPS PCB. Socket pins easily fit in BBB holes and header pins unhappily not. This other way of building the UPS could be attractive ! But if this method is used, the header, powered by battery voltage, could inadvertently touch components on the BBB board and destroy them, specially if the jumper is left on the header (see jumper on last picture). Soldering the black socket on the small UPS PCB is safer.

    Micro BeagleBone Black UPS - Left side view

    Jumper is not plugged into PCB header until all components are correctly installed.
    Correct temperature sensing is a safety concern. It is suggested to put some glue between NTC isolated leads and battery body, not onto NTC itself. An adhesive tape may stick them together during glue drying time.

    Micro BeagleBone Black UPS - Right side view

    Barrel connector from power supply is connected to BBB (not shown on this picture) , than power supply is connected to mains, jumper is plugged into PCB header. Depressing BBB power button starts the device.

    Micro BBB UPS - Battery 18650 holder sized with Li-ion 3,6V 2600 mAh Sanyo battery - Cable assembly

    Building the BBB UPS with an empty battery holder, instead of directly soldering battery leads on the PCB, is safer.
    When using battery holder, take care of battery holder leads colors. Battery + and – signs are available inside the battery holder. Be sure to solder red lead (BAT+) on the correct battery holder termination.

    Micro BBB UPS - Cable assemby details

    Important: as the PCB stability inside the enclosure is not correctly assured, it is suggested to make 2 notches in Adafruit enclosure side with a metal file and build this cable assemby as described on picture.
    CAUTION: You may want to use a hair dryer to shrink 4,8 mm tubes without directly blowing hot air on BBB components, battery or PCB components. Use home made deflector to avoid any dammage. Mind your fingers !!

    Micro BBB UPS supplied by a 18650 sized Li-Ion battery (3,6V - 2600 mAh)

    Battery holder has snap-on feature. If you want to use it, three holes need to be done in the Adafruit top cover. (2 holes for the snap-on feature and an additional hole to avoid wrong positioning). But Ty-Rap may also be used instead.
    Finaly the way battery is inserted in battery holder is the most important step to avoid BBB damages. So place battery + pole in the correct position !!!

    Battery leads correctly tied up

    Battery leads tied up.

    Connecting mains power supply and network interface

    Battery is automatically charged when mains power supply is connected.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *


6 − = five

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>