How to make Automatic Charger for a 7Ah Battery

 7Ah Sealed lead acid battery is a very popular battery which people use in most places like fans, LEDs etc. The reason behind popularity of 7Ah battery is due to its medium size and medium Ah rating. By medium means, its size and ratings lies between the small batteries and large batteries. For medium purposes, the size and rating of battery is ideal.


For example if you want to glow a 20Watt LED then this battery will serves the purpose really well.Before go further, studying the articles related to battery basics, rechargeable batteries and non- rechargeable batteries would be fruitful. Here we will design a 7 Ah charger for this battery.

7Ah Sealed lead Acid Battery
Figure 1: Sealed Lead Acid Battery

How to Charge a Battery

You probably already listened that to charge a battery the voltage of charging source should be greater than the battery voltage but the question is how much voltage should be greater and when will I know that you should stop charging now?
There are two questions here. Let’s answer it one by one.
Want to buy a 12 volt battery charger? Click on the image below:

12 Volt Sealed Lead Acid Rechargeable Battery Charger

How much source voltage should be greater than the battery voltage to charge?

It’s not a single value that you can rely on. But an average value at which you can surely charge your battery without hesitation is 20% more voltage than the battery voltage.

For example in the case of 12 volt battery: 20% x 12 = 2.4
So, charging voltage source should be:      12+ 2.4 =14.4 volts

To charge a 12 volt battery the charging source should be 14.4 volts. Now the question is that how to attain this volts. I will answer this question later.

When Should you Stop Charging?

During building a charger, the most important question comes in mind that when should I cut off the charging source. This is the very critical point during making automatic chargers because mostly batteries do not bear overcharging and their life drastically decreases due to overcharging. Before I answer this question first understand anot should be charge at C/10 current no matter how big the battery is.

Here,                                    C=Ah

        Which means if you have 100Ah lead acid battery then its charging current must not be greater than 100/10=10 A. So the question is how to maintain 10 A current going inwards the battery? The answer is that the internal resistance of ‘12 volts 100Ah lead acid batteries’ is adjusted in such a way that whenever you apply the voltage of 14.4 volts then the battery will automatically draw 10 Amps.
        Now our question was that when should you stop the charging? You don’t have to!! If you are able to apply the constant voltage source of 14.4 volts than the battery will draw current from the source according to its need.

For example in 100Ah battery, if the battery is fully discharged then it will take 10Amps from the 14.4 volts source and if the battery is fully charged then it will not draw any current from the source and at 50% charging it will draw 5amps from source.

       Now I think you are able to understand the procedure of making an automatic charger for sealed lead acid batteries. You can apply this procedure for any sealed lead acid battery but the charging source should be big enough to give the required current to the battery.

Step by step details to build automatic charger for 7Ah 12 volt seal lead-acid battery through micro-controller

Note: In this article I will give detail description about how to make the charger and how to find out that your charger is working okay or not but if you want to implement any indicators then it’s your own choice.

By providing constant voltage we will able to make our required charger. We will build a closed loop system in which our charger sense the requirement and act accordingly. We have to provide 7Ah/10 = 0.7 A current to charge the battery. I will use constant voltage technique to apply the required current. ATmega8 micro-controller which is from the family of Atmel AVR micro-controllers is used here to apply 14.4 constant volts.

Circuit Diagram:

Circuit Diagram of 7Ah Battery Charger
Figure 2: Circuit Diagram of 7Ah Battery Charger

Required Components:

Components you will need to make the automatic charge is as follows:

In this circuit diagram you are seeing a MOSFET and Atmega8 which are parts to understand. MOSFET here will control the voltage coming from the transformer. Here in the circuit diagram the connector is basically the output of 12 volt transformer. MOSFET is switching device which will give the required voltage to the battery. The control of the MOSFET is in the hand of Atmega8 microcontroller. It will adjust the voltage after measuring the input and output voltage. Microcontroller will check the battery voltage and automatically adjust the source voltage to 14.4 volts.

Coding Part:

 The main part of the coding will be explained here. Whole coding will be share in the end, carefully study the code before implementing it.

Note: To understand the coding part for ATmega8 microcontroller you should have knowledge of Timers of Atmel AVR microcontrollers. I am not using any tough kind of coding here but to clearly understand things Timers knowledge would be helpful.

if (conv_grid > 15){
        if (conv_bat < 14.2 )
        OCR1A = OCR1A +1;
        if (conv_bat  >14.4)
        OCR1A = OCR1A -1;
        if (OCR1A >1020)
        OCR1A = 1020;

This is the main controlling part of whole code. This part will check the voltage for every instance and whenever voltage will try to go up it will force the voltage to stick on 14.4 volts. In real when you are charging the voltage, the battery voltage rise up which forces the source voltage rise up as well. To avoid this problem and to apply constant voltage this ‘check’ will control the voltage at constant level.

How to Check the Reliability of your Automatic Charger?

To check this, apply an Ammeter in the series with the battery. You will see less than 1amp current in start and it will start goes down slowly with time and in the end it should stop at 0.001 amps.

Want to buy components from reliable sources? Click on the links below:

If you need more help feel free to comment below and don’t forget to like our FacebookPage. 🙂

Download complete code :

Complete Code

6 thoughts on “How to make Automatic Charger for a 7Ah Battery”

  1. Ismail, thank you so much for your reply. Appreciated. I also wanted to understand it should work on Arduino IDE, but then it wont compile, errors like = ÜBRRH not declared in this scope e.g. etc. I would love to get this one sorted. If you can guide with a few pointers to get us going it will be awesome.

    1. It looks like Arduino IDE is not accepting the commands related to the UART functions. Remove all UART functions from the code and use the serial commands of Arduino itself.
      Serial.begin(9600); // use this in setup function
      Serial.println(sensorValue); // Use this in place of string_transmit/uart_transmit lines.

  2. Ismail, excellent concept and totally understandable, I just wish to convert your AVR code to arduino friendly. That would be so great for our non programmers. Any changes?

What do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.