Realization of Wireless Remote Control Intelligent Street Lamp by Single Chip Microcomputer

. In order to better solve the huge power consumption of street lamps, it is not conducive to environmental protection and saving resources, and it is also to save manpower and financial resources. In this article, an infrared remote control LED light is designed, using the infrared control module and the single-chip control module, and also mainly used the characteristics of PWM combined with LED to save electricity. The designed LED light can be combined with the app on the mobile phone to realize the combination of software and hardware, and the control of the street light can be realized on the mobile phone. This article also propose to convert solar energy into electricity for street lighting, which is the direction of subsequent research and development.


Introduction
Humans have been pursuing light for a long time. From the discovery of the initial fire and learning to use it, to the electrical age, humans have successively invented incandescent lamps, fluorescent lamps, HID lamps and LED lamps. LED lights have developed rapidly in the more than 100 years since they were invented, and they are still the most widely used electric lights by humans. Today's LED lights have a significant energy saving effect, can be used for a long time, and can be used in a wide range, so it will be determined that there will be a larger market in the future.
The street light market is no exception. But nowadays, most of the use of LED is still the traditional way of use, that is, the user only realizes the simple operation of turning on and off the light through a switch. This is inconsistent with the gradual intelligentization and high-tech of people's lives in the future. In the use of street lights on the road, people need to make the functions of street lights more detailed and comprehensive. This can not only save energy, reduce electricity bills, maintenance and other expenses, but also bring better lighting experience to pedestrians and car drivers on the road. So I use the single chip microcomputer，in order to realize the expansion of the function of ordinary street lamps.Firstly, using energy-saving LED lamps to initially save energy, and at the same time, using pulse width modulation to control the duty cycle to adjust the actual average output power. The LED lights are used in combination with the infrared pulse transmitting and receiving device and the single-chip microcomputer, and finally the application on the mobile phone can control a series of operating parameters such as the lighting intensity, color, and fault information of the street light. My research is in line with the development trend of future street lights, can meet people's expectations for

General principles overview
The street light system designed in this article is mainly to achieve infrared wireless control, brightness adjustment, change the color temperature of the light source and other functions. When the wireless acceptance module in the system receives the infrared signal, the signal is processed accordingly and the internal related modules and devices are run, so as to achieve the corresponding lighting effect of the final LED lamp and achieve correct feedback. The design of this system has three main parts: wireless transmission, microcontroller, led lights. As can be seen from Figure 1, the input signal of the system is completed by the transmitting module and transmitted to the Micro Chip Unit (MCU) as the core component of the system, its function is to process and analyze the input signal, and then after screening, the Pulse Width Modulation (PWM) signal and the switch control signal are transmitted to the LED circuit, the LED light is composed of three colors of red, green and blue lights, and their state can change the state because of the change of the signal, so as to achieve the effect of controlling brightness, color temperature and so on.

The principle of led light
Led lamps are essentially the principle of using the electrons in semiconductors to be pushed by electric currents, so that electrons enter the p-zone, and the energy generated after compounding with holes is released in the form of light. The real use of p-n knots formed by p-type and n-type semiconductor materials is used to emit light.  figure 2, the specific process of producing light is as follows, in the process of work, it should be applied to the forward bias pressure, and when the p-n junction has no applied electric field, because the p-region semiconductor material has many holes, and the n region has multiple electrons, because of the free diffusion movement of the carrier, the part of the hole carrier in the p region diffuses to the n region, the same reason, the part of the electrons in the n region will also diffuse to the p region.
And because the diffusion capacity is limited, most of the diffuse carriers stay near the sides of the junction area, and it is obvious that an internal field will be formed at this time. When a voltage is applied in the opposite direction of the built-in field as shown in the figure, it will gradually cancel out the effect of the built-in field and cause more holes to move to the n-region and the electrons to the p-region. The above-described moving carrier will be compounded with most of the carriers in this area, and the energy generated will make it emit light, which is the principle of LED lamp illumination.

PWM dimming principle
In the circuit design of this paper, the purpose of using PWM is mainly to reduce the power of the load and reduce the power consumption under the premise of fully combining the characteristics of the LED lamp and the human eye and not affecting its normal lighting effect. The full name for PWM is "Pulse Width Modulation", which is pulse width modulation. Pulse width modulated signal, is a square wave signal with a certain frequency, its period is fixed, its average power is determined by the proportion of duty cycle, the higher the duty cycle, the average voltage of the output will also increase accordingly, resulting in an increase in the average power of the output, then the power consumed will also become more. Secondly, it is very important that when the current through the LED changes, the lighting state of the LED lamp will also change. One of the most important changes is that the color will change, and the ability of our human eyes to feel different wavelengths of light is not the same, for example, we are more likely to see the light of long wavelengths, which is why the stop light of the traffic light is red. The modulation method of PWM will make the LED change the brightness without changing the wavelength of the light of the original illumination. At the same time, because the human eye can not feel the state of the constantly flashing lights reaching a certain frequency, so even if the LED lights are constantly switched on and off according to the frequency of the square wave signal, the human eye will feel that the lights have been in a stable lighting state, which will not affect our experience, but can achieve the effect of saving electricity.

Core control module
3.4.1. MCU. In this design, the single-chip microcomputer was selected as one of the cores of the control module, and the essence of the single-chip microcomputer is actually the computer, although its volume is small, but it has great functions. Since its invention, it has been applied to a large range. MCU will be all the functions concentrated on a small development board, there are many interfaces, can be connected to a variety of equipment or chips to achieve functional expansion, in this design is no exception, on the basis of the MCU connected to the infrared control module and LED lamp module.   figure 3, it is a pin diagram of the MCU STC89C52, which has a timer/counter and an external interrupt, and has three operating modes, namely normal mode, power-down mode and idle mode.
As shown in figure 4, is the main control circuit in this design, p1.4, p1.5, p1.6 output PWM signal, directly connected to the LED light to make it blink, p1.7 accept infrared input signal. This makes it possible to connect the main three modules.

3.4.2.
Infrared remote control. Infrared remote control, as the name suggests, by emitting infrared light to certain devices to obtain the role of remote control. In this design, infrared rays are sent to the MCU and the MCU is allowed to process information. The use of infrared remote control can be seen everywhere in our lives, such as television, air conditioning remote control can bring us great convenience. When using infrared remote control, the advantage is that it is very easy to operate and difficult to be interfered with. For example, when remotely controlling a street lamp, it will not interfere with the street lights of other places. The infrared remote control in this production film can be controlled by the infrared emitter of the mobile phone. Nowadays, smart phones are developing rapidly, with high technology content and easy to carry, the infrared signal is stored in the software of the mobile phone, and the accurate remote control of the street lamp can be realized through the control and modulation of professionals.

Mobile app design
Before that, the design of hardware circuit needs to design the mobile phone app using it. In this software design process, we need to pay attention to the following points: first, it can have the function of sending infrared signals. The mobile phone app triggers the mobile phone to send mobile phone signals to the street lamps. After the single chip microcomputer in the street lamps receives the signals, it processes the information to make the street lamps adjust the lighting; In addition, the mobile app needs to be simple and easy to operate, which can reduce the training cost of professionals; Finally, it is also very important that this special app can not be downloaded at will. It can only be downloaded and used with some permission. Otherwise, some irrelevant personnel will take advantage of this convenience to do some pranks or even illegal things, which will have a bad impact on urban order. Figure 5. Infrared control app interface. As shown in figure 5, this is the designed mobile phone software interface. The functions corresponding to all buttons are received by sending infrared rays to the MCU and then realize the functions. In the control interface of this app, the upper left corner is the switch button, and below are the red, green and blue light switches, and then the color temperature adjustment and brightness adjustment. However, for the control of street lights, it may be necessary to add a GPS positioning system to achieve the purpose of precise positioning, and it should also have the ability to control a large number of street lights at the same time. Figure 6. Waveform changes before and after switching. As shown in figure 6, it is the change of the square wave before and after the switch is turned on. As mentioned above, PWM is a waveform, so before the switch is closed, the LED light has no waveform. After the switch is closed, such a square wave is formed.  As shown in figure8, this is the spectrum of the red light test. The peak is between 600nm and 650nm, which is obviously in line with the red spectral wavelength range. At this time, the input power is 0.74w, and the luminous flux is 30.2lm.

Results
Similarly, as shown in figure9, this is the spectrum of the test green light, whose wavelength range is about 470nm to 570nm, which also conforms to the wavelength range of green light. The input power is 1.15w and the luminous flux is 93.3lm. Then there is the spectrum of the blue light test like figure 10, whose wavelength range is about 420nm to 520nm, which is also in line with the wavelength range of blue light. At this time, the input power is 1.06w and the luminous flux is 28.2lm.

Discussion
This post has been done with my reference and input from many other papers and other products. This article mainly designs a led light that can be controlled by remote infrared. The feature of this light is that it can be easily controlled by the downloaded app on the mobile phone, which is very convenient and easy to use. But I think my design still has a lot of room for improvement, such as generating electricity from solar energy that I mentioned earlier. One of the big goals of the product designed this time is to save energy, although PWM can save energy to a certain extent, which is the reason why led lights save electricity. But I think the best way to save energy at the source is to use solar energy. The use of street lamps is mostly used outdoors, which means that street lamps have a very convenient way to obtain solar energy. Street lights can harvest solar energy during the day and store the converted electricity in batteries, and then use the stored electricity at night when the light is dim. In some cases, if there is no need for special operations on street lights, street lights that automatically switch on and off can be designed through the characteristics of photoresistance. Of course, the premise is that enough electricity has been stored during the day to supply the use of the whole night. Secondly, I think the data of the position of the street light is very important, but this function cannot be reflected in the app I designed. Maybe in the future development, I can add this function to the street light.

Conclusion
In this design, the product is divided into three modules, namely infrared control, single-chip microcomputer and led light, combined with the designed mobile app, software and hardware to achieve the control of the light, which brings us convenience and saves money. resource. Among them, app control is the most important point in my opinion, because everyone has a mobile phone now, and almost everyone uses a smartphone. The control of mobile app is very helpful to reduce the training pressure of professionals, and it can also reduce the workload of related personnel, to some extent, it may also reduce certain labor costs. Secondly, what I want to mention most is the use of single-chip microcomputer in the core control module. The single-chip microcomputer has the characteristics of small size and multiple functions. At the same time, it also has many I/O interfaces, which is conducive to future function expansion. In the subsequent development and research, if the use of solar energy to convert into electric energy for lighting is realized, it will be another great progress.