Intelligent NiCd/NiMH Battery Charger using PIC16C711

This cheap and easy to build NiCd/NiMH Battery Charger is suitable for automatically charging a wide range of batteries for many applications. Proper chargers are usually expensive and cheap chargers supplied with the original equipment often incorrectly charge the cells and dramatically shorten their life. This ‘intelligent’ charger was designed for high current and rapid charge applications such as cordless power tools and model racing cars. These battery packs are expensive and sometimes difficult to purchase. This charger uses the cell manufacturer’s recommended charge method, to safely and quickly charge batteries.


As a handyman myself I have a certain amount of power tools. The power source of cordless tools ranges from 3.6V to 18V and almost inevitably consists of Sanyo or Panasonic NiCd/NiMH cells, despite the actual brand of the power tool itself. Properly treated, these battery packs should be good for hundreds of charges and could potentially last many years.

board perspective

Recently I found my 2-year-old 9.6V cordless drill battery wouldn’t perform to its rated capacity after charging. Unfortunately the battery packs are fairly expensive to replace, sometimes costing almost as much as the entire drill kit, if in fact you can purchase the batteries separately at all. Often you will get told to just “buy a new drill”. It is cheaper to purchase your own cells and use the old case to manufacture a battery pack, if you can do the soldering of the battery tags (Note: don’t solder directly to the batteries as is damages them and is quite dangerous).

In selecting replacement cells, I researched the manufacturer’s specifications on charging and guess what? The battery charger that came with the drill didn’t comply with these specifications. In other words, the supplied battery charger is a very simple device that applies constant current to the battery pack. There is no charge termination method used by the charger. During the recharging process, once batteries reach their 100% charge, the cell starts to heat and the internal pressure builds up, causing the battery to eventually rupture or vent electrolyte.

Having paid good money for a new battery pack, I decided to design a new charger that would not damage the battery. I decided from the specifications and from my preferred style of use (throw it in the charger and expect it to be good next time I reached for it) that the design of a better battery charger would require the charger to sense the condition of cells and charge accordingly.

To perform this task requires a device that measures, remembers and controls which state the charge should be in, and when coupled with some complex characteristics that rechargeable batteries can exhibit, it seemed to me that logic control circuitry was required. I wanted to keep the design as simple as possible, and reduce the component count, because reducing the size and number of holes in the PCB is the major cost driver in circuit manufacture. I soon realised that the simplest design would be a one-chip design, and that was to use a PIC. (PIC stands for the PIC16C711 Peripheral Interface Controller and is a registered trademark of MicroChip). If you don’t have a PIC programmer, don’t panic! This component is available inexpensively from the author of this project. Other than this, very simple and commonly available components enable this project to be completed for about $50, which is a lot cheaper than your next battery pack!


NiCd/NiMH Cell Characteristics

Even if you don’t want to build this charger, you can still stand to gain something from this article by understanding how to get the most from your rechargeable batteries. To start with a cell is defined as a single vessel containing electrodes and electrolyte for generating current. A battery consists of two or more cells. NiCd/NiMH cells are rated at 1.2V for design purposes although they normally develop about 1.25V. Under full charge they require about 1.5V to 1.6V. They can supply very large amounts of current and display a remarkably flat discharge characteristic, maintaining a consistent 1.2V throughout discharge. The voltage then drops quite suddenly, and they are almost completely flat at 0.8V. This is called the “knee” characteristic because of the shape of the graph of voltage against time.

Rechargeable battery capacity is rated in mAH (milliampere-hours). The total capacity of a battery is defined as “C”, that is it can supply C mA for 1 hour, or 2C for 30 minutes etc. Charge rates can vary from trickle charges to keep the battery ‘topped up’ of 3.3% of C to 5% of C, a slow current charge of 10% of C to 20% of C or a fast charge of 50% of C to 100% of C. Slow charges are not meant to be continually applied, and since NiCd/NiMH batteries are about 66% efficient, they normally last about 8-15 hours. Fast charges such as 100% of C should be terminated after about 1.5 hours, providing the battery is flat to begin with. Once a battery is fully charged, the battery produces gas creating a high internal pressure, and a sudden rise in temperature. The charge should be switched to a trickle charge at this point or the battery will begin to vent and release its electrolyte. My old battery was rated at C=1300mAH and my old charger was rated 400mA (30% of C) so the charger should have been switched off after about 4 hours, provided that they were almost flat to begin with. However there is no way of knowing if C was actually 1300maH or if it had decreased a bit, and once the a battery starts to deteriorate, I suspect this becomes a vicious cycle and the battery deteriorates rapidly due to more and more overcharging. The manufacturer suggests these cells should be good for 500 to 1000 cycles if properly treated!


The Memory Effect Myth

Possibly the biggest myth that exists partcularly for NiCd cells is the “memory effect”. Almost every one quotes it as the reason that cells have to be completely flattened – otherwise they develop some sort of memory, and can only hold a partial charge from there on. Like all good stories, this one has a grain of truth in it! The myth originated from the early days of satellites when they were using solar cells to charge batteries and because of the orbiting of the craft around the earth, the batteries were subjected to precise charge/discharge cycles many hundreds of times. The effect disappears when the battery cycle is suddenly varied, and it is extremely difficult to reproduce this effect even in a laboratory. So the “memory effect” is not a significant problem in home usage.

What I can tell you is while it may be OK to discharge individual cells to 0V, it is certainly not recommended to discharge an entire battery of cells. The reason is simple. When the battery is discharged below 0.8V per cell, one of the cells is inevitably weaker than the others, and goes to zero first. If the battery is further flattened this battery becomes charged in reverse, which again makes it still weaker. This creates a more common but less commonly known effect called “voltage depression”. Eventually the battery’s performance drops off quite suddenly which ironically is the very thing that the user is trying to prevent. Most users know where the battery’s “knee” occurs; it is when the original equipment first starts to show signs that the battery performance (and hence voltage) is suddenly dropping, and it is a good idea to place it straight on charge at this point. Usually there is less than 5% of C remaining anyway.

One other thing, batteries don’t like getting too hot or cold; they do not take a full charge and they actually discharge (even under no load) much faster when over 40 degrees or below 0 degrees. They can build up internal heat when working and this can cause temperatures inside to increase also. Particularly avoid leaving cordless tools inside a hot car for this reason. They also should be left to cool down for a while after discharge before placing them on charge. NiCd/NiMH batteries do self-discharge too, as a rule of thumb a battery will hold a full charge (with no load) for about a month or two, although when they get old or hot, they might only last a day.

So what can you learn from this?

  • You don’t have to flatten your battery before you recharge it,
  • Don’t flatten your battery below 0.8V per cell,
  • Don’t overcharge your battery beyond 100% of C, and
  • NiCd/NiMH don’t like to get too hot, or too cold (0 to 40 degrees C is usually best)


For more detail: Intelligent NiCd/NiMH Battery Charger using PIC16C711

Current Project / Post can also be found using:

  • pic16c711 battery charger
  • car battery charger with pic microcontroller
  • pic 16c711 for nimh battery
  • picaxe nimh charger

Leave a Comment

= 3 + 3

Read previous post:
pick-up coil
2.5 GHz Frequency counter using PIC16F870

Background It is time to update the frequency counter again. A frequency counter is one of the most important measuring...

Scroll to top