Introduction: 2 Cell NiMH Battery Protection Circuit(s)

Picture of 2 Cell NiMH Battery Protection Circuit(s)

If you came here, you probably know, why. If all you want to see is a quick solution, then jump right ahead to step 4, which details the circuit I ended up using, myself. But if you're not quite sure, whether you really want this solution or something else, you're curious on the background, or you just enjoy visiting some interesting spots on my voyage of trial and error, here's the elaborate version:

The problem

You have some electronics project that you want to power using rechargeable batteries. LiPo is the battery technology du jour, but lithium batteries still bring some bad habits such as not having a supermarket-ready standard form factor, requiring special chargers (one for each form factor), and behaving like real drama queens when mistreated (catching fire, and stuff). In contrast, NiMH rechargeables are available in standard form factors from AA to AAA to whatever, meaning you can use the same batteries for your digital camera, your flashlight, your toy RC car, and your diy electronics. In fact, you probably have a bunch of them laying around, anyway. They are also much less renowned for causing trouble, except, one thing they really don't like is getting "deep discharged".

This problem becomes much more severe, if you are using a "step up buck converter" to increase your input voltage - say to 5V for powering an arduino. While your RC car will move slower and slower as your batteries are being depleted, a buck converter will try hard to keep the output voltage constant, even while the input voltage is dwindling, and so you could suck the last few electrons out of your battery, without any visible sign of trouble.

So when do you have to stop discharging?

A fully charged NiMH cell has a typical voltage of around 1.3V (up to 1.4V). For most of its duty cycle, it will supply about 1.2V (its nominal voltage), dropping slowly. Near depletion, the voltage drop will become quite steep. Commonly found recommendation is to stop discharging somewhere between 0.8V and 1V, at which point most of the charge will have been used up, anyway (with a lot of factors affecting the exact numbers - I won't go into any more detail).

However, if you really want to push the limits, the situation you should be wary about is draining your battery to below 0V, at which point it will suffer serious damage (Warning: Remember I'm discussing NiMH cells, here; for LiPos permanent damage will start much earlier!). How can that even happen? Well, when you have several NiMH cells in a row, one of the batteries may still be near its nominal voltage, while another is already fully depleted. Now the good cell's voltage will continue pushing a current through your circuit - and through the empty cell, depleting it below 0V. This situation is easier to get into than it may seem at first glance: Remember that the voltage drop becomes much steeper towards the end of the discharge cycle. Thus even some relatively minor initial differences between your cells may lead to very different remaining voltages after discharging. Now this problem becomes more pronounced, the more cells you put in series. For the case of two cells, discussed, here, we would still be relatively safe to discharge to a total voltage around 1.3V, which would correspond to one battery at 0V, and the other at 1.3V, in the worst case. There is not much point in going this low, however (and as we will see, that would even be difficult to achieve). As an upper boundary, however, stopping anywhere above 2V would seem wasteful (though, AFAIU, contrary to NiCd batteries, frequent partial discharges do not pose an issue for NiMH batteries). Most circuits I will present will aim slightly below that, to around 1.8V as a cut-off.

Why not simply use an off-the-self solution?

Because that does not appear to exist! Solutions are abundant for higher cells counts. At three NiMH cells you could start using standard LiPo protection circuitry, and above that, your options only become wider. But a low voltage cut-off at or below 2V? I for one could not find one.

What I am going to present

Now, fear not, I am going to present you with not one but four relatively easy circuits to achieve just that (one in each "step" of this instructable), and I'm going to discuss them in detail, so you will know how and why to modify them, should you feel the need. Well, to be honest, I do not recommend using my first circuit, which I'm simply including to illustrate the basic idea. Circuits 2 and 3 do work, but require a few more components than Circuit 4, which I ended up using, myself. Again, if you're fed up with theory, just skip ahead to Step 4.

Step 1: The Basic Idea (this Circuit Not Recommended!)

Picture of The Basic Idea (this Circuit Not Recommended!)

Let's start with the basic circuit above. I do not recommend using it, and we'll discuss why, later, but it is perfect to illustrate the basic ideas, and to discuss the main elements that you'll also find in the better circuits, further down in this instructable. BTW, you can also view this circuit in a full simulation in the great online simulator by Paul Falstad and Iain Sharp. One of the few that does not require you to register in order to save and share your work. Don't worry about the scope lines at the bottom, yet, I'll explain those near the end of this "step".

Ok, so in order to protect your batteries from being drained too far, you need a) a way to disconnect the load, and b) a way to detect when it is time to do so, i.e. when the voltage has dropped too far.

How to switch the load on and off (T1, R1)?

Starting with the first, the most obvious solution will be to use a transistor (T1). But which type to pick? Important properties of that transistor are:

  1. It should tolerate enough current for your application. If you want a generic protection, you'll probably want to support at least 500mA, and upwards.
  2. It should provide a very low resistance while switched on, so as not to steal too much voltage / power from your already low supply voltage.
  3. It should be switchable with the voltage you have, i.e. something slightly below 2V.

Point 3, above would seem to suggest a BJT ("classic") transistor, but there is a simple dilemma associated with that: When putting the load on the emitter-side, such that the base-current will be available for the load, you will effectively lower the available voltage by the "Base-Emitter voltage drop". Typically, that is around 0.6V. Prohibitively much, when talking about 2V total supply. In contrast, when placing the load on the collector-side, you will be "wasting" whatever current goes through the base. That's not much of an issue in most use cases, as the base-current will be on the order of a 100th of the collector-current (depending on transistor type), only. But when designing for an unknown or variable load, that means wasting 1% of your expected maximum load, permanently. Not so great.

So considering MOSFET transistors, instead, these excel on points 1 and 2, above, but most types require considerably more than 2V gate voltage to switch on, fully. Do note, that a "threshold voltage" (V-GS-(th)) slightly below 2V is not enough. You want the transistor to be far in the on region at 2V. Fortunately there are some suitable types available, with the lowest gate voltages typically found in P-channel MOSFETs (the FET equivalent of a PNP transistor). And still your choice of types will be severely limited, and I'm sorry to have to break it to you, the only suitable types I could find are all SMD packaged. To help you across that shock, take a look at the datasheet for the IRLML6401, and tell me you are not impressed by those specs! The IRLML6401 is also a type that is very widely available at the time of this writing, and should not set you back more than around 20 cents a piece (less when buying in volume or from China). So you can certainly afford to fry a few of those - although all of mine survived despite the fact that I'm a beginner at SMD soldering. At 1.8V at the gate it has an resistance of 0.125 Ohms. Good enough to drive in the order of 500mA, without overheating (and higher, with an appropriate heat sink).

Alright, so the IRLML6401 is what we'll be using for T1 in this, and all the following circuits. R1 is simply there to pull up the gate voltage by default (corresponding to a disconnected load; remember that this is a P channel FET).

What else do we need?

How to detect a low battery voltage?

In order to achieve a mostly defined voltage cutoff, we misuse a red LED as a - relatively - sharp voltage reference of around 1.4V. Should you own a Zener diode of a suitable voltage, that would be much better, but an LED still seems to provide a more stable voltage reference than two regular silicon diodes in series. R2 and R3 serve to a) limit the current going through the LED (note that we do not want produce any perceptible light), and b) lower the voltage at the base of T2 a bit further. You could replace R2 and R3 with a potentiometer for a somewhat adjustable cut-off voltage. Now, if the voltage arriving a the base of T2 is around 0.5V or higher (enough to overcome the base-emitter voltage drop of T2), T2 will start to conduct, pulling the gate of T1 to low, and thus connecting the load. BTW, T2 can be assumed to be your garden variety: whatever small signal NPN transistor happens to linger in your toolbox, though a high amplification (hFe) will be preferable.

You may wonder why we need T2 at all, and don't just connect our makeshift voltage reference between ground and T1's gate pin. Well, the reason for this is quite important: We want as rapid a switch between on and off as possible, because we want to avoid T1 being in a "half-on" state for any extended period of time. While half-on, T1 will act as a resistor, meaning voltage will drop between source and drain, but current is still flowing, and this means T1 will heat up. How much it will heat depends on the impedance of the load. If - for example, it is 200 Ohms, then, at 2V, 10mA will flow, while T1 is fully on. Now the worst state is for T1's resistance to match these 200 Ohms, meaning 1V will drop over T1, the current will drop to 5mA, and 5mW of power will have to be dissipated. Fair enough. But for a 2 Ohm load, T1 will have to dissipate 500mW, and that is a lot for such a tiny device. (It's actually within the specs for the IRLML6401, but only with an appropriate heat sink, and good luck designing for that). In this context, keep in mind that if a step-up voltage converter is connected as the primary load, it will ramp up the input current in response to falling input voltage, thus multiplying our thermal woes.

Take home message: We want the transition between on and off to be as sharp as possible. That's what T2 is all about: Making the transition sharper. But is T2 good enough?

Why this circuit does not cut it

Let's take a look at the oscilloscope lines shown at the bottom of Circuit 1's simulation. You may have noted that I placed a triangle generator from 0 to 2.8 V, in the place of our batteries. This is just a convenient way to picture what happens as the battery voltage (upper green line) is changing. As shown by the yellow line, virtually no current flows while the voltage is below around 1.9V. Good. The transition area between around 1.93V and 1.9V seems steep on first glance, but considering we are talking about a battery slowly discharging, those .3V still correspond to a lot of time spent in a state of transition between fully on and fully off. (The green line at the bottom shows the voltage at the gate of T1).

However, what's even worse about this circuit, is that once cut off, even a slight recovery in the battery voltage will push the circuit back into half-on state. Considering that battery voltage does tend to recover, slightly, when a load gets cut off, this means our circuit will linger in the transition state for a long time (during which the load circuit will also remain in a half-broken state, potentially sending an Arduino through hundreds of reboot-cycles, for instance).

Second take home message: We do not want the load to be reconnected too soon, when the battery recovers.

Let's move on to Step 2 for a way to accomplish this.

Step 2: Adding Hysteresis

Picture of Adding Hysteresis

Since this is a circuit, you may actually want to build, I'll give a part list for those parts that are not evident from the schematic:

  • T1: IRLML6401 . See "Step 1" for a discussion, why.
  • T2: Any common small signal NPN transistor. I used BC547 when testing this circuit. Any common type such as 2N2222, 2N3904 should do just as well.
  • T3: Any common small signal PNP transistor. I used BC327 (didn't have any BC548). Again use whichever common type is most convenient for you.
  • C1: Type does not really matter, cheap ceramic will do.
  • The LED is a standard red 5mm type. Color is important, although the LED will never light up visibly: The purpose is to drop a specific voltage. Should you own a Zener diode between 1V and 1.4V Zener voltage, use that, instead (connected in reverse polarity).
  • R2 and R3 could be replaced by a 100k potentiometer, for fine tuning of the cut-off voltage.
  • The "lamp" simply represents your load.
  • The resistor values can be taken from the schematic. The exact values are not really important, however. The resistors need to be neither precise nor do they have to have a significant power rating.

What's the advantage of this circuit over Circuit 1?

Look at the scope lines below the schematic (or run the simulation yourself). Again, the upper green line corresponds to the battery voltage (here taken from a triangle generator for convenience). The yellow line corresponds to the current flowing. The lower green line shows the voltage at the gate of T1.

Comparing this with the scope lines for Circuit 1, you will note that the transition between on and off is much sharper. This is particularly evident when looking at the T1 gate voltage at the bottom. The way to make this happen was adding a positive feedback loop to T2, via the newly added T3. But there is another important difference (though you'd need eagle eyes to spot it): While the new circuit will cut off the load around 1.88V, it will not (re-)connect the load until the voltage rises to above 1.94V. This property called "hysteresis" is another by-product of the added feedback loop. While T3 is "on", it will supply T2's base with an additional positive bias, thereby lowering the cut-off threshold. However, while T3 is already off, the threshold for turning back on will not be lowered in the same way. The practical consequence is that the circuit will not fluctuate between on and off, as the battery voltage drops (with load connected), then recovers ever so slightly (with load disconnected), then drops... Good! The exact amount of hysteresis is controlled by R4, with lower values giving a larger gap between on and off thresholds.

BTW, the power consumption of this circuit while switched off is around 3 microAmps (well below self-discharge rate), and the overhead while on is around 30 microAmps.

So what is C1 all about?

Well, C1 is completely optional, but I'm still rather proud of the idea: What happens when you manually disconnect the batteries while they are near depleted, say at 1.92V? When reconnecting them they would not be strong enough to re-activate the circuit, even though they would still be good for another while in a running circuit. C1 will take care of that: If the voltage rises, suddenly (batteries reconnected), a tiny current will flow from C1 (bypassing the LED), and result in a brief turn on. If the connected voltage is above the cut-off threshold, the feedback loop will keep it up. If it is below the cut-off threshold, the circuit will quickly turn off, again.

Excursus: Why not use MAX713L for low-voltage detection?

You may wonder, if this many parts are really needed. Isn't there something ready made? Well MAX813L looked like a good match to me. It is pretty cheap, and should have been good enough to replace T2, T3, the LED, and R1, at least. However, as I found out the hard way, MAX813L's "PFI" pin (power fail detection input) has a pretty low impedance. If I was using a voltage divider above around 1k to feed PFI, the transition between on and off at "PFO" would start stretching over several tens of a volt. Well, 1k corresponds to 2mA constant current while cut off - prohibitively much, and almost a thousand times as much as this circuit needs. Besides the PFO pin will not swing between ground and the full supply voltage range, so with the little head room we have for driving our power transistor (T1), we'd have to re-insert an auxiliary NPN transistor, too.

Step 3: Variations

Picture of Variations

Many variations are possible on the theme of the positive feedback loop we introduced in Step 2 / Circuit 2. The one presented here differs from the previous one in that once off, it will not re-activate on a rising battery voltage by itself. Rather once the cut-off threshold has been reached, you will have to (exchange the batteries, and) press an optional push button (S2) in order to start it, again. For good measure I included a second push button to turn off the circuit, manually. The small gap in the scope lines shows were I toggled the circuit on, off, on for demonstration purposes. The cut-off on low voltage happens automatically, of course. Just try it in the simulation, if I am not doing a good job describing it.

Now the benefits of this variation are that it provides the sharpest cut-off, of the circuits considered so far (at exactly 1.82V in the simulation; in practice the level of the cut-off point will depend on the parts in use, and could vary with temperature or other factors, but it will be very sharp). It also reduces the power consumption while off to a tiny 18nA.

Technically the trick to make this happen was moving the voltage reference network (LED, R2 and R3) from directly connected to the battery to being connected after T2, such that it will get turned off along with T2. This helps with the sharp cut-off point, because once T2 starts shutting down just a tiny bit, the voltage available to the reference network will also start to drop, causing a rapid feedback loop from fully on to fully off.

Getting rid the buttons (if you want to)

Of course, if you do not like having to push buttons, just take out the buttons, but connect a 1nF capacitor, and a 10M Ohm resistor (exact value does not matter, but must be at least three or four times more than R1) in parallel from T1's gate to ground (where S2 was). Now, when you insert fresh batteries, T1's gate will briefly be pulled low (until C1 is charged), and so the circuit turns on, automatically.

The part list

As this is another circuit that you might actually want to build: The parts are exactly the same as used for Circuit 2 (save for the different resistor values as evident from the schematic). Importantly, T1 is still IRLML6401, while T2 and T3 are any generic small signal NPN and PNP transistors, respectively.

Step 4: Simplifying

Picture of Simplifying

Circuits 2 and 3 are absolutely fine, if you ask me, but I wondered, whether I could make do with fewer parts. Conceptually, the feedback loop driving Circuits 2 and 3 only needs two transistors (T2 and T3 in those), but they also have T1, separately, for controlling the load. Can T1 be used as part of the feedback loop?

Yes, with some interesting implications: Even when on, T1 will have a low, but not zero resistance. Therefore, voltage is dropping across T1, more for higher currents. With the base of T2 connected after T1, that voltage drop affects the operation of the circuit. For one thing, higher loads will mean a higher cut-off voltage. According to the simulation (NOTE: for easier testing, I swapped C1 for a push button, here), for a 4 Ohms load, the cut-off is at 1.95V, for 8 Ohms at 1.8V, for 32 Ohms at 1.66V, and for 1k Ohm at 1.58V. Beyond that it does not change much. (Real life values will differ from the simulator depending on your T1 specimen, the pattern will be similar). All of those cut-offs are within safe limits (see introduction), but admittedly, this is not ideal. NiMH batteries (and aging ones in particular) will show a faster voltage drop for quick discharges, and ideally, for high discharge rates, the voltage cut-off should be lower, not higher. However, by the same token, this circuit provides an effective short circuit protection.

Careful readers will also have noted that the cut-out shown in the scope lines seems very shallow, compared even to Circuit 1. This is not to worry, however. It is true that the circuit will take on the order of 1/10 second to shut down, fully, however the voltage point, where the shutdown happens, is still strictly defined (in the simulation you'll have to swap in a constant DC source, instead of the triangle generator to see this). The time characteristic is due to C1 and desired: It protects against premature self-shutdown in case the load (think: a step-up converter) is drawing short current spikes, rather than a mostly constant current. BTW, the second purpose of C1 (and R3, the resistor needed to discharge C1) is to restart the circuit, automatically, whenever the battery is disconnected/reconnected.

The part list

The required parts are again the same as for the previous circuits. In particular:

  • T1 is IRLML6401 - see Step 1 for a discussion of the (lack of) alternatives
  • T2 is any generic small signal NPN
  • C1 is a cheap ceramic
  • The resistors are cheap anythings, as well. Neither precision, nor power tolerance is required, and the values given in the schematic are mostly a rough orientation. Don't worry about swapping in similar values.

Which circuit is the best for me?

Again, I advise against building Circuit 1. Between Circuit 2 and 3, I lean towards the latter. However, if you expect larger fluctuations in your battery voltage (e.g. due to batteries getting cold), you may prefer an automatic restart based on hysteresis over a manual restart of the circuit. Circuit 4 is nice in that it uses less parts, and offers short circuit protection, but if you are worried about cutting out at a very specific voltage, this circuit is not for you.

In the following steps, I'll guide you through building Circuit 4. If you build one of the other Circuits, consider sharing some photos.

Step 5: Let's Start Building (Circuit 4)

Picture of Let's Start Building (Circuit 4)

Ok, so we are going to build Circuit 4. In addition to the electronic parts listed in the previous step, you are going to need:

  • A 2 cell battery holder (mine was an AA holder scavanged from a Christmas decoration)
  • Some perfboard
  • A decent pair of tweezers for handling the IRLML6401
  • A (small) side cutter
  • Soldering iron and soldering wire

Preparations

My battery holder comes with a switch, and - conveniently - a bit of empty headroom that seems just perfect for placing our circuit in. There is a pin to hold an (optional) screw in there, and I cut that out using the side cutter. the contacts and cables were just inserted loosely. I removed them for easier access, cut the wires and removed insulation on the ends.

I then loosely placed the electronic parts in a piece of perfboard, in order to find out how much place they would take up. Roughly, the bottom row is going to be ground, the center row holds the voltage detection elements, and the upper row has the connection to T1's gate. I had to pack the parts quite densely to make everything fit in the required space. The IRLML6401 is not yet placed. Due to the pinout, it will have to go to the bottom on the perfboard. (NOTE that I accidentally placed T2 - a BC547 - the wrong way around! Don't follow that blindly, double-check the pinout of the transistor you are using - they are all different.) Next, I used the side cutter to clip the perfboard to the required size.

Step 6: Soldering - the Difficult Part First

Picture of Soldering - the Difficult Part First

Remove most components, but insert one lead of R1, together with the positive lead from the battery (in my case from the battery switch) in the center row, directly to one side. Solder only that one hole, do not clip of the pins, yet. The other pin of R1 goes to the bottom row (as seen from the below), one hold to the left. Fix the perfboard horizontally, with the bottom side up.

Ok, next the IRLML6401. In addition to being tiny, this part is sensitive to electrostatic discharge. Most of the time nothing bad will happen, even if you handle the part without any precautions. But there is a real chance that you will damage or destroy it without even noticing, so lets try to be careful. First, try not to wear plastics or wool while doing this. Also, if you do not have an antistatic wristband, now is the time to touch something grounded (perhaps a radiator, or some piping), both with your hand, and your soldering iron. Now, carefully grab the IRLML6401 with your tweezers, and move it near its final place, as shown in the photo. The "S" pin should be next to the pin of R1 you soldered, the other pins should be on two other holes as shown.

Take your time! Err on the side of accuracy, rather than speed, here. When you are happy with the placement, melt the solder at R1, again, while carefully moving the IRLML6401 towards it, with your tweezers, such that the "S" pin will become soldered. Carefully check that the IRLML6401 is now fixated, and that it is fixated in the correct place (also: flat on the perfboard). If you are not entirely happy with the placement, melt the solder once more, and adjust the position. Repeat, if necessary.

Done? Good. Take a deep sigh of relief, then solder the second pin of R1 in the hole next to the "G" pin (on the same side of the package as the "S" pin). Make sure to connect both R1 and the "G" pin. Do not clip R1's pin, yet!

Insert one pin of R2, and the positive output lead through the hole next to the "D" pin (the one on the opposide side of the transistor package). Solder that connection, again making sure to connect the "D" pin with R2 and the output lead.

Finally, for good measure apply a bit more solder to the first soldering point (the "S" pin), now that the two other soldering points are holding the transistor in place.

Note that I am intentionally placing R1 and R2 very close to T1. The idea is that these will function as a rudimentary heatsink for T1. So even if you have more space to spare, consider keeping these tight, too. By the same token, don't be too frugal about the amount of solder, here.

Everything fine so far? Great. Things are only getting easier, from here on.

Step 7: Soldering - the Easy Part

Picture of Soldering - the Easy Part

The remainder of the soldering is pretty straight-forward. Insert the parts one by one as in the initial picture (except, pay close attention to the pinout of your T2 transistor!), then solder them. I started with the center row. You will note that in some cases I inserted several pins into one hole (e.g. the other end of R2 and the long lead of the LED), and where this was not possible, I just bent the pins of the already soldered elements to make the required connection(s).

The entire bottom row (as seen from below) is connected to the "G" pin of T1, and we are using R2's pin (I warned you not to clip it!) to make that connection (to the collector of T2, C1, and R3).

The entire top row (as seen from below) is connected to ground, and R3's pin is used to make that connection. The other terminal of C1, emitter of T2, and importantly battery ground, and output ground lead are connected to this.

The last two pictures show the final circuit from below, and above. Again, I soldered in T2 the wrong way around, and I had to fix that after the fact (no pictures taken). If using a BC547 (as I did), it goes exactly the other way around. It would be correct for a 2N3904, though. Well, in other words, just make sure to double check the transistor pinout before soldering!

Step 8: Final Steps

Picture of Final Steps

Now is a good time to test your circuit!

If everything works, the remainder is simple. I placed the circuit inside my battery holder, along with the switch and battery contacts. As I was a bit worried about the positive battery terminal touching the circuit, I put a bit of red insulation tape in between. Finally I fixed the outgoing cables with a drop of hot glue.

That's it! Hope you could follow everything, and do consider posting pictures, if you make one of the other circuits.

Comments

Swansong (author)2017-11-22

Welcome to Instructbles! Great job on your first one :)

About This Instructable

493views

13favorites

License:

More by tfried:2 Cell NiMH Battery Protection Circuit(s)
Add instructable to: