Automatic charger microcontroller ATTINY24

The charger monitors the battery charging process and sets its optimal parameters. The whole cycle is divided into 4 phase, switches automatically depending on the battery charge. When the battery reaches the desired voltage, Charging stops automatically. Three LEDs indicate battery status and charge level. The charger allows you to adjust the charging current, so it protects the battery from damage (too high current) and saves time (too low current).

A photo 1. The charger microcontroller ATTINY24


  • charging 12 The lead-acid battery capacity 10 … 100 BUT·no
  • adjusting a charging current in the range of about 1 … 10 BUT
  • Battery protection against overcharging
  • multi-stage charging process
  • power supply: transformer 17 AT

circuit Description

Classic rectifier for charging batteries has two major drawbacks. First of all: it does not protect against overcharging, and even if we see him in the charge time, after reading of the ammeter can not clearly state, it's time to stop charging. Only until the charging gas discharge electrolyte is conscious recharging. The second drawback: no regulation of the charging current. The charging current must not exceed the permissible value for the battery, which depends on its capacity. Charging with excessive current can irreversibly damage the plate (elements), that make up the battery. Exceeding the allowable voltage or current negative impact on performance and battery life. This scheme allows the charger to eliminate both of the defect.

The charger microcontroller ATTINY24

rice. 1

On the basis of presented scheme can collect a separate charger , as a model, Photographs shown in, or the module can be an addition to the simple classic rectifier. In both cases a automatic charger. Scheme charger is shown in Figure 1, it can be divided into several blocks.

  1. current measuring unit – It is based on LM358 chip (IC3A, Ic3b). The positive output of the rectifier is connected to the signal terminal POW and fed to the measuring shunt R16, consisting of two power resistors with a low resistance. The operational amplifier IC3B together with the transistor T4 and the adjacent elements forms a current to voltage converter. At its output there are filter components R20, C13 and the amplifier IC3A. The output signal is calibrated using a precision potentiometer R24 ​​and enters the microcontroller – signal labeled CV.
  2. power stage – It built on transistors T3 and T5. T3 transistor is used to control voltage / current, applied to the battery. The transistor T5 with the adjacent elements can control MOSFET directly with microcontroller output.
  3. voltage converter unit – components L1, T1, D4. This is a classic step-up converter, output (signal, marked PVCC) receives a voltage of about 29 AT, that is necessary for proper operation of the current measuring unit. Nearby elements are used to stabilize and filter the output voltage.
  4. Power Supply – stabilizer IC2 and adjacent elements. block task is, to receive and filter the voltage from 10 As to the maximum value 26 AT, is fed via diodes D1 and D2 from the battery or a rectifier. Then through the IC2 regulator for microcontroller power supply is necessary 5 AT. A precision potentiometer R3 and resistor R2 form a divider for reading the battery voltage. Potentiometer allows to calibrate the readings.
  5. AC voltage sensor unit – executed via the transistor T2 and the adjacent elements. Its mission is, to find half sine waves, imposed a permanent battery voltage – This process will be described in more detail below.
  6. Control block – Potentiometer R12 is used for setting the charging current, LEDs indicate system status, and the microcontroller controls the entire process.

All the main modes, which define and control the charging process program registered in the microcontroller memory TINY24 (IC1). Tasks, it performs: performance boost converter control – maintaining a constant output voltage, reading of all analog values, adjustment value of the charging current and the charging switching stages. Regulation of the charging current performed by the phase regulation, used for SCR and triac, with the difference, Without thyristor or triac with a transistor with a channel MOSFET P. This solution has simplified the scheme and reduce energy losses. The signals formed in the circuit during charging are shown in Figure 2.

The charger microcontroller ATTINY24

rice. 2

Form A signal – This rectifier output, B – is superimposed rectifier output and a constant battery voltage (VIN on the chart). Waveform C – This waveform is an alternating voltage sensor output (VIP on the chart) – it specifies the time, when the form of the voltage signal from the rectifier is greater than the battery voltage, and you can get a charging current, falling edge indicates the beginning of the phase adjustment period. Form D is a power level control signal (MDR on the chart), the higher the level of filling, the greater part of the signal B is supplied to the battery – signal E (AKUP the diagram).

The waveform F – is output from the converter unit current-to-voltage (CV in the diagram).

The charging process is divided into several stages, selected depending on the degree of battery, that is, the voltage value at its terminals. On the picture 3 shows the entire process.

The charger microcontroller ATTINY24

rice. 3

The values ​​at the point A is a charging step, graph B represents the values ​​of the charging current, graph C shows the voltage curve of the battery, and the symbols at the point D represent signaling method LED. Level 0 – without battery. If the rectifier is included, circuit signals the phase constant glow of the red LED. supply circuit is turned off, the output terminals are no voltage, so there is no risk of accidental short circuit, This condition persists until, while the output voltage does not appear at least 8 AT.

stage I – precharge. If the output terminals connected to a battery with a voltage of not more than 11 AT, it means, that it is in a state of deep discharge. such a battery, connected to a conventional charger, It can cause very large current because of the significant voltage difference. In this case represented by scheme reduces the charging current to 1/3 set value range and waits battery partial regeneration – voltage exceeds 11 AT.

Phase II – the main charge. At this stage, the charging current reaches the full set value, but, Unlike classical rectifier, it does not decrease with increasing charge, and is maintained constant, which reduces the charging time. Step lasts until reaching 14V. Here it is worth paying attention to the way the voltage measurement, which is different from the other stages – Charging occurs cyclically, Each cycle takes about half a minute charging, followed by a short break, charge termination – and at this moment the battery voltage is measured. With this measurement is not burdened with a mistake, caused by the fall

Phase III – The final charge. After the overvoltage 14 The charging current is reduced to 1/3 of the set value. Charging with a low current allows the battery to "saturate" the charge and allows you to more accurately determine the time of the end. First, the battery responds sudden voltage drop, as it shown on the picture 3, but then slowly reaches a maximum value 14,4 AT.

Phase IV – charging completed. A green LED indicates the completion of the charging process, battery is fully charged and ready to go. Battery voltage quickly drops to about 13 AT, and then reduced to about 12,6 AT, so do not expect, that after charging the battery, we will measure 14,4 AT. If the battery remains connected to the charger submitted, its voltage will be continuously monitored, and when it drops to about 12,8 AT., launched the next stage of charging.

Phase V – conservation of charge. As for final charge, the charging current is 1/3 of the set value, and the final voltage is 14,4 AT. This stage of operation the charger is aimed at maintaining the battery, if it remains connected, even after the, charging is completed for a long time. When the battery is connected to the circuit and the power supply is turned off (Charger off), LEDs will display the status of the battery as well, as in charging time, only the LEDs will flash. The circuit measures the charging current, and, if it does not reach the minimum value, signals this way. The same thing will happen, if a, For example, while charging voltage network 220 In the fall, flashing LEDs will signal this emergency condition. note, the device then consumes energy from the battery discharges and its small current.

Assembly and adjustment

The scheme was designed and manufactured for the two-way circuit board shown in Figure 4.

The charger microcontroller ATTINY24

rice. 4

Transistors T1 and T3 are attached to the radiator by means of insulating washers and sleeves and are soldered to the circuit board. If the device works as an adapter for a rectifier, the diode bridge is not needed. The circuit should be placed in a well-ventilated enclosure.
Radiator should not be too warm during operation, while resistor R16 and the rectifier bridge can even be hot.

The device has been designed sticker on front cover – picture 5.

The charger microcontroller ATTINY24

rice. 5

For the first time and the device settings need: adjustable power supply, Multimeter and Battery. First, do not insert the ICs in sockets and connect approximately 10 The power supply terminals GND and AKUP. Now it is necessary to measure the, there is power 5 As for contacts 1 and 14 landing base microcontroller. Then disconnect the power source, install the chip in the stand and reconnect the power supply. Now it is necessary to measure the, whether there is a voltage of about 29 … 30 As for contacts 4 and 8 socket IC3. If the voltage is correct, You can proceed to the next step.

The charger microcontroller ATTINY24

A photo 2.

Insert the ICs into the sockets and connect the power supply to set a voltage of about 7 AT, The red LED should be lit., then increasing the voltage up to 8 The adjustable potentiometer and R3, until the red and yellow LEDs. Now it's worth checking, whether switching occurs during subsequent steps of 11 AT, 14 AT, 14,4 AT, and adjust the setting if necessary R3 (most important is 14,4 AT). important note – the voltage should be increased slowly, because the voltage measurement is discrete, rather than continuous, and switching voltage threshold levels have a large hysteresis in the voltage drop direction – switching from stage I to II takes place when exceeding 11 AT, and from stage I to II takes place at 10 , 8V. The exact voltage values ​​are stored in the program file analog.h. The next step is to target the transformer connection (through the diode bridge rectifier) or rectifier terminals GND and POW. However, before this need to make sure, that the secondary voltage of the transformer / rectifier does not exceed 18 VAC (26 DC). Feed higher voltage will damage the resistor R1. Voltage should also not be too low, because it does not allow to get full control range, the optimum value is 17 The AC power of about 150 … 200 W. If there is no need to use the full range of the charging current to 10 BUT, transformer can consume less power. The output should be a filter capacitor, because the circuit will not generate the clock pulse (VIP signal – rice. 2, C signal).

The charger microcontroller ATTINY24

A photo 3

Finally, calibrate the current measurement unit. Set the control knob to the minimum, connect the "minus" battery to the GND terminal, and plus through the ammeter to AKUP terminal and plug-in transformer / rectifier. Now calibrate the potentiometer knob, Despite the ammeter. By setting a small current, For example, 2BUT (circuit should be the primary charging step). Set the potentiometer R24, to handle indication on the level consistent with the ammeter (provided, what, For example, 20% 2A is). There may be differences – Charging current is heavily distorted waveform, and an ammeter may indicate incorrectly, current measuring unit also introduces little distortion. It is best to set the correct current position of the average regulator (approx current. 5 BUT), allowing extreme settings differ slightly from the assumptions.

The charger microcontroller ATTINY24

A photo 4

How to safely connect scheme? The charger is resistant to the reverse connection of the battery and short-circuiting the output terminals, but the following procedure should be followed. First of all, charger must be disconnected from the network 220 VAC. Then, connect the battery and observe the LEDs – If the LEDs do not burn, the battery is connected correctly discharged or strongly / corrupted. If the flashing red and / or yellow, the battery is connected correctly, you can set the charging current, and connect the power supply (transformer or rectifier) to the network 220 AT.

The charger microcontroller ATTINY24

A photo 5


Archive of the project


  1. Source,I wish I had a one-sided printed circuit board,it is easier to make at home,scheme interested,can and collect!

Leave a Reply

Your email address will not be published.