Automatic charger for MK ATmega16A. Charger for car batteries on Atmega8 Controller for heated mirrors and rear window

Microcontroller circuits, articles and descriptions with firmware and photographs for the car.

A simple tachometer on the ATmega8 microcontroller

A tachometer is used in cars to measure the rotation speed of any parts that are capable of rotating. There are many options for such devices, I will offer an option on the AVR microcontroller ATmega8. For my option, you also...

Read completely

Color music on the Attiny45 microcontroller in the car

This color music, having a small size and 12V power supply, can alternatively be used in a car for any events. The primary source of this diagram is Radio No. 5, 2013 A. LAPTEV, Zyryanovsk, Kazakhstan. Scheme…

Read completely

Heated mirror and rear window controller

Allows you to control the heated rear window and mirrors separately with one button, plus a customizable shutdown timer of up to one and a half hours for each channel. The circuit is built on an ATtiny13A microcontroller. Description of work:

Read completely

Dimmer for car lamp

Almost all cars have interior light control, which is carried out using an on-board computer or a separate on-board system. The light turns on smoothly and also goes out with a certain delay (for...

Read completely

GSM alarm with mobile phone notification

I present a very popular car alarm circuit based on the ATmega8 microcontroller. Such an alarm gives an alert to the administrator’s mobile phone in the form of calls or SMS. The device integrates with a mobile phone using...

Read completely

Blinking stopak on the microcontroller

I made a new version of the blinking stopak. The operating algorithm and control circuit are different, the size and connection are the same. It is possible to adjust the frequency of blinking, the duration before switching to a constant glow and the duty cycle...

Read completely

DRL plus strobes

This craft allows you to strobe LED DRLs. The craft is small in size, controlled with just one button, and has wide customization options. The board size is 30 by 19 millimeters. On the reverse side there is a terminal block...

Read completely

We make and connect the door closer to the alarm system

The number of cars with automatic windows is constantly growing, and even if the car does not have one, many people make it themselves. My goal was to assemble such a device and connect it to...

Read completely

LEDs turn on based on speed

It turned out to be a “by-product”: it was necessary to test the operating mode of the speed sensor for the project of displaying gears on a 5x7 matrix, for this I assembled a small circuit. The circuit can turn on LEDs depending...

Read completely

Digital tachometer on AVR microcontroller (ATtiny2313)

The tachometer measures the rotation speed of parts, mechanisms and other components of the car. The tachometer consists of 2 main parts - a sensor that measures rotation speed and a display where...

Read completely

Simple digital speedometer on ATmega8 microcontroller

A speedometer is a measuring device for determining the speed of a car. According to the measurement method, there are several types of speedometers: centrifugal, chronometric, vibration, induction, electromagnetic, electronic, and finally GPS speedometers.

Read completely

Smooth ignition of the tidy on the microcontroller

This version has a slightly different layout: a second setting button has been added and the ignition speed potentiometer has been removed. Features: Two separate independent channels. For each channel there are three groups of adjustable parameters: delay time before the start...

All technical questions on [email protected]
Download the schematic and printed circuit board from here.
External power transistor IRF540N and fan are not included.

Any car owner sooner or later is faced with the task of charging his battery. This happens for various reasons. For example, during cold weather, when the battery capacity drops due to low ambient temperature. Or if the battery has been left unused for a long time and the voltage on it has dropped to a critical level. Or she just got old. In such cases, they often use a purchased charger (charger), or a homemade charger made with their own hands.

Often car owners make chargers not because there is no money to purchase a ready-made one, but because doing something with your own hands is very interesting, exciting and useful. For this reason, the Internet is littered with numerous charger circuits, from the simplest ones with a single transistor to the most complex ones controlled by microcontrollers.

However, it is important to remember that properly charging a battery is a complex electrochemical process. And often simple amateur radio circuits are not able to track the most important charge parameters. Currents, voltage rise and fall, time intervals, battery disconnection at the end of the charge cycle, and other processes. And frequent use of such not entirely correct circuits can lead to a significant reduction in battery life. Assembling a more complex memory device is sometimes beyond everyone’s power.

This board will help bridge the gap between the desire and the ability to make your own memory. The board is a semi-finished car battery charger. This semi-finished product already implements the most complex part of the charger, namely microcontroller control of the charging process. The heart of the board is the Atmega88 microcontroller. As you know, the microcontroller itself cannot do anything, since it is a programmable chip. And in order for a device controlled by a microcontroller to start working, you need to write a program and upload it to the chip. This is not so easy to do; you need both experience and knowledge in writing programs. However, this most difficult stage has already been implemented in the board; all that remains is to correctly assemble the rest of the circuit. And here the car enthusiast can already put his hand, skills and ability to work. So what remains to be done after purchasing the board?

1. Connect power to the board (17-24V, at least 8A).

2. Connect the power supply in accordance with the diagram.

This device is designed to measure the capacity of Li-ion and Ni-Mh batteries, as well as to charge Li-ion batteries with a choice of initial charge current.

Control

We connect the device to a stabilized power supply of 5V and a current of 1A (for example, from a cell phone). The indicator displays the result of the previous capacitance measurement “xxxxmA/c” for 2 seconds and on the second line the value of the OCR1A register “S.xxx”. We insert the battery. If you need to charge the battery, then briefly press the CHARGE button; if you need to measure the capacity, then briefly press the TEST button. If you need to change the charge current (the value of the OCR1A register), then press the CHARGE button for a long time (2 seconds). Go to the register adjustment window. Let's release the button. By briefly pressing the CHARGE button, we change the values ​​of the register in a circle (50-75-100-125-150-175-200-225), the first line shows the charging current of an empty battery at the selected value (provided that you have a 0 resistor in the circuit ,22 Ohm). Briefly press the TEST button; the values ​​of the OCR1A register are stored in non-volatile memory.
If you have performed various manipulations with the device and you need to reset the clock or measured capacity, then press the TEST button for a long time (the values ​​of the OCR1A register are not reset). As soon as the charge is complete, the display backlight turns off, to turn on the backlight, briefly press the TEST or CHARGE button.

The operating logic of the device is as follows:

When power is applied, the indicator displays the result of the previous measurement of the battery capacity and the value of the OCR1A register, stored in non-volatile memory. After 2 seconds, the device goes into the mode of determining the battery type based on the voltage at the terminals.

If the voltage is more than 2V, then it is a Li-ion battery and the full discharge voltage will be 2.9V, otherwise it is a Ni-MH battery and the full discharge voltage will be 1V. Control buttons are available only after connecting the battery. Next, the device waits for the Test or Charge buttons to be pressed. The display shows "_STOP". When you briefly press the Test button, the load is connected via a MOSFET.

The magnitude of the discharge current is determined by the voltage across the 5.1 Ohm resistor and is summed up with the previous value every minute. The device uses 32768Hz quartz to operate the clock.

The display shows the current value of the battery capacity "xxxxmA/s" and the discharge torus "A.xxx", as well as the time "xx:xx:xx" from the moment the button was pressed. An animated low battery icon is also shown. At the end of the test for the Ni-MH battery, the message “_STOP” appears, the measurement result is displayed on the display “xxxxmA/c” and is remembered.

If the battery is Li-ion, then the measurement result is also displayed on the display “xxxxmA/c” and is remembered, but the charging mode is immediately activated. The display shows the contents of the OCR1A register "S.xxx". An animated battery charge icon is also shown.

The charge current is adjusted using PWM and is limited by a 0.22 Ohm resistor. In hardware, the charge current can be reduced by increasing the resistance from 0.22 Ohm to 0.5-1 Ohm. At the beginning of charging, the current gradually increases to the value of the OCR1A register or until the voltage at the battery terminals reaches 4.22V (if the battery has been charged).

The amount of charge current depends on the value of the OCR1A register - the larger the value, the larger the charge current. When the voltage at the battery terminals exceeds 4.22V, the value of the OCR1A register decreases. The recharging process continues until the OCR1A register value is 33, which corresponds to a current of about 40 mA. This ends the charge. The display backlight turns off.

Settings

1. Connect the power.
2. Connect the battery.
3. Connect the voltmeter to the battery.
4. Using the temporary + and - buttons (PB4 and PB5), we ensure that the voltmeter readings on the display and the reference voltmeter match.
5. Long press the TEST button (2 seconds), memorization occurs.
6. Remove the battery.
7. Connect the voltmeter to the 5.1 Ohm resistor (according to the diagram near the 09N03LA transistor).
8. Connect the adjustable power supply to the battery terminals, set the power supply to 4V.
9. Briefly press the TEST button.
10. We measure the voltage across the 5.1 Ohm resistor - U.
11. Calculate the discharge current I=U/5.1
12. Using the temporary buttons + and - (PB4 and PB5) we set the calculated discharge current I on the indicator “A.xxx”.
13. Long press the TEST button (2 seconds), memorization occurs.

The device is powered from a stabilized source with a voltage of 5 Volts and a current of 1A. Quartz at 32768Hz is designed for accurate time keeping. The ATmega8 controller is clocked from an internal oscillator with a frequency of 8 MHz, and it is also necessary to set EEPROM erasure protection with the appropriate configuration bits. When writing the control program, educational articles from this site were used.

The current values ​​of the voltage and current coefficients (Ukof. Ikof) can be seen if you connect a 16x4 display (16x4 is preferable for debugging) on ​​the third line. Or in Ponyprog if you open the EEPROM firmware file (read from the EEPROM controller).
1 byte - OCR1A, 2 bytes - I_kof, 3 bytes - U_kof, 4 and 5 bytes are the result of the previous capacity measurement.

Video of the device working:

In this article I will tell you how to make a fairly “smart” charger for lead-acid batteries from an AT/ATX computer power supply and a homemade control unit. These include the so-called. “UPS”, automobile and other batteries of wide application.

Description
The device is intended for charging and training (desulfation) lead-acid batteries with a capacity of 7 to 100 Ah, as well as for approximate assessment of their charge level and capacity. The charger has protection against incorrect connection of the battery (reversal of polarity) and against short circuit of accidentally abandoned terminals. It uses microcontroller control, thanks to which safe and optimal charging algorithms are implemented: IUoU or IUIoU, followed by “topping up” to a 100% charging level. Charging parameters can be adjusted to a specific battery (customizable profiles) or you can select those already included in the control program. Structurally, the charger consists of an AT/ATX power supply, which needs to be slightly modified, and a control unit on the ATmega16A MK. The entire device is freely mounted in the housing of the same power supply. The cooling system (standard PSU cooler) turns on/off automatically.
The advantages of this memory are its relative simplicity and the absence of labor-intensive adjustments, which is especially important for beginner radio amateurs.
]1. Charging mode - “Charge” menu. For batteries with capacities from 7Ah to 12Ah, the IUoU algorithm is set by default. This means:
- first stage - charging with a stable current of 0.1C until the voltage reaches 14.6V
- the second stage is charging with a stable voltage of 14.6V until the current drops to 0.02C
- the third stage is maintaining a stable voltage of 13.8V until the current drops to 0.01C. Here C is the battery capacity in Ah.
- fourth stage - “finishing”. At this stage, the voltage on the battery is monitored. If it drops below 12.7V, the charge starts from the very beginning.
For starter batteries (from 45 Ah and above) we use the IUIoU algorithm. Instead of the third stage, the current is stabilized at 0.02C until the battery voltage reaches 16V or after about 2 hours. At the end of this stage, charging stops and “topping up” begins. This is the fourth stage. The charging process is illustrated by graphs in Fig. 1 and Fig. 2.
2. Training mode (desulfation) - “Training” menu. Here is the training cycle:
10 seconds - discharge with a current of 0.01C, 5 seconds - charge with a current of 0.1C. The charge-discharge cycle continues until the battery voltage rises to 14.6V. Next is the usual charge.
3. Battery test mode. Allows you to approximately estimate the degree of battery discharge. The battery is loaded with a current of 0.01C for 15 seconds, then the voltage measurement mode on the battery is turned on.
4. Control-training cycle (CTC). If you first connect an additional load and turn on the “Charge” or “Training” mode, then in this case, the battery will first be discharged to a voltage of 10.8 V, and then the corresponding selected mode will be turned on. In this case, the current and discharge time are measured, thus calculating the approximate capacity of the battery. These parameters are displayed on the display after charging is complete (when the message “Battery charged” appears) when you press the “select” button. As an additional load, you can use a car incandescent lamp. Its power is selected based on the required discharge current. Usually it is set equal to 0.1C - 0.05C (10 or 20 hour discharge current).
Moving through the menu is carried out using the “left”, “right”, “select” buttons. The “reset” button exits any operating mode of the charger to the main menu.
The main parameters of charging algorithms can be configured for a specific battery; for this, there are two customizable profiles in the menu - P1 and P2. The configured parameters are saved in non-volatile memory (EEPROM).
To get to the settings menu, you need to select any of the profiles, press the “select” button, select “settings”, “profile parameters”, profile P1 or P2. Having selected the desired parameter, press “select”. The left or right arrows will change to up or down arrows, indicating that the parameter is ready to be changed. Select the desired value using the “left” or “right” buttons, confirm with the “select” button. The display will show “Saved”, indicating that the value has been written to the EEPROM.
Setting values:
1. “Charge algorithm.” Select IUoU or IUIoU. See graphs in Fig. 1 and Fig. 2.
2. “Battery capacity”. By setting the value of this parameter, we set the charging current at the first stage I=0.1C, where C is the battery capacity V Ah. (Thus, if you need to set the charge current, for example, 4.5A, you should select a battery capacity of 45Ah).
3. "Voltage U1". This is the voltage at which the first charging stage ends and the second begins. The default value is 14.6V.
4. "Voltage U2". Only used if the IUIoU algorithm is specified. This is the voltage at which the third stage of charging ends. Default is 16V.
5. “2nd stage current I2”. This is the current value at which the second charging stage ends. Stabilization current at the third stage for the IUIoU algorithm. The default value is 0.2C.
6. “End of charge I3.” This is the current value upon reaching which charging is considered complete. The default value is 0.01C.
7. "Discharge current". This is the value of the current that discharges the battery during training with charge-discharge cycles.


Selection and modification of the power supply.

In our design we use a computer power supply. Why? There are several reasons. Firstly, this is an almost ready-made power unit. Secondly, this is also the body of our future device. Thirdly, it has small dimensions and weight. And, fourthly, it can be purchased at almost any radio market, flea market and computer service centers. As they say, cheap and cheerful.
Of all the variety of power supply models, the best fit for us is an ATX format unit with a power of at least 250 W. You just need to consider the following. Only those power supplies that use the TL494 PWM controller or its analogues (MB3759, KA7500, KR1114EU4) are suitable. You can also use an AT format power supply, but you will only have to make a low-power standby power supply (standby) for a voltage of 12V and a current of 150-200mA. The difference between AT and ATX is in the initial startup scheme. The AT starts up independently; power for the PWM controller chip is taken from the 12-volt winding of the transformer. In ATX, a separate 5V source, called the “standby power supply” or “standby”, is used to initially power the chip. You can read more about power supplies, for example, and converting a power supply into a charger is well described
So, there is a power supply. First you need to check it for serviceability. To do this, we disassemble it, remove the fuse and instead solder a 220 volt incandescent lamp with a power of 100-200 W. If there is a mains voltage switch on the back panel of the power supply, it should be set to 220V. We turn on the power supply to the network. The AT power supply starts up immediately; for ATX you need to short-circuit the green and black wires on the large connector. If the light does not light, the cooler is spinning, and all output voltages are normal, then we are lucky and our power supply is working. Otherwise, you will have to start repairing it. Leave the light bulb in place for now.
To convert the power supply into our future charger, we will need to slightly change the “piping” of the PWM controller. Despite the huge variety of power supply circuits, the TL494 switching circuit is standard and can have a couple of variations, depending on how current protection and voltage limits are implemented. The conversion diagram is shown in Fig. 3.


It shows only one output voltage channel: +12V. The remaining channels: +5V, -5V, +3.3V are not used. They must be turned off by cutting the corresponding tracks or removing elements from their circuits. Which, by the way, may be useful to us for the control unit. More on this a little later. Elements that are installed additionally are indicated in red. Capacitor C2 must have an operating voltage of at least 35V and is installed to replace the existing one in the power supply. After the TL494 “piping” is shown in the diagram in Fig. 3, we connect the power supply to the network. The voltage at the power supply output is determined by the formula: Uout=2.5*(1+R3/R4) and with the ratings indicated on the diagram it should be about 10V. If this is not the case, you will have to check the correct installation. At this point the alteration is completed, you can remove the light bulb and replace the fuse.

Scheme and principle of operation.

The control unit diagram is shown in Fig. 4.


It is quite simple, since all the main processes are performed by the microcontroller. A control program is written into its memory, which contains all the algorithms. The power supply is controlled using PWM from the PD7 pin of the MK and a simple DAC based on elements R4, C9, R7, C11. The measurement of battery voltage and charging current is carried out using the microcontroller itself - a built-in ADC and a controlled differential amplifier. The battery voltage is supplied to the ADC input from the divider R10R11. The charging and discharging current are measured as follows. The voltage drop from the measuring resistor R8 through dividers R5R6R10R11 is supplied to the amplifier stage, which is located inside the MK and connected to pins PA2, PA3. Its gain is set programmatically, depending on the measured current. For currents less than 1A, the gain factor (GC) is set equal to 200, for currents above 1A GC=10. All information is displayed on the LCD connected to ports PB1-PB7 via a four-wire bus. Protection against polarity reversal is carried out on transistor T1, signaling of incorrect connection is carried out on elements VD1, EP1, R13. When the charger is connected to the network, transistor T1 is closed at a low level from the PC5 port, and the battery is disconnected from the charger. It connects only when you select the battery type and charger operating mode in the menu. This also ensures that there is no sparking when the battery is connected. If you try to connect the battery in the wrong polarity, the buzzer EP1 and the red LED VD1 will sound, signaling a possible accident. During the charging process, the charging current is constantly monitored. If it becomes equal to zero (the terminals have been removed from the battery), the device automatically goes to the main menu, stopping the charge and disconnecting the battery. Transistor T2 and resistor R12 form a discharge circuit, which participates in the charge-discharge cycle of the desulfating charge (training mode) and in the battery test mode. The discharge current of 0.01C is set using PWM from the PD5 port. The cooler automatically turns off when the charging current drops below 1.8A. The cooler is controlled by port PD4 and transistor VT1.

Details and design.

Microcontroller. They are usually found on sale in a DIP-40 or TQFP-44 package and are labeled as follows: ATMega16A-PU or ATMega16A-AU. The letter after the hyphen indicates the type of package: “P” - DIP package, “A” - TQFP package. There are also discontinued microcontrollers ATMega16-16PU, ATMega16-16AU or ATMega16L-8AU. In them, the number after the hyphen indicates the maximum clock frequency of the controller. The manufacturing company ATMEL recommends using ATMega16A controllers (namely with the letter “A”) and in a TQFP package, that is, like this: ATMega16A-AU, although all of the above instances will work in our device, as practice has confirmed. Case types also differ in the number of pins (40 or 44) and their purpose. Figure 4 shows a schematic diagram of the control unit for the MK in a DIP package.
Resistor R8 is ceramic or wire, with a power of at least 10 W, R12 - 7-10 W. All others are 0.125W. Resistors R5, R6, R10 and R11 must be used with a tolerance of 0.1-0.5%. It is very important! The accuracy of measurements and, consequently, the correct operation of the entire device will depend on this.
It is advisable to use transistors T1 and T1 as shown in the diagram. But if you have to select a replacement, then you need to take into account that they must open with a gate voltage of 5V and, of course, must withstand a current of at least 10A. Suitable, for example, are transistors marked 40N03GP, which are sometimes used in the same ATX format power supplies, in a 3.3V stabilization circuit.
Schottky diode D2 can be taken from the same power supply, from the +5V circuit, which we do not use. Elements D2, T1 and T2 are placed on one radiator with an area of ​​40 square centimeters through insulating gaskets. Buzzer EP1 - with a built-in generator, for a voltage of 8-12 V, the sound volume can be adjusted with resistor R13.
LCD indicator – WH1602 or similar, on the controller HD44780, KS0066 or compatible with them. Unfortunately, these indicators may have different pin locations, so you may have to design a printed circuit board for your instance
Program
The control program is contained in the “Program” folder. The configuration bits (fuses) are set as follows:
Programmed (set to 0):
CKSEL0
CKSEL1
CKSEL3
SPIEN
SUT0
BODEN
BODLEVEL
BOOTSZ0
BOOTSZ1
all others are unprogrammed (set to 1).
Setup
So, the power supply has been redesigned and produces a voltage of about 10V. When connecting a working control unit with a firmware MK to it, the voltage should drop to 0.8..15V. Resistor R1 sets the contrast of the indicator. Setting up the device involves checking and calibrating the measuring part. We connect a battery or a 12-15V power supply and a voltmeter to the terminals. Go to the “Calibration” menu. We check the voltage readings on the indicator with the readings of the voltmeter, if necessary, correct them using the “<» и «>" Click "Select". Next comes the current calibration at KU=10. With the same buttons "<» и «>“You need to set the current reading to zero. The load (battery) is automatically switched off, so there is no charging current. Ideally, there should be zeros or very close to zero values. If so, this indicates the accuracy of resistors R5, R6, R10, R11, R8 and the good quality of the differential amplifier. Click "Select". Similarly - calibration for KU=200. "Choice". The display will show “Ready” and after 3 seconds. the device will go to the main menu.
Calibration is complete. Correction factors are stored in non-volatile memory. It is worth noting here that if, during the very first calibration, the voltage value on the LCD is very different from the voltmeter readings, and the currents at any KU are very different from zero, you need to use (select) other divider resistors R5, R6, R10, R11, R8, Otherwise, the device may malfunction. With precise resistors (with a tolerance of 0.1-0.5%), the correction factors are zero or minimal. This completes the setup. If the voltage or current of the charger at some stage does not increase to the required level or the device “pops up” in the menu, you need to once again carefully check that the power supply has been modified correctly. Perhaps the protection is triggered.
All material can be downloaded in one archive


Batteries are very common today, but commercially available chargers for them are usually not universal and are too expensive. The proposed device is intended for charging rechargeable batteries and individual batteries (hereinafter the term “battery” is used) with a rated voltage of 1.2...12.6 V and a current of 50 to 950 mA. The input voltage of the device is 7...15 V. Current consumption without load is 20 mA. The accuracy of maintaining the charging current is ±10 mA. The device has an LCD and a convenient interface for setting the charging mode and monitoring its progress.

A combined charging method has been implemented, consisting of two stages. At the first stage, the battery is charged with a constant current. As it charges, the voltage across it increases. As soon as it reaches the set value, the second stage will begin - charging with a constant voltage. At this stage, the charging current is gradually reduced, and the battery maintains the specified voltage. If the voltage for any reason drops below the set value, charging with a constant current will automatically begin again.

The charger circuit is shown in Fig. 1.

Rice. 1. Charger circuit

Its basis is the DD1 microcontroller. It is clocked by an internal RC oscillator at 8 MHz. Two channels of the microcontroller ADC are used. Channel ADC0 measures the voltage at the output of the charger, and channel ADC1 measures the charging current.

Both channels operate in eight-bit mode, the accuracy of which is sufficient for the device being described. The maximum measured voltage is 19.9 V, the maximum current is 995 mA. If these values ​​are exceeded, the inscription “Hi” appears on the HG1 LCD screen.

The ADC operates with a reference voltage of 2.56 V from the microcontroller's internal source. To be able to measure a higher voltage, the resistive voltage divider R9R10 reduces it before applying it to the ADC0 input of the microcontroller.

The charging current sensor is resistor R11. The voltage that drops across it when this current flows is supplied to the input of op-amp DA2.1, which amplifies it approximately 30 times. The gain depends on the ratio of the resistances of resistors R8 and R6. From the output of the op-amp, a voltage proportional to the charging current is supplied through a repeater to the op-amp DA2.2 to the ADC1 input of the microcontroller.

An electronic switch is assembled on transistors VT1-VT4, operating under the control of a microcontroller that generates pulses at the OS2 output, following at a frequency of 32 kHz. The duty cycle of these pulses depends on the required output voltage and charging current. Diode VD1, inductor L1 and capacitors C7, C8 convert pulse voltage into direct voltage, proportional to its duty cycle.

LEDs HL1 and HL2 are charger status indicators. The HL1 LED on means that the output voltage has been limited. The HL2 LED is on when the charging current is increasing, and off when the current does not change or decreases. When charging a healthy discharged battery, the HL2 LED will first turn on. Then the LEDs will flash alternately. The completion of charging can be judged by the glow of only the HL1 LED.

By selecting resistor R7, the optimal contrast of the image on the LCD display is established.

The R11 current sensor can be made from a piece of high-resistance wire from a heater coil or from a powerful wirewound resistor. The author used a piece of wire with a diameter of 0.5 mm and a length of about 20 mm from the rheostat.

The ATmega8L-8PU microcontroller can be replaced by any of the ATmega8 series with a clock frequency of 8 MHz and higher. The BUZ172 field-effect transistor should be installed on a heat sink with a cooling surface area of ​​at least 4 cm2. This transistor can be replaced with another p-channel transistor with a permissible drain current of more than 1 A and low open-channel resistance.

Instead of transistors KT3102B and KT3107D, another complementary pair of transistors with a current transfer coefficient of at least 200 is suitable. If transistors VT1-VT3 operate correctly, the signal at the transistor gate should be similar to that shown in Fig. 2.

Rice. 2. Gate signal graph

Inductor L1 is removed from the computer power supply (it is wound with a wire with a diameter of 0.6 mm).

The microcontroller configuration must be programmed according to Fig. 3. The codes from the V_A_256_16.hex file should be entered into the microcontroller program memory. The following codes must be written to the EEPROM of the microcontroller: at address 00H - 2CH, at address 01H - 03H, at address 02H - 0BEH, at address 03H -64H.

Rice. 3. Programming the microcontroller

You can start setting up the charger without an LCD and a microcontroller. Disconnect transistor VT4, and connect the connection points of its drain and source with a jumper. Apply a supply voltage of 16 V to the device. Select resistor R10 such that the voltage on it is within 1.9...2 V. You can make this resistor out of two connected in series. If a 16 V voltage source is not found, apply 12 V or 8 V. In these cases, the voltage across resistor R10 should be about 1.5 V or 1 V, respectively.

Instead of a battery, connect an ammeter and a powerful resistor or car lamp in series to the device. By changing the supply voltage (but not lower than 7 V) or selecting the load, set the current through it to 1 A. Select resistor R6 so that the output of op-amp DA2.2 has a voltage of 1.9...2 V. Like resistor R10, It is convenient to make resistor R6 out of two.

Turn off the power, connect the LCD and install the microcontroller. Connect a resistor or a 12 V incandescent lamp with a current of about 0.5 A to the output of the device. When you turn on the device, the LCD will display the voltage at its output U and the charging current I, as well as the limiting voltage Uz and the maximum charging current Iz. Compare the current and voltage values ​​on the LCD with the readings of a standard ammeter and voltmeter. They will probably vary.

Turn off the power, install jumper S1 and turn on the power again. To calibrate the ammeter, press and hold the SB4 button, and use the SB1 and SB2 buttons to set on the LCD the value closest to that shown by the reference ammeter. To calibrate the voltmeter, press and hold the SB3 button, and use the SB1 and SB2 buttons to set the value on the LCD equal to that shown by the reference voltmeter. Without turning off the power, remove jumper S1. Calibration coefficients will be written to the microcontroller EEPROM for voltage at address 02H, and for current at address 03H.

Turn off the power to the charger, replace the VT4 transistor, and connect a 12 V car lamp to the output of the device. Turn on the device and set Uz = 12 V. When Iz changes, the brightness of the lamp should change smoothly. The device is ready for use.

The required charging current and maximum voltage on the battery are set using buttons SB1 "▲", SB2 "▼", SB3 "U", SB4 "I". The charging current change interval is 50...950 mA in 50 mA steps. The voltage change interval is 0.1...16 V in steps of 0.1 V.

To change Uz or Iz, press and hold the SB3 or SB4 button, respectively, and use the SB1 and SB2 buttons to set the required value. 5 s after releasing all buttons, the set value will be written to the EEPROM of the microcontroller (Uz - at address 00H, Iz - at address 01H). It should be borne in mind that holding the SB1 or SB2 button pressed for more than 4 s increases the speed of parameter change by approximately ten times.

The microcontroller program can be downloaded.


Publication date: 25.09.2016

Readers' opinions
  • Oleg / 05/19/2018 - 21:49
    Please send me the eeprom firmware file by email [email protected] I've been pushing for over a month and the flower doesn't come out!!!
  • Sasha / 01/19/2018 - 19:10
    Folks, has anyone assembled this device!
  • Yuri / 01/19/2018 - 18:35
    Question to the author. The output of microprocessor 1 is hanging in the air. This is not a typo.
If you find an error, please select a piece of text and press Ctrl+Enter.