
The application of solar street light control in people’s production and life is of great significance. With the continuous progress of society and the development of cities, people’s living standards are constantly improving. People are paying more and more attention to the construction of road lighting projects in cities, and the requirements for energy utilization are becoming higher and higher. At the same time, the requirements for the traffic environment are becoming higher and higher. Street lights are an important component of the comfort of the traffic environment. Due to the extensive use of street lights in road lighting engineering, the consumption of electrical energy caused by street lights is enormous, and the power supply control method of street lights is increasingly valued by people. Therefore, how to adopt energy-saving technologies to reduce the energy consumption of urban public lighting has become an urgent problem to be solved in the energy utilization of traffic lights in major cities.
In traditional street light control system design, the lighting system is mostly manually timed to turn on and off, without considering whether there are people passing on the road. This design, especially on rural roads, causes significant waste of electricity and increases the power supply burden on the power system. Based on the comprehensive consideration of cost and performance, a design scheme for a solar street light intelligent control system with STC89C52 microcontroller as the core controller is studied. The human infrared sensing module is used to detect whether someone is passing through the street light. When no one passes through the street light, the street light emits weak light to achieve a certain lighting purpose. If someone passes through, it emits strong light to achieve normal lighting and better achieve energy-saving goals.
1. System design structure and principle analysis
The design of an intelligent control system for solar street lights based on STC89C52 microcontroller is divided into two parts: the power circuit design diagram and the control system design diagram, as the power supply part is relatively complex.
1.1 Power circuit structure
In the design of solar street light intelligent control system, there are two power supply methods for the control system. The first method is for solar panels to receive light energy, convert it into electrical energy, store it in a lithium battery, and supply power to the solar street light intelligent control system from the lithium battery. The other method is to convert 220V mains power to 12V DC power, then reduce the voltage to 6V, and supply power to the solar street light intelligent control system.
1.2 Control System Structure
The switch of street lights no longer relies on manual operation, but uses the STC89C52 microcontroller as the core control device. By designing hardware circuits and utilizing various sensors and relays, automatic control of street light switches is achieved. The system hardware circuit includes a microcontroller, clock circuit, reset circuit, analog-to-digital conversion circuit, photosensitive sensing module, human body sensing module, LCD display circuit, LED street light module, relay 1 control circuit, relay 2 control circuit, relay 3 control circuit, relay 4 control circuit, etc.
In the design of the intelligent control system for solar street lights, the STC89C52 microcontroller is the core unit of the entire system, which has a direct impact on the control effect. By collecting signals from the surrounding environment light and human body, the status data is transmitted in the form of digital signals to achieve real-time detection of the surrounding environment light and real-time control of the lighting of the street lights with and without human traffic. At the same time, the microcontroller also completes the task of real-time detection of the voltage status of the lithium battery. Based on the different voltages and surrounding light, it controls the relay module in real time to determine the charging, power supply status, and mains power supply status of the lithium battery.
2. Key points of system design
2.1 Sensor selection
2.1.1 Selection of photosensitive sensors
Based on a comprehensive analysis of the characteristics of various relevant sensors, this article selects a photosensitive resistor to form a photosensitive sensing module. Photosensitive resistors are sensitive to ambient light and are generally used to detect the brightness of the surrounding environment. LM393 comparators are used for output, resulting in clean signals and strong driving capabilities. Convert analog signals into digital signals and send them to the microcontroller. When the ambient light brightness of the module does not reach the set threshold, DO outputs a high level. When the external light brightness exceeds the set threshold, D0 outputs a low level. The microcontroller detects the high and low levels and can control the on/off of the street lights.
2.1.2 Selection of Human Body Sensing Module
The infrared human body sensor model used in the human body sensing module is HC-SR501. The core component of HC-SR501 is the LH1778 probe imported from Germany, which has extremely high sensitivity and strong reliability. This device has been widely used in various types of automatic sensor devices, especially in battery powered automatic control devices.
2.1.3 Selection of relays
In this design, a small relay with the model of Songle SMI-05VDC-SL-2C is used. This device can control the connection or disconnection of its internal normally open contacts and normally closed output points based on the control signal sent by the microcontroller, complete the corresponding connection and disconnection operations, and ultimately achieve the connection or disconnection of the power supply circuit of the control system.
2.2 System Power Circuit Design
The system power circuit is controlled by four relays, as shown in Figure 1. The power supply of the solar panel module and the 220 to 12V transformer module is switched and controlled by relay 1 in the relay group. At dawn, relay 1 selects the solar panel by default and inputs the converted solar energy into the circuit. The corresponding voltage signal is rectified and filtered, and then output a 6V DC voltage through the LM7806 regulator. After being stabilized by LM7805, it is sent to the TP4056 charging module to charge the battery. When the battery voltage rises to 6V, the voltage is sent to the control system, In this design, three 18650 lithium batteries are selected, and the charging cutoff voltage of a single lithium battery is 4.2V.
When it gets dark and the voltage of the lithium battery is insufficient, the signal sent by the corresponding port of the microcontroller causes relay 1 to act, open and close normally, connect to the mains power, convert 220V AC mains power through a transformer and rectifier bridge into pulsating DC power, and then filter it through the filtering circuit. The voltage is stabilized by the voltage stabilizing circuit LM7806 to supply power to the control system. The sequence of relay action is that relay 1 transfers the transformer voltage to the rectifier circuit, while relay 3 is disconnected to prevent charging the battery. Then, relay 4 is closed to send the mains power to the control system. After the power supply is stable, relay 2 disconnects the lithium battery power supply circuit.
The output voltage of the solar panel and transformer is rectified and stabilized using one LM7806 circuit. Relay 1 is used to control the on/off of the output voltage between the solar panel and the transformer.
2.3 Overall System Design
In the design of the intelligent control system for solar street lights, the STC89C52 microcontroller is chosen. The design of other parts is divided into modules and blocks, and finally integrated into one to complete the design of the entire system. Finally, the debugging of the entire system is carried out.
By integrating the microcontroller, clock circuit, reset circuit, and power interface, a minimal system of the microcontroller is formed to ensure the normal operation of the entire system. Its clock circuit provides a stable clock signal for the microcontroller, and its reset circuit allows the microcontroller to start running programs from the initial state, ensuring that the system quickly gets rid of the runaway state and quickly returns to normal operation.
The function of the analog-to-digital conversion circuit is to achieve real-time detection of lithium battery voltage. When it is dark and the lithium battery voltage is below a certain value, the microcontroller sends a control signal to activate the relay, connect the mains power, and use the mains power to supply power to the control system. During the day, when the lithium battery voltage is above a certain value, the microcontroller sends a control signal to activate the relay and stop the solar panel from charging the lithium battery.
The photosensitive sensing module is used to detect the brightness of the surrounding environment’s light. The photosensitive resistor module outputs a high level when the ambient light brightness does not reach the set threshold. When the external light brightness exceeds the set threshold, D0 outputs a low level. D0 is connected to the microcontroller P2.5 and detects the high and low levels through the microcontroller to control the brightness of the street lights.
The function of the human body sensing module is that when someone approaches the street lamp, due to the influence of human body temperature, the pyroelectric element of the infrared sensing source will lose its charge balance when it receives changes in the infrared radiation temperature of the human body, and release the charge outward. After the subsequent circuit is detected and processed, it can generate a signal and send it to the microcontroller. The microcontroller makes a judgment and controls the LED light to turn on or off.
The LCD display circuit uses LCD1602 liquid crystal to display the voltage value of the lithium battery in real time, so that maintenance personnel can check the voltage parameters of the lithium battery.
The LED street light module controls different signals detected by the microcontroller accordingly. After midnight, when there are fewer pedestrians, only one set of street lights is lit to reduce battery loss. When pedestrians pass by, the human body sensing module will send a signal to the microcontroller, and the microcontroller will output a signal to light another set of street lights. When pedestrians leave the detection range of the human body sensing module, the first set of lights will be restored to light after a certain delay, The second group goes out, and at 5 o’clock in the morning, both sets of lights are on. When the photosensitive element detects light, all the street lights go out.
In the relay control circuit, the function of relay 1 control circuit is to achieve switching control between solar panels and mains power. The function of relay 2 control circuit is to control the power supply from lithium batteries to the control system. The function of relay 3 control circuit is to achieve charging control of lithium batteries. The function of relay 4 control circuit is to control the power supply from the mains to the control system.
3. System software design
In the design of the intelligent control system for solar street lights, the corresponding software program design is also crucial. In the system design, the main program, LCD display subfunctions, ADC analog-to-digital conversion subfunctions, night lithium battery voltage detection subfunctions, day lithium battery voltage detection subfunctions, and street light on/off control subfunctions are carried out. From the perspective of the overall control program, it is mainly carried out according to the process of system initialization, LCD initialization, environmental condition detection, and street light on/off control.
During this process, the main function of the main program is to initialize the system (including timer initialization), LCD initialization, dynamic display of lithium battery voltage value, cyclic detection of environmental conditions, and control of street light on/off. Throughout the entire process of system operation, sensors continuously detect the environmental conditions of the street lights, determine the power supply mode of the system and the on/off status of the street lights based on the different environments. During the day, the microcontroller sends out corresponding control signals, and the relay selects the solar panel to supply power to the entire control system; At night, the microcontroller sends out corresponding control signals, which are converted from lithium batteries or 220V mains power to 6V DC power to supply the entire system. Meanwhile, at night, the on/off status of the street lights is determined based on the specific situation of pedestrians detected. If it is in an unmanned state, the brightness of the street lights is half of the normal brightness, which can illuminate the road. If it is in an occupied state, the brightness of the street lights is normal brightness to facilitate people’s walking. Through this design, the goal of energy conservation is achieved simultaneously.
4. System debugging
The main problem encountered during the debugging of the designed solar street light intelligent control system was the chaotic operation of the four relays. The solution adopted was to adjust the action time of the four relays. Four relays each have their own responsibilities. Relay 1 is responsible for switching the output voltage of the solar photovoltaic panel and transformer, relay 2 is responsible for controlling the on/off of battery power supply, relay 3 is responsible for controlling the on/off of battery charging circuit, and relay 4 is responsible for supplying DC 6V to the control system. During the day, the relay is in the default state. When the battery voltage fails to reach 5V, relay 3 is engaged and the battery is charged. At night, relay 3 returns to its initial state. When the battery voltage is insufficient, relay 1 should be activated first, and relay 4 should be activated first. When the LM7806 output voltage is supplied to the system, relay 3 will activate and disconnect the battery power supply after a delay of 0.5 seconds. When the LM7806 outputs 6V to switch battery voltage, the photosensitive module detects light, and relay 2 will activate the battery power supply. After a delay of 0.5 seconds, relay 2 will disconnect and relay 1 will return to its initial state.
5. Summary
The solar street light intelligent control system designed based on STC89C52 microcontroller has a good application effect in changing the traditional street light power supply mode, saving electricity and lower cost. This article studies a solar street light intelligent control system with STC89C52 microcontroller as the control core, which has certain practical value.