In this paper, a design method of street lamp energy-saving controller based on single-chip computer is discussed. The energy-saving principle of the controller is expounded.
The operation mode of reading and writing of DS1302 clock chip is emphasized.
The circuit connection diagram and some examples of C language program of single-chip computer are given. With the sustained and rapid development of China’s economy and society, the problem of energy shortage has become increasingly prominent, especially in the peak period of electricity use, the lack of electricity is more serious. The road lighting electricity accounts for a considerable proportion, is an important aspect of energy consumption. Lighting energy-saving is becoming an important measure to save energy and protect the environment.
The controller designed in this paper is applied in the field of street lighting energy-saving. The microcontroller obtains accurate time information through the clock chip, so it can control the relay’s on-off state in different time periods. For example, at 23 o’clock at night, the vehicle is scarce. At this time, the relay is disconnected, the street lamp is out, and the time point of extinguishing can be set arbitrarily. Installation, every other street lamp installed, so that it will not be dark at night, but also achieve the purpose of energy saving.
Add a sound sensor to sense whether there is a vehicle passing by.
When a vehicle comes, the sensor detects the sound and outputs a low level to the MCU. The MCU immediately triggers the relay to close and the extinguished street lamp to light up. When the vehicle leaves, the sound disappears, thermostatic element the sensor outputs a high level to the MCU, the MCU triggers the relay to disconnect, the street lamp to turn off again, and continue to save energy. The hardware block diagram and physical diagram of the system are shown in Figure 1, including single chip computer, clock chip, sound sensor, keys, 12864 LCD screen, relay, system power supply, etc. The model of single chip computer is AT89S52, which is a low-power, high-performance 8-bit microcontroller based on CMOS technology.
It has 8K in-chip program memory. The clock chip DS1302 can provide time information such as year, month, day, hour, minute, second and week, and communicate with single chip computer synchronously through three simple serial interfaces.
The LCD module model is 12864, which contains the simplified Chinese Library of the first and second levels of the national standard. The display resolution is 128*64, which constitutes the human-computer interaction interface of the controller. The relay adopts solid-state DC-controlled AC type.
The trigger voltage of the control terminal is 3V to 32V DC signal. The output terminal is connected to 220V AC circuit. The solid-state control terminal and the output circuit are reliably isolated by optocoupler. The switching noise is very small, which does not affect the normal operation of the single-chip computer control system. Sound sensor: The electret is used as a pickup, through the voltage comparison of LM393 output high and low level signal, when detected sound output low level, conversely output high level, sensitivity can be adjusted.
The schematic diagram of the clock chip interface circuit is shown in Figure 2. The X1 and X2 terminals of DS1302 are connected with 32.
768 KHz crystal oscillator by two capacitors of 30 pf ceramic plates, which provide clock rhythm for their work. The VCC1 terminal is an external lithium battery pin, which connects to the positive pole of 3V lithium battery. The 2032 button battery is generally used to save circuit board space. CLK, I/O and REST are connected with three general I/O ports of MCU respectively to realize the reading and writing operation of internal registers of DS1302. These three pins constitute the SPI communication circuit. The program design of street lamp energy-saving controller mainly includes three parts: DS1302 clock chip read-write program, LCD read-write operation program, relay action program [2]. Relay 1 corresponds to turn on 220V voltage, relay 2 corresponds to turn on 170V voltage and relay 3 corresponds to turn on 185V voltage.
Relay control terminal achieves high level, the output terminal is closed, otherwise the output terminal is disconnected [3]. This paper studies the hardware and software design of street lamp energy-saving controller, designs the hardware circuit of the controller, and expounds the key program code. At the same time, the hardware system is built.
Experiments have achieved the desired results, which lays a solid foundation for further research in the field of electrical control in the future.