Restore Batteries With Arduino

About: Fascinated by the cosmos, consciousness, and the space between. Compelled to learn, conceptualize, experiment, and build.

Do you have rechargeable batteries that aren't chargeable anymore? There are many possible reasons why a battery stops taking a charge, here are a couple of common ones. It may have been damaged by heat due to overcharging, or sulfates may have built up on the internal plates due to extreme discharge. The good news is that many times a battery in this condition can be restored. You may be familiar with desulfating circuits, the setup I'm presenting in this article is my take on one.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: The Circuit

Be advised that this is an experimental setup, it should only be duplicated by those who are familiar with appropriate safety precautions.DO NOT attempt to charge Li-Ion/Polymer batterieswith this setup as there is a risk of explosion.

This circuit works by pulsing high voltage short duty cycle spikes, to a problematic battery. This can help breakup sulfation, and re-stimulate the chemistry of the battery. This setup is intended to be used primarily for Lead-Acid, Nickel-Cadmium, & Nickel-Metal-Hydride batteries.

The way this circuit functions is a square wave pulse generated by the Arduino is amplified with a MOSFET to switch an inductor (L1) on and off rapidly. Each time the power to the inductor (L1) is switched off the magnetic field surrounding the coil collapses which generates a high voltage spike. We direct this spike into the charge battery through D1 which allows current to flow in only one direction. D2 is a safety precaution to help protect the MOSFET from being damaged by the high voltage spikes. D3 is a blocking diode to keep supply voltage from coupling with the Arduino's supply. R1 is a pull down resistor to keep the MOSFET off until it receives a positive pulse on the gate.

I used a 12VDC power supply to power the charge circuit.

Parts List:
  • Q1 = N-Channel MOSFET rated above the input voltage, and for a couple of amps to be safe.
  • D1, D2, D3 = 1N4007 Rectifier Diodes
  • R1 = 10K 1/2W
  • L1 = Experiment with a variety of coils. I used a small air core spool of light gauge magnet wire that measured 15 Ohms.

Step 2: Arduino Setup & Sketch

This is my first Arduino project and I'm hooked. This is a simple setup, I'm currently powering the Arduino UNO via USB but would incorporate a stand-alone programmed micro controller into a more permanent setup and power it from the input supply. I only used 2 pins, Pin 3 to MOSFET gate, & GND to charge circuit ground through D3 blocking diode.

I used this simple sketch to create a square wave pulse on pin 3 with a pulse-width & frequency that I can adjust using the delay functions. If both delay values are equal the duty cycle is 50%. I have it set at a 10:1 ratio with 10 being the Off time, & 1 the On time, this seems to be a good balance between charge rate and inductor loading. The longer the pulse-width, or the higher the frequency the more current used which will generate waste heat in the inductor and the MOSFET so be mindful of this when altering the values.

The delay values are in milliseconds.

int fetPin = 3;

void setup() {
  pinMode(fetPin, OUTPUT);

void loop() {
  digitalWrite(fetPin, HIGH);
  digitalWrite(fetPin, LOW);

Step 3: Conclusion

The amount of time necessary to restore and fully charge a battery will vary and since at this time I haven't incorporated automated control functions into the sketch you will need to manually monitor the charge voltage and use care not to overcharge.

I intend to keep developing this setup and incorporate more of the features and functions made possible with micro controllers and awesome development tools like Arduino.

Arduino Contest

Participated in the
Arduino Contest

Fix It Contest

Participated in the
Fix It Contest

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    8 Discussions


    3 years ago

    Can this be used on an alkaline battery (alkaline can be recharged with a special charging circuit)? I'm wondering if this would be capable?

    1 reply

    Reply 3 years ago

    This setup should not be used on non rechargeables.


    3 years ago

    Great. I really don't understand the necessity od D3. Can someone explain it to me ? Thanks

    1 reply

    Reply 3 years ago

    It isn't necessary, in fact I later decided to not use it and the circuit seemed to work better with the grounds tied directly together.


    6 years ago on Introduction

    To expand the scoop would be to measure the voltage and the temperature on the battery and log it to an SD card or just to the serial port.

    Thom Kouwen

    6 years ago on Introduction

    Nice project, I normally just put 10V on a NiMH for a second, quite cruel now that I think about it, but it works. Since this is your first project, and I see you haven't used PWM, I think these two links will be quite helpful for learning the things Arduino can do:

    Good luck!

    2 replies

    Thanks, manually pulsing voltage to a battery above that which it is rated for can indeed help stimulate it to take a charge. I appreciate the suggestion of using PWM, and the URL's. I used the analogWrite function in my first sketch, it didn't produce the result that I wanted, I realize now it was due to error. I understand that using the delay function limits the other functionality that can be added to the loop. However if the Arduino is just being used as a trigger source for the charge circuit, I like the simple versatility of the digitalWrite and delay functions.

    It is indeed a simple system, but it actually also a kind of PWM, it's just at a low frequency. If you want to PWM in frequencies other then the standard 500Hz, check out this link: . With this you can set your PWM to a whole range of frequencies, even 30Hz is an option.

    Good luck with your future Arduino Projects!