Showing posts with label batteries. Show all posts
Showing posts with label batteries. Show all posts

2020-05-03

Build your own Tiny USB Battery

Background


After having successfully built a few tiny USB batteries in the past, I was always left with a bit of frustration about the difficulty to build them. My previous model has been working flawlessly for the last 2.5 years now despite the hackish way it was built, that's undeniably a success!



Once I got my laser engraver and managed to create some quite fine PCBs, I thought it might be a good use case to try to make a PCB for this tiny battery project. This would save me from having to destroy existing PCBs and would make the project much more replicable. It would also standarize the power LED and the button that were added as a hack on top of the previous one. Last thing I wanted was to increase the output voltage to 5.2-5.4V in order to compensate for cable losses, especially when powering various single-board computers (SBC) which drain a lot of power and tend to become unstable under 5V.

Creating a PCB for the battery.


I already mentioned, I'm not good at using Eagle, I find it pretty complicated to do trivial things, even though maybe it allows to easily do complex things. Thierry Fournier offered some help on the project as he's much more fluent with Eagle than I am. He first created the library of components, the schematic matching my needs, and a dual-layer PCB. To be honest I wasn't very impressed with the resulting size, and attributed this to the dual-layer design: vias take a lot of room, and some of the components there appeared large enough to support having copper tracks passing underneath them.

So based on Thierry's schematic I tried my luck with a single-sided approach. I moved and rotated components around until I managed to route it without a single via nor strap. A first version was created, at about 33x22mm, with the charge and power connectors on two adjacent sides:


The result was already quite good:


Given that I had 240mAh batteries of exactly 30x20mm I really wanted to squeeze it further, which led to the final version documented here, whose PCB is 30x20mm, exactly the battery's dimensions.

The result is great, it's flat on one side (PCB), flat on the other side (battery), with the components in the middle between the two. The final version is very dense and requires careful placement of the SMD components, but I had no problem soldering them all with a thin solder iron tip (0.2mm) and thin solder wide (0.5mm). The USB connectors are both on opposite sides this time:


In fact for the final version I even tried my luck with solder paste. For this I produced the GCODE for the stencil mask in Eagle, and used it to cut holes in a 150 microns-thick Post-It paper. It appeared to be exactly the appropriate thickness for the paste. I attached it with duct tape to the PCB and scraped some solder paste on it:


But it seems that paper is not that great for solder paste, it seems to extend a little bit while pulling the paste, and it looks like some places were slightly thicker than expected, probably because more paste accumulates in corners and isn't totally removed.  I purposely did not put paste on large components like the inductor nor for the USB connectors' ground because I didn't want to risk seeing them move under the heat gun and ruin the rest of the circuit, I preferred to solder them by hand.

Despite not being perfect, the result remains impressively good though, and there were very few errors, so I think it will have to be attempted again, maybe with Kapton tape, or with sticking paper, I don't know yet.


Looking closer, it appears that some of the micro-USB connector's solder joints were joined together, that that the capacitors were not properly soldered. This is because they were salvaged from an older PCB (all components were desoldered) and were not clean enough for the solder paste to properly take on them:


This is why I said above that I had to re-solder a number of components using the soldering iron's tip. However the solder paste is very convenient for the IC's thermal pad under the package, which must be connected to the ground plane. And fortunately the IC was properly placed.

Choosing components


The module is still based on a TP5400 or TP5410 IC. The only difference I found between the two is the resistor value to program the charge current, any can be used. One nice thing about this circuit is that it contains a 4A switch with a low on-resistance, and that the voltage sensing is external so it's trivial to adapt it to increase the voltage a bit (there is even such an example in the datasheet).

I salvaged most of the components from a previous TP5410-based module. I wanted to use a higher current inductor. I found that 2.2 and 4.7 uH do work fine and allow the module to deliver up to 2.5A and even peak up to 2.8 at 4.5V output. It's better not to do this for too long though because the IC cooling is performed through the PCB on a single side and is a bit less efficient than the one from the original design. I soldered the battery's positive terminal directly on the inductor's pin:


Regarding the battery, I used LiPo batteries made for drones. The 602030 ones are perfect. They must withstand at least 15C of discharge capacity. However most of these batteries have an internal protection board and most of them are of poor quality resulting in a huge voltage drop as the current increases, to the point of being barely capable of delivering 1.5A under 5V. It's not very difficult to remove the board from the battery, but I'd rather find some unprotected batteries to avoid this annoying step. Till now I didn't find any (the rare ones available are reported as out of stock).


I intended to use a 0.2 Watt LED driven by a 39 ohm resistor, but found that I had in stock a few PCBs salvaged from 220V LEDs. These ones are made of series of five 0.5W LEDs in parallel in a very compact form factor. So I used these PCBs as a replacement for the power LED and reduced the resistor to 15 ohms, after successfully trying 18 ohms on the first version. This gives me roughly 0.5W of LED power without overheating the LEDs, which illuminates very well in dark stairs or in my garage for example.


The USB connector on the final version was larger than expected because I ordered short ones (10mm) but due to lockdown measures in place here I still haven't received them, hence the reason why on the final version it's a bit too deep, and the button was placed slightly outside to align with it.



Some users might prefer to put a male USB-C connector (e.g. to charge a smartphone). But this would require a protuberant part which risks to be damaged. Also instead of a micro-USB connector for the charge it should be possible to use a USB-C female connector. But micro-USB is still more available for me, and this matches what most existing batteries do. Also, there exist tiny USB-A to micro-USB adapters that insert directly into a USB port and which automatically provide a male micro-USB connector. Maybe these even exist for USB-C now, I don't know. The ones I have look like this:



As an enclosure, I used transparent heat shrink tube, then filled everything inside using hot glue, just like for previous models. This keeps the device very compact and solid. I tried throwing it on the ground and it doesn't have any problem. Maybe some people will want to try 3D-printed enclosures, or even molded plastic.



Download files


The source files (schematic, board and library) as well as the output files (schematic in PNG, board in PNG and PDF) are available here. There's nothing particularly tricky in the assembly process, except maybe hacking with the battery's connections. It's particularly important to be careful not to make a short circuit while soldering the battery, especially the one without the protection board! I don't have any good recipe for this except lots of care.


There's a dual-color LED to indicate the charging status. The common track is the anode (+), the left LED (connected to pin 2) is the red one (indicating it's still charging), and the right LED (connected to pin 4) is the greed LED (indicating standby mode or end of charge). The layout was made to also support installing individual LEDs (which I did on my second version). When connected to a charger, it should light red during charge and green once fully charged. The LEDs are never lit without a charger.


Tests and conclusions


With a 602030 240mAh battery, which is roughly 0.9 Wh, I can power my GL.iNet WiFi router for about 1 hour. This makes an ideal companion to every WiFi/3G pocket router! Below it's connected to my GL.iNet either with a short USB cable or with the tiny adapter shown above.



I can also use my bike's powerful front light for about 20 minutes at normal power level, or about 10 minutes at full power (6W), which is more than I usually need when crossing woods at night.

At this point it goes beyond a proof of concept as it's possible to build them by hand in about 2 hours, including the battery modification. What takes most of the time is finding suitable components like the high current inductor, or soldering tabs on the LED bar. But for anyone able to source components, the circuit has nothing difficult.

I think that these dimensions are really great, I don't feel the battery in my pocket and have it with me every day. I've even replaced the v3 that I had been using since last article. Some people might prefer to have a bit more energy. There are slightly larger batteries with even more capacity. I like a lot what can be found in the range of 800 to 1200 mAh, with widths up to 35mm and lengths up to 45-50mm. But many of them are much thicker, up to 10mm. It's possibly not that big of a deal when using a thinner PCB, as it's possible to save one millimeter here.

Another idea would be to replace the flat, empty PCB surface with a solar panel and have it charge the battery. But at such dimensions, even the most efficient panel would take ~10 hours in full sun to charge a small battery so it doesn't seem really interesting in the end.

Overall I'm extremely satisfied with this design. The next step for me would probably be to be lucky to find it pre-made by someone who can design complete devices and source the components! I think I'd be OK with paying up to about $5 for such a device, maybe a bit more if the capacity gets slightly larger, provided the strong power is still present.

2018-11-11

Replacing 2 AA 1.5V batteries with 2 AA lithium batteries

Context

My digital camera (Canon A2100 IS) uses 2 AA cells as its power source, as can be seen on the photo below from the review site above :
This was one of the reasons why I selected this model, because I didn't want to have to discover that the battery is depleted when I need it, and AA batteries are easy to find. I replaced the batteries long ago with NiMH rechargeable batteries, but the camera is a bit picky on the input voltage and cuts off long before the batteries are depleted.

Failed attempts

NiMH - NiCd

I tried both NiMH and NiCd batteries just in case the discharge curve would be better on these last ones, but none really stands out of the lot. Below 1.2V approximately, the camera complains.

Lithium 1.5V batteries

I found long ago a very interesting type of 1.5V lithium AA batteries made by Kentli. These batteries are in fact made of a smaller 3.7V lithium battery inside, followed by a DC-DC converter to emit a constant 1.5V voltage. They're pretty good for what they are doing. But they are not suitable for this type of device. Indeed, their output voltage regulator suddenly cuts off once the battery's capacity is too low, and the regulated output prevents the camera from indicating it's going to stop working. Not only it's unpleasant to discover that the battery suddenly is dead when you want to take a photo, but it usually fails with the lens out and exposed without protection which is not fun at all. Ideally such batteries should lower the output voltage near the end so that the powered device detects the situation and can gracefully shut down or warn the user. But for torch lamps and laser pointers these ones are perfect.

Single LiFePo4 cell

I was thinking that there's always some margin in devices designed to be powered by batteries, so if two completely charged AA cells can provide about 3.1-3.2V, surely a single LiFePo4 cell (3.2-3.3V approx) would be fine as well. Such batteries are easily found on the net, sold with a spacer made of a simple wire, to replace the second battery without adding any extra voltage.


The problem with LiFePo4 is that the battery capacity is very low, 600-650 mAh on average so in the end I had an even shorter duration than with the NiMH ones.

Single Li-ion cell

I figured that since the LiFePo4 cells send 3.6V to the device once fully charged, there's probably still a bit more margin, so I decided to try a regular 3.7V Li-ion cell (which reaches 4.2V when fully charged), again with the spacer to replace the second battery.

The first difficulty with these batteries is that their advertised capacity is most always fake, so it's very hard to spot valid ones unless you're willing to pay the price. For this size in Li-ion it's reasonable to expect 800 to 900 mAh, not more. Also, at less than $6 per cell it's a low capacity one. But it's not a universal law since it's possible to find expensive ones which are fake as well :-)

Aside the difficulty to select the correct battery, it turns out that the voltage is perfectly suitable for this camera. The camera only warns once the battery is really depleted, and doesn't suffer from the extra voltage. I figured that I'd just have to spot a serious battery and would have an acceptable capacity with the ability to recharge it with a regular Li-ion charger. But isn't it too bad to lose half of the capacity in the spacer ?

Successful solution found

I spent two hours figuring the best type of batteries I'd need to go further and I ended up picking unprotected and flat battery cells. They are slightly shorter than the regular ones because they're designed to support installation of a small protection PCB if needed. I found this, made by Sanyo, which are apparently genuine given the capacity I tested (about 850 mAh each) :


Then I figured that I could install the two in the reverse direction, and connect them in parallel, negative to negative and positive to positive using wires, and isolate one side of each battery so that the resulting block is still two batteries with a single battery voltage. Thus I tried.

First, I prepared the batteries by cutting pieces of the isolation layer in order to solder them together. For this, the batteries need to be installed flipped and aligned. The minus pole should slightly stand out compared to the plus pole, which will receive some solder :


Then using my soldering iron at maximum power, I managed to solder them together without heating the batteries too much :


Finally, the two positive poles were connected together using a piece of wire. A bit of extra solder was installed on top of the wire to make a button which will help make good contact inside the camera :


And that's done! I now have a 3.7V, 1700 mAh battery that presents itself in the same form factor as a set of two AA batteries and which delivers its whole capacity before the camera shuts down. The main difficulty I had was that the space between the two batteries in the camera is very tight and I had to minimize the solder's thickness to let the battery block in. I also had to install some polycarbonate tape on one side to ensure that the metal part closing the battery holder doesn't short-circuit the positive and negative poles.

Unfortunately I didn't figure how to photograph my camera with the trap opened to see the batteries installed, but it's easy to imagine on this block on the photo at the top.

What is nice is that I can still charge it using a regular Li-ion charger supporting 14500 to 18650 batteries. Let's see how long it will last now.

Modding an RC transmitter to support lithium batteries

Context

From time to time with a few friends we play with these RC cars but the problem is always the same : the transmitters require 4 AA-sized batteries. Since we have 4 cars, it means we need to find 16 charged AA batteries before going outside. It often takes much more time to find and test them as the time required to charge the cars themselves! This made me wonder if it would be possible to replace them with a set of USB-rechargeable lithium batteries that are more easily available and easier/faster to charge.

Hardware inspection

The transmitters look like this (outside and battery holder) :


After removing the 7 screws holding the two sides together, the internal board is accessible. Following the wires with a multi-meter shows that the jack plug is connected to the battery through a diode, and that the battery directly connects to this small LDO voltage regulator through the power switch :


The marking "CA33G" indicates an AIC1734 LDO voltage regulator providing 3.3V from up to 12V in. It is said to feature only a 250mV drop at 300mA. I tried with an adjustable power supply and found that the board consumes only 61mA and that the regulator provides 3.3V starting with 3.44V in (144mV drop only). Better, this voltage drop is maintained for lower input voltages and the board seems to work fine down to 2.5V!

Thus I don't need these 4.8-6V input. Using a single lithium battery from 3.5 to 4.2V will be far more than enough. No need for any DC-DC converter either. And given the low power draw, a small one is usable so that I don't have to modify the battery holder.

Solution

I decided to go with some salvaged cellphone batteries. The one photographed here is a BL-5B with a capacity of 890mAh. It includes discharge protection. I simply had to glue a small dirt cheap USB lithium battery charging board to it (you can have 3 of them shipped for less than $1). Then just solder it to the battery connection pads with hanging wires slightly longer than the battery itself. I measured the self-discharge caused by the charging board, it's around one micro-amp so it will need 100 years to discharge the battery. This saves me from having to install switches or connectors.



It is necessary to put some solder tin on the pads before soldering the wires in order to reduce the total heating time and prevent the plastic around from melting. But that's really all. Oh, and of course, it works :-)

I closed everything, installed the battery inside a small plastic bubble protection bag to save it from moving inside, and I can now quickly charge it simply by opening the battery holder and connecting a micro-USB connector to the battery.

Final note

A small note, the charger used above provides 1A by default, some are sold pre-configured to 500mA (just need to change the 1.2k resistor). It's better not to charge small batteries to strongly or they will not last long. Also the charger will stop around 10% of the configured load, which could be reached much earlier than a full charge for smaller batteries. I've already patched two transmitters this way with batteries I had in stock. For next ones I'll probably use 250mAh batteries made for mini-quadcopters, which will provide 4 hours of operation and support being charged in only 20 minutes.

2017-12-09

Tiny USB batteries v3

A bit of background

Since my last experiment at shrinking down USB batteries to fit in my pocket, I made a few observations resulting in new improvements :
  • it's becoming hard to find mini-USB cables these days, while there are micro-usb cables everywhere
  • the previous battery was still a bit thick due to the use of two boards, one for the charge and the other one for DC-DC conversion
  • sometimes I used the battery with a small USB-based LED to walk downstairs at the office, and I'd rather have this LED incorporated.

Migrating to micro-USB

I initially thought about just replacing the charging board by a new one. Most TP4056-equipped boards nowadays come with a micro-USB connector. But while looking at this, I started to think about the other aspects and considered some charging+DC/DC boards as well.

Reducing the thickness

I found a number of new DC/DC boards but as some readers may remember from my previous experiments, most of these are unable to deliver even 1A, let alone the 1.6-2A that I need for my bicycle's light. But recently a few very capable chips appeared : TP5400 and TP5410, equipping a few boards such as these ones.

I bought 5 of these boards and ran a few tests. They are able to deliver 5V at up to 2.8A max from 3.8V in. So there's some hope to run everything with a single board. I bought the version without the USB connector to try to optimize component placement.

 
The board is mostly flat on one side and mostly flat on the other one. Thus I decided to cut the board in two to split the charging part from the discharge part to stack all the components (the charge only needs the micro-USB connector and a few leds).



Default USB connectors are very high. Instead I picked a recessed USB connector, which perfectly fits aligned with the PCB. That makes a very thin board+connector. The coil became the tallest component so I tried a few other smaller ones I had, and ended up using a small 10 µH one.

I reinstalled the output decoupling capacitors against the USB connector and close to the output diode, which I doubled to reduce losses (there was enough room).


The charging LEDs and their 1.2k resistor were installed directly on the charging chip's leads. I don't need direct visibility, the hot glue I'll use to finish the assembly is translucent enough to make the green/red colors pretty visible.


I also noticed during a few experiments with such a board in a previous design (v2n never documented), that the TP5400/5410 stop charging at 1/4 of the programmed charging rate. While it's possible to charge small batteries in 15-30mn, it's problematic to cut off at 1/4 of the rate because they're far from being charged, in part due to the losses in the battery's protection circuit. So I had to replace the programming resistor (1.2k by default) with 4.7k and finally 10k to lower the charge current to around 200 mA (the TP5400 and 5410 have slightly different currents for the same resistor).

I kept the small part of PCB attached to the micro-USB connector as a more convenient support for this connector.


After completing this assembly, I just had to reconnect the battery to the circuit and verify that it could still deliver power and charge. The battery still needs to be a high rate one. I'm using 20C at 240mAh, that's 4.8A max output. When the battery is about to be discharged near 3V, that's still 14.4W, or 2.88A under 5V assuming 100% efficiency (which never happens), so that doesn't leave much margin in the end! Given that TP5410's internal MOSFET supports up to 4A, it's important that the battery is at least that strong. That's 25C for 160mAh, 20C for 200mAh, 16C for 250mAh, 12.5C for 320 mAh.


The resulting assembly with a 240mAh battey is very thin as can be seen below, 12mm thick, 20mm wide and 34mm long. There's very little wasted space now, which is noticeable when filling it with hot glue because very little glue is needed to keep the parts together.


Adding an integrated LED-based torch

I found that some unused space was left next to the USB connector. Just enough to place a powerful LED, a button and a resistor. So I cut two pins from a small button, soldered a 39 ohm resistor to it with the other end connected to the +5V output. The other end of the button was connected to the LED's anode, whose cathode was directly soldered to the USB connector providing the ground. This way pressing the button delivers 60mA into the LED and makes quite a bright torch.


As for v2, I simply placed two crossed layers of heat shrink tube, one in each direction, completely covering the connectors and the button, thus completely closing any hole. Then I just cut the tube around the USB connectors and the assembly is finished. The tube is soft enough to let the LED button be pressed through it.


Final thoughts

I spent a lot of time trying to figure the best way to assemble the parts together. I even hesitated to make a PCB. That may be for v4. What I figured, which will be useful for future designs (and for anyone willing to make a commercial version of this) :
  • the coil is approximately the same height as the USB connector. It must be placed behind it.
  • the IC, diode(s) and capacitors are approximately the same height. It's not really possible to stack them in a production version, but they should probably be placed in the same area.
  • the micro-USB charging plug doesn't need to be exactly on the opposite of the USB connector. I found that it could be placed on one side, possibly over the IC, diodes and capacitors if one is found with long legs or wires. It could even be glued on top of the IC.
  • all resistors and LEDs are very flat and should be placed below because they will not inflate the board's thickness by any measurable size.
  • the recessed USB connector is critical here to keep the device thin
  • the PCB could possibly be rotated 90° and be as large as the battery is long. The USB connector would then be placed on a small area, and all the components including the micro-USB, the press button and the white LED could be installed on the remaining part of the PCB
  • in any case, the battery should be placed on top of the USB connector and components. This also makes the top mostly flat and reduces the length of wires between the battery and the PCB.
An example of more efficient component placement is this one :


Feel free to copy this design and improve it. I'll be happy the day I can simply buy such a small pocket battery without having to spend a week-end building it myself :-) Do not hesitate to share suggestions and comments of course!





EDIT: 2.5 years later the new design above was finally realized: battery v4