Design of 24V/5A solar controller circuit using P87LPC767 microcontroller and LM317

Publisher:ZhenxiangLatest update time:2023-04-13 Source: elecfansKeywords:P87LPC767 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

Energy is an important material basis for the existence and development of human society. The current world energy is dominated by fossil energy such as coal, oil and natural gas. Fossil energy is a non-renewable resource and produces a large amount of pollutants during production and consumption, destroying the ecological environment.


Solar photovoltaic power generation, which converts unlimited, clean solar radiation energy into electrical energy through solar cells, is an important member of the new and renewable energy family.


1. Basic principles and volt-ampere characteristics of solar cells

When an object is exposed to light, the charge distribution state in the object changes to generate electromotive force and current. This phenomenon is called the photovoltaic effect. This effect occurs in both liquid and solid substances. But only in solids, especially in semiconductors, will there be higher conversion efficiency.


A solar cell is a device that uses the photovoltaic effect to convert light energy into electrical energy. When sunlight shines on the semiconductor PN junction, a voltage will be generated on both sides of the PN junction, causing the PN junction to short-circuit, thereby generating current. This current increases with the increase of light intensity. When the received light intensity reaches a certain amount, the solar cell can be regarded as a constant current power supply.

For solar cell arrays, the number of series and parallel solar cell modules should be determined according to user requirements, load power consumption and technical conditions. The number of series connections is determined by the working voltage of the solar cell array, and the impact of the battery's floating charge voltage, line loss and temperature changes on the solar cells should be considered. The capacity of the battery determines its maximum charging current. This value, combined with the load current, determines the number of parallel solar cells.


The output characteristic diagram of the solar cell is shown in Figure 1. The output volt-ampere characteristic curve of the solar cell is one of the most important technical data for system analysis. As can be seen from Figure 1, the volt-ampere characteristics of solar cells have strong nonlinearity.

In photovoltaic systems, the matching characteristics of the load determine the operating characteristics of the system and the effective utilization of solar cells. In order to obtain the maximum power in a solar cell power supply system, it is necessary to track the sunlight intensity and ambient temperature conditions and constantly change the load impedance to achieve the best match between the array and the load. This method is called maximum power point tracking (MPPT). Unjust law.


2. Low power solar controller

Figure 2 is a circuit structure diagram of a small-power solar controller. The battery and solar array are directly coupled. When there is sunlight during the day, the solar array charges the battery. When there is insufficient sunlight at night or on cloudy days, the battery discharges to ensure that the load does not lose power.

For small-power solar controllers, in order to save costs, the commonly used control method is the constant voltage tracking CVT method, that is, by reasonably selecting the number of series and parallel solar cells, the operating voltage of the array near the maximum power point is approximated by the battery Terminal voltage, the best voltage matching between the battery and the solar cell array can be obtained.


3. 24V/5A solar controller circuit analysis

Figure 3 is the main circuit circuit diagram of the 24 V/5 A solar controller. The controller adopts the form of a single-channel bypass type charge and discharge controller, that is, the MOSFET tube S1 is connected in parallel to the output end of the solar cell array. When the battery terminal voltage is charged to the average charge voltage value, S1 enters the pulse width modulation state to avoid battery overload. Charge.


In Figure 3, Vin+ and Vin- are connected to the output of the solar array, Vout+ and Vout- are connected to the DC load, and VB and GND are connected to the positive and negative ends of the lead-acid battery.

D1 is an "anti-reverse charging diode". Only when the output voltage of the solar cell array is higher than the battery voltage, D1 can be turned on. Otherwise, D1 is turned off, thus ensuring that the battery will not reverse charge to the solar cell array at night or on rainy days. , which plays the role of "anti-reverse charging protection".


D2 is an "anti-reverse connection diode". When the polarity of the battery is reversed, D2 is turned on, causing the battery to be short-circuited and discharged through D2, which generates a large current and quickly blows out the fuse F1, thus playing the role of "battery reverse connection protection" .


MOSFET tube S2 is the battery discharge switch. When the lead-acid battery is discharging, from the perspective of protecting the battery, when the battery voltage is less than the "over-discharge voltage", S2 is cut off, cutting off the circuit between the battery and the load, and performing "over-discharge protection". Avoid emptying the battery and damaging the battery. When the solar cell array re-energizes power, only when the battery voltage rises to the float voltage again, S2 will be re-conducted and the load circuit will be connected.


It should be pointed out that when the control circuit cuts off the load loop, the control circuit still consumes battery energy, so the control circuit should minimize electronic components to reduce power consumption. For this purpose, the circuit uses the P87LPC767 microcontroller of PHILIPS company as the CPU. This microcontroller is a 20-pin packaged microcontroller. Its basic structure is compatible with the 51 series and is suitable for many occasions requiring high density and low cost. It contains 4KB of OTP program memory and 128B of RAM, and has built-in 4-channel 8-bit A/D converters. Especially when operating at 100 kHz ~ 4 MHz and the power supply voltage is 3.3 V, its power consumption current is only 0.044 ~ 1.7 mA, which is very suitable for battery-powered systems.


Due to size and cost constraints, the power supply of the control circuit with the microcontroller as the core is directly converted from the battery terminal voltage. The circuit converts the power supply voltage of the microcontroller through the LM317 three-terminal adjustable voltage regulator in Figure 4. The control circuit is connected to the main The circuits share ground.

Design of 24V/5A solar controller circuit using P87LPC767 microcontroller and LM317

LM317 is a three-terminal adjustable positive voltage regulator with an output voltage range of 1.25 to 37 V. The output voltage can be set with only 2 external resistors. The reference voltage VREF of 1.25 V is provided between the output terminal Vout and the adjustment terminal adj of LM317, and the output voltage satisfies formula (1).


Since the input and output voltage difference of LM317 is 40 V, and for a 24 V solar controller, the open circuit voltage of the solar cell array may reach 50 V. In order to avoid instant overvoltage, the input terminal of LM317 is connected in parallel with the voltage regulator tube D13. Protect.


Figure 5 is the pin connection diagram of the microcontroller P87LPC767. The main function of the microcontroller in the circuit is to measure the battery terminal voltage, and then control the conduction status of S1 and S2 to ensure the stable operation of the circuit. Since P87LPC767 has its own 8-bit AD, and the microcontroller shares the ground with the main circuit, direct resistor voltage division measurement can be used, that is, VAD1 in circuit diagram 5.

When the load of the controller is a street light, it should have a light control function, that is, when there is sunlight, S2 cuts off at night or when there is insufficient light on rainy days, S2 is turned on and the street light is illuminated. Since the output voltage of the solar cell array drops significantly when there is insufficient light, the light condition can be judged by measuring the partial voltage of its output voltage (VAD2), which can be used as a basis for judging the conduction and cutoff of S2.


P87LPC767 uses P1.7 (Fzs) and P1.6 (PWM) as the gate control signals of the two MOSFETs. Taking the control of S1 as an example, when P1.6 outputs a high level, the MOS tube S1 is turned on, the S1 gate drive signal vgs1 is pulled low, and S1 is turned off. As shown in Figure 6. Since the gate drive voltage of MOSFET cannot exceed 20 V, when the output of P1.6 is low level, V5 is cut off, and the battery voltage is divided by R9 and R13 to generate the drive signal of S1. The connection method of S1 and S2 in the main circuit can solve the problem of common ground of their drives.

Figure 6 MOSFET drive circuit. The controller is also equipped with a battery discharge capacity indicator light, as shown in Figure 7. The four light-emitting diodes correspond to 100%, 75%, 50% and 25% of the battery capacity respectively. After measuring the battery terminal voltage, P87LPC767 determines the on and off conditions of the four light-emitting diodes according to its value. It should be pointed out that when the battery is charging, its terminal voltage has no direct relationship with its capacity, and the indication of the light-emitting diode has no practical significance. Only when the battery is discharged, its terminal voltage can reflect the battery capacity to a certain extent.

4. Conclusion

A set of 24 V/5A solar controller circuit is provided, which is low in cost and stable in performance, and has the value of widespread promotion.

Keywords:P87LPC767 Reference address:Design of 24V/5A solar controller circuit using P87LPC767 microcontroller and LM317

Previous article:Design of anti-theft electric energy meter based on STPM01 metering chip and P89LPC9401 microcontroller
Next article:Design of short message monitoring system based on TC35T modem and P87LPC767 microcontroller

Recommended ReadingLatest update time:2024-11-22 20:46

[Picture] 250V power supply made with LM317T
This article discusses the design and production of a 0-250V, 100mA regulated power supply. It can be used to repair tube audio equipment or other devices, test capacitors, and as a general experimental power supply. The power supply output impedance is 15 ohms, and the output ripple is less than 20mV.
[Power Management]
[Picture] 250V power supply made with LM317T
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号