Oftentimes, you will find yourself wanting to make one of your electronics projects portable. And you can’t exactly do that when you need access to a power outlet from the wall. That’s where batteries come into play. They come in all sorts of sizes and different chemistries, but one of them has risen to be the most popular today. And those batteries are Lithium Polymer or Lithium Ion batteries. What sets them apart from other batteries, such as Alkaline or NiMH batteries? Well, in this video I’ll explain what sets Li-Po batteries apart from other batteries, how to charge them, and how to put them into one of your circuits.
Let’s begin by talking about the characteristics of these batteries. And for anyone wondering, for our purposes, Li-Po and Li-ion batteries are essentially the same. Anyways, based on the internal chemistry, LiPo batteries are able to be produced in very thin and compact packages, although they can be large as well. The best part about this is that even though these batteries are very lightweight and compact, they still have impressive capacity and power output. This is my old android phone, and if you open it up, you’ll find a LiPo battery inside. This is part of the reason why phones are so thin these days, and also why LiPos are so popular. The other batteries, for the most part, aren’t capable of being so thin and powerful. But enough with the physical construction, let’s get to the electrical characteristics.
Here are a few batteries that I have either salvaged, or bought online for the purpose of demonstration. LiPo batteries have a nominal voltage of 3.7 volts per cell, which you may notice is much higher than other battery chemistries. NiMH batteries only have a nominal voltage of 1.2 volts per cell. This increased nominal voltage is a big part of why LiPo batteries are able to have such large capacities, since you only need one cell a lot of the time. As for the maximum and minimum voltages, there is quite a large range. Generally, the maximum voltage of a LiPo cell is 4.2 volts. There isn’t exactly a hard-minimum, but it’s generally recommended to consider 3 volts as empty, or else you risk permanently decreasing the capacity of the battery.
Ok, while all of this talk about voltages is great, let’s get to actually using one of these. I’ll be using this rather small LiPo cell, and we will be hooking it up to the project I made in my very first video. If you didn’t watch, basically, the whole circuit runs off an ATmega8a, which has a voltage range of 2.7 to 5.5 volts. And as I just said, the minimum voltage of the LiPo cell is 3 volts, and the maximum is 4.2 volts, which is well within the acceptable voltage range. With that, its possible to simply directly connect the battery to VCC and GND. And as you can audibly hear, the circuit works perfectly fine.
And while this example is cool, some of you may have already noticed that this setup does not protect the battery in any way whatsoever. In this case, its most considerable in its lack of over-discharge protection, which keeps the battery ‘healthy’ so to speak. A lack of over-discharge protection actually depleted this LiPo. To protect it, you could possibly monitor the voltage using the microcontroller’s analog pin, but I’ll dive deeper into battery protections in a minute, since I think it’d be best to talk about charging first.
Most lipo battery charging processes are fulfilled in two parts. The first is in the constant current charging mode. In this mode, the charger applies a voltage to the battery that will flow into it at a specific current, usually 1C. And if you are wondering, one ‘C’ is equal to the capacity of the battery. So, for example, this 40 mAh battery’s C would be 40 mA. Once the battery has reached about its maximum voltage, which is 4.2 volts, the charger then switches into constant voltage mode. From here, the current slowly decreses until the battery can be considered fully charged. Easy enough to understand, but before you go to charge your LiPo batteries with your power supply, you should be warned to be careful, because we have all seen those videos of LiPo batteries exploding when they are improperly handled. Let’s look at some dedicated chargers.
Let’s start with an off-the-self component. For this purpose, I have chosen this TP4056 charging board. You can have these for cheap on places like ali-express and amazon. This board is used for both charging, and also discharging, and comes with several protection features, such as overcharge protection, over-discharge protection, short-circuit protection, and overcurrent protection. Before I connect the battery, let’s make sure that the settings are correct. I’d prefer to charge my batteries at 1C, instead of the flat 1amp that it is set to by default. Looking at the TP4056 ic datasheet, we can see that we can select the charge current by selecting the resistor on the program. Let’s change it to 400 mA to match this battery. We can select our resistor with this simple math equation: 1200 / your resistor in kOhms. After some algebra, we get a resistor of 3 kilo ohms. But I don’t have any 3k SMD resistors, but I do have 5.1k resistors, which gets a current of 235 mA. This will mean slower charging, but it’ll still work. And after desoldering the old one and placing the new resistor, we are ready to start testing.
Let’s make sure that the charging process works as expected. I attached 5 volts to the input from my supply. I measured the voltage and current throughout, and after an hour I put the data all into this graph. And you can see the points in which the charger switches from constant current to constant voltage mode. Now, we’ll make sure that the discharge protection works properly. I attached a load, and made sure that it turns off when the battery is empty. When the voltage got down to 3 volts, we can see that the output gets cutoff. So this board can be used to both charge and discharge the battery within the same circuit. You can even use it while it is charging.
And just like I showed earlier, this board is perfect if your project can fit within a voltage range of 3 to 4.2 volts. Most AVR microcontrollers fit into this specification. But I am aware that sometimes a certain component of your project requires 5 volts, and that’s where boost converters typically come up. You can find all sorts of boost converter boards like this one online, and you can adjust the output to five volts. And the boost converter should maintain those 5 volts no matter where in the discharge process the battery is. There is an all-in-one solution, which are those PowerBoost Adafruit chargers. They are very expensive for something like this though, so its up to you what you decide to do. Its also worth nothing that these chargers will not work for multi-cell LiPos. This is because while charging, they may become unbalanced and have different voltage levels between cells. But thats a topic for future videos.
After all of this testing of an off-the-shelf component, I figured I could take a shot at making one of my own. So I got on my computer and researched for a LiPo charging IC, and found this MCP73831 Li-Po charge controller. This IC will allow us to choose our charge current in the same way as the TP4056. It also comes with a neat little LED charge indicator. But this IC is mainly focused on charging, so we should get another IC for protection features. And I found this BQ29732 IC. It protects against overcharge, over-discharge, charge overcurrent, discharge overcurrent, and short circuit protection. So, all around a good option for battery protection. It also requires two mosfets, for which I picked a couple of SMD ones, which were ridiculosly big in hindsight. Afterwards, I designed a PCB and then had it mailed to me. I also opted for the SMD stencil to make soldering easier.
After verifying that I had all of my components, I realized that I somehow messed up the USB port, but it really shouldn’t matter, since we can still test it. Anyways, I then applied the solder paste using the stencil. I placed my components on top of the solder paste. From there, I took this hotplate and placed my PCB onto it. The strategy behind it is really simple, just wait for all of the solder to melt, and then take the board off. I repeated the tests on this board to ensure that it works as well as the TP4056, and well there are some problems with it. The charging doesn’t seem to work at all, but the battery can still output its voltage. The good news is the battery protection IC works. And when I place a 10 ohm resistor on the output, the voltage drops to 0 until the load is removed. This is rather unfortunate, but I guess I’ll just have to use the TP4056 until I get around and fix whatever is wrong with the circuit.
So, there you have it! You should now be able to power your projects using batteries. Whether you decide to use a pre-made TP4056, or make your own circuit, you should be able to safely use a LiPo in your project. If you got this far into the video and learned something new I’d like to direct you to my buymeacoffee page. These videos take a long time to make, and I want to keep making better and better videos for you. Plus, if you get one of the memberships you can get sneakpeaks into my future videos and supplementary files such as the PCB layout used to make this battery charger. Anways, thanks for watching. Have a good one!