Arduino-powered Ni-Cd Charger?

Hello all,

Recently I bought a two-way motorola radio from China on ebay. The radio itself works great with the car 12v adapter, and I've been using it a lot without any complaints.

Now, the battery charger is a whole different story. While the battery was still being shipped (by boat, customs laws or something) I thought I'd look inside the charger to see how it worked. To my surprise it was little more than a 14v transformer hooked directly to the battery terminals. Yikes! (The battery is a 7.5v Ni-CD battery with a 1200mAh capacity)

So I'm looking to use the existing charger shell and make an arduino-based charger that can sense when the battery is done charging and switch off the charger. Only problem is I really don't know how to measure how charged the battery is. I've read up on the different ways to sense the charge (?V, Temp) and to save time, parts, and money I'm going to go with -?V. Now, what I don't understand and what many forum threads have failed to explain to me is how you can sense this change in voltage if you're already supplying a constant voltage to the battery.

My basic plan as of now is to have the power supply (the 14v transformer from above) running through a resistor to bring the current down to the 1C charging rate (1200mA). A relay will control whether or not this power goes to the battery, and this will be controlled by the arduino to cut off when it senses the voltage drop. But, the part I'm missing is how you sense this drop in voltage if you're already putting 14v into it. There have been mentions of voltage divider sensors, but these all assume I have a regulated source of current when all I'm using in reality is a transformer and a resistor.

TL:DR: How do you sense -?V of a Ni-CD when you're already supplying a constant voltage and current?

Thanks for your help.

Are you sure the 14v transformer hooked directly to the battery terminals?
look like it had to connect to the charger base before connect to battery.
The charger base had circuitry to monitor the charging state of the battery.

"Smart" charge protocols for NiMH and NiCD batteries charge at constant current, then when the negative delta V point is reached, switch to constant voltage trickle charge.

It seems a waste to use an entire Arduino for this, so why not use one of the many chips and DIY breakout boards available? A little searching will turn up lots of examples, but here is one: Smart DC Charger Module for NiMH battery Pack 2.4V - 7.2V (0.5A)

The goal was in part to find a way to do it without buying anything using parts I already had.

However, I had made already a circuit using this tutorial but thought I could do something with the arduino since I had one laying around.

I changed it a little so that it could directly use the three-wire AC from the transformer. I suppose I could change the topic of this thread to this circuit as it seems like the simplest way to go. Would this circuit even work right? The stuff I've read on charging Ni-Cd batteries seems to tell me "no."

Thanks for the input guys.

A circuit similar to that could work, but in your schematic, T1 (2N2222) is drawn upside down and in that configuration will not function correctly. I'm not willing to guess whether the other components are correct, and it looks like the circuit depends on the LEDs having well specified forward voltages. I suggest to simulate the circuit using LTSpice to check.

Yeah, that was an accident. But, LtSpice is way too confusing for me, and there is really no feedback about that circuit either, so I've started another idea, a slow overnight charger for the battery using the C/10 charging rate.

I would love to know if there are any errors in this code. It's supposed to open the charging relay for 14 hours as well as flash an LED to notify me of the state.

#include <Event.h>
#include <Timer.h>

// Papkee's Simple Ni-CD Charging Circuit
// For use with slow charge current (C/10 where C is battery capacity in mAh)

int relay = 4;
int button = 1; // Number for external interrupt, pin is pin 3
int led = 5;

long chargetime = 14*60*60*1000; // Charge time in Milliseconds

int chargeTimer;

char state = 1; // 1 is Idle, 2 is charging, 3 is done
int ledstate = 1;

Timer t;

void setup() {
  pinMode(relay,OUTPUT);
  pinMode(led,OUTPUT);
  attachInterrupt(button, intbutton, LOW); // Make the button an interrupt
  state = 1; // Charger just turned on, it's idle
  t.every(1500, flash); // Call the flash function every 1500ms
}

void loop() {
  
  t.update();
  
  if (state == 1) { // If the unit isn't charging...
    if (ledstate = 1) { // Set the LED to the proper state (from the flash timer)
      digitalWrite(led, LOW);
    } else if (ledstate = 0) {
      digitalWrite(led, HIGH);
    }
  }
  
  if (state == 2) { // If we are charging something...
    digitalWrite(led, HIGH); // Keep the LED on
  }
}

void intbutton() {
  if (state == 1) { // If we aren't charging...
    state = 2; // Now we're charging
    chargeTimer = t.after(chargetime, finished); // Turn on the charger for the charging duration.
    digitalWrite(relay, HIGH);
  } else if (state == 2) { // If we ARE charging...
    t.stop(chargeTimer);
    digitalWrite(relay,LOW); // Now we're not charging
    state = 1;
  }
}

void finished() { // Function to call when the timer is finished
  state = 1;
  digitalWrite(relay, LOW);
}

void flash() { // Change the state of the led every time this function is called
  if (ledstate == 1) {
    ledstate = 0;
  } else if (ledstate == 0) {
    ledstate = 1;
  }
}

This is my first practical bit of code so I'm hoping I did everything right.

Just a thought -- The charge controller might be inside the battery pack.

The charger circuit works fine. This LTSpice simulation models the NiCD cell with a 1 farad capacitor in parallel with a 1K resistor, and uses an 8.2 V Zener diode -- the closest available that come with LTSpice. You would want to use a lower voltage Zener. The simulation includes models for blue and yellow LEDs.

The green trace shows the battery voltage, leveling at about 8.2 V while the blue trace shows the charge current, starting at 110 mA. The bottom red trace shows the yellow "charging" LED switching off while the cyan trace shows the "charged" blue LED switching on.

NiCD_chg.asc (2.05 KB)

jremington:
The charger circuit works fine. This LTSpice simulation models the NiCD cell with a 1 farad capacitor in parallel with a 1K resistor, and uses an 8.2 V Zener diode -- the closest available that come with LTSpice. You would want to use a lower voltage Zener. The simulation includes models for blue and yellow LEDs.

The green trace shows the battery voltage, leveling at about 8.2 V while the blue trace shows the charge current, starting at 110 mA. The bottom red trace shows the yellow "charging" LED switching off while the cyan trace shows the "charged" blue LED switching on.

Wow. Thank you very much for that, I couldn't figure out how to test it in LTSpice. Looks like I'll be building this over the coming week.

Thanks for all your help guys.