Mainly but not limited to my attempt to build a MiWi wireless home control and security network.

Saturday, March 05, 2011

Part I:: Inexpensive Micro Controller Battery Backup using NiMh


My network has been making slow progress. I have switched from RS485 to Zigbee to MiWi. After a fair deal of work it became clear to me that ZigBee was bloated. MiWi provides the same mesh network but has a much smaller footprint.

In this post I will be talking about my progress on developing a battery backup for NiMh cells without buying a chare controller chip.

The general idea is to use the LM317 as a constant current source for charging. The current plan is to use a 7-12V wall wart as a power source. The node will reduce that to 3.3V for its use and use the original wall wart voltage as input to the LM317 to charge the battery.

NiMh Theory
Lets start introducing some terms we ill be using.
C is a cell or battery capacity in mAh or mill Amp hours, In theory a 100mAh cell would deliver 100mA of current for 1 hour or 50mA for 2 hours.

Working C. The actual C of a cell or battery as opposed to what is printed on it.

Voltage Threshold is the lowest voltage a cell should be discharged to.

The following illustrates the discharge curve for a NiMh cell. Image is from 4gdo.com, they have a NiMh FAQ at http://4gdo.com/batfaq.htm.


Each curve is for a different discharge rate based on the cell's capacity C.

The only difficulty with NiMh chemistry cells is knowing when they are fully charged. Several methods can be used. For the time we will limit the discussion to single cells rather then batteries.
  1. Stop after charging for a specific time period.
  2. Continuous charge at .1C or less.
  3. Stop when the cell voltage has peaked and is falling.
  4. Stop when the cell has stopped increasing in voltage.
  5. Stop when the cell temperature reaches a temperature limit.
  6. Stop when the cell temperature increase per unit time exceeds a limit.
I will talk about each method but first you need to know that when the cell is fully charged it continues to draw current. Unfortunatly the current is used to drive an exothermic process that produces oxygen. If too much oxygen is produced it is vented. Because oxygen is lost the process can not reverse and the cell suffers a decrease in capacity.

The 1st method assumes every battery is fully discharged. Unless the battery is fully discharged it will be overcharged reduce the capacity.

The 2nd method works well but for the fact that the 'working C' decreases with time. Some people may not like the time required.

The 3rd and 4th methods monitor battery voltage. When a cell has charged to its full capacity its voltage stops increasing for a period then falls. The 2nd method stops charging when a decrease in voltage has been detected. The problem with this method is that cells can show false peaks especially at low charge rates. Some cell heating will occur while waiting for the cell voltage to drop.

The 4th method is similar to the 3rd but stops charging when the cell voltage stops increasing. This method stops charging sooner after full charge. This is (dV/dt) method with zero as a limit.

The next two methods are for fast charging only. This is when the current is above 0.5C. These methods require the addition expense of at least one temperature sensor. Possibly one per cell. They are unsuited for my use for this reason.

The 5th method is know as TCO or Temperture Cut-Off. Stop charging when a temperature is reached.

The 6th method is (dT/dt) Rate-of-temperature rise. In method we monitor how fast the temperature is increasing and stop charging when a limit is reached.


NiMh cells have the nasty property of reversing their polarity if they are discharged below their voltage threshold. For this reason it is best to use cells of like 'working C' in a battery.

Our Method
It is said the NiMh will not reach their full potential till they have been charged and discharged several times. This should be done on the bench prior to putting the cells into service.

We will be using a variation of the 2nd method which is continuous charging at .1C or less.
  1. Batteries are modified to include a sense wire per cell.
  2. The first time a batter is charged it will continue to charge till each cell remains at a fixed voltage for 30 minutes. This max voltage maxV is recorded for each cell.
  3. The battery voltage is monitored and charged each time one or more cells fall below maxV. If a cell can not reach the existing maxV, maxV is updated and a notification is send.
  4. A notification is send any time a cell reaches (maxV-x) unless the mains power is out.
  5. If the mains power is out periodic voltage updates (hourly) are provided.

For experimental purposes I am working with a surplus cell phone battery from Electronic Goldmine. At this point I do not know the working C of these batteries.


The battery consists of 3 AAA cells and had a stated C of 750 mAh. It is small but the lower currents make it easier to work with. It cam we 3 wires: red, blue, and black. Removing the black plastic carrier reveled that the blue and black wires were both grounds. The battery is NOS and arrived with each cell at aprox 0.8V.

The battery was rewired with 4 wires total. The two additional wires were placed at the junction of the 1st and 2nd, and the 2nd and 3rd cells.











I verified the schematic on a solderless BB then created a PCB for additional testing.











0 comments:

Contributors