Battery Regulator- part 1


Background: So, I am building this electric car, using SLA batteries and a Manzinita Micro charger. Need battery regulators, have been unable to find a currently available solution, decided to build my own.

This project is virgin territory for me in many areas- circuit design, board layout… but I thought it would be fun, and potentially useful.

On Friday I received my first ever two layer professionally made circuit board! I ordered it through Advanced Circuits barebones service, and it looked like this:


The first challenge went just as planned- see how that RJ-45 jack fits right on there, and how the ATC fuse holder footprint is just fine. It’s been all downhill since there…

The board uses an AVR chip to read the voltage of up to 3 attached batteries. It determines when the batteries are filling up and uses a power transistor and resistor to shunt the charging current so that the other batteries may continue to charge. So the main subsystems are the optocoupled power transistor circuit, the analog optocoupled volatge sensor circuit, and then the AVR support circuits. I’m saving the communication circuit for later.

I decided to start with the power transistor circuit. The schematic I used to make the board looks like this:


If you look at it carefully, it has about 5 things wrong.

-Pinout on 2N2222 is WRONG. This causes the emitter to be attached to ground. In my unwise trust that everything would work on the first go, I attached 12v to the battery terminal, then jumpered +12v to the base of the 2N2222. It popped.

-That’s not actually a darlington configuration. Really. It’s not. That aside, why did I attach the collector of the 2N2222 to the negative bus? What was I thinking!?

-It’s not visible here, but the KiCad stock footprint for a TO-220 has the pin numbers in different places from the actual pinout of the power transistor- so once I tried to test it without the 2N2222, it wouldn’t do anything. No current anywhere- I was a little amazed that I had screwed up two whole pinouts. I’ve definitely learned my lesson now.

So, I did some reworking of the traces, and got it working. Kind of. Current flows freely when the 2N2222 base is energized, and nothing overheats or pops throughout the voltage range of my power supply. BUT when the 2N2222 base is not energized, or pulled low at around 8v input the power transistor starts conducting, up to about .3 amps at 12v. Since it’s not at saturation, it also gets warm, fast. When I disconnect the collector of the signal transistor, this stops happening. So I don’t know.


Consulting the 2SD2528 datasheet (why didn’t I do more of that before?) confirms that it’s minimum beta is 500, so it should draw around 5ma of base current for saturation at 2.5 load amps- I’m pretty sure the phototransistor optocoupler can supply that. So, today I will be working from that angle- maybe what I should have done from the beginning.

And, like the boss I am, I decided to visit my friends in Davis this weekend, brought a lot of equipment but forgot some parts at home- who knew it would be so impossible to get your hands on some SIL or DIL pinheaders on the road! I have billions of ’em at home!

On a positive note, the analog optocoupler circuit seems to work well. Thank you Gordon Stallings! Even though that particular optocoupler is not available, I used a similar one and it seems to work fine. (in fact, there seem to be no DIP package analog opto’s available through Digi-Key. This one is SOT-5, fun!) I haven’t checked linearity yet, but I’m optimistic.

Posted on February 28, 2009 at 12:39 pm by Henry · Permalink
In: Battery Regulator

Leave a Reply