Shenzhen ZTRON Microelectronics Co., Ltd
Telephone
0755-8299 4126

Internet of things

Development of Intelligent LED Lighting Control System


Electric energy is widely used in various fields in people's daily life, from work to entertainment everywhere. Therefore, the waste of electric energy also exists in all walks of life. However, the electric energy wasted by lighting is often caused by unreasonable control. Huge and unnecessary. For the lighting in school classrooms, the waste of electric energy is mainly reflected in the phenomenon of "the indoor light is sufficient during the day, but the lights are still fully turned on" in each classroom, or the phenomenon of "no one turns on the lights". This requires a system that can not only manage classroom lights manually but also adjust the brightness of classroom lights according to the current illuminance and number of people in the classroom, and reduce the waste of electric energy by improving the humanized control of lights. Intelligent LED lighting can provide lighting according to actual needs through a programmable controller to make lighting more intelligent and humanized. Based on the STC89C52 microcontroller, this paper designs a humanized lighting control system through hardware and software.


1. Overall design of indoor LED lighting intelligent control system


The basic function of the system as a whole is to adjust the lighting of the classroom according to the specific number of people in the classroom and the natural lighting conditions, and design a lighting control method with its own creativity. The general block diagram of the system design is shown in Figure 1. The power supply module provides power to the number calculation module, control module and light intensity detection module through the control of the switch module. The light intensity detection module and the number calculation module transmit data to the control module, and the control module Then the lighting module and the display module are controlled accordingly according to the data of the two.


2. Hardware design of intelligent LED lighting system


The overall hardware of the system is mainly divided into controller circuit module, sensor circuit module and display circuit module. Its overall circuit hardware schematic diagram is shown in Figure 2. In this design, the author made a model with LED lamp power supply voltage of 5V, simulating classroom lighting.


图 2  系统整体硬件图


2.1 Controller circuit design


In this system design, STC89C52 is used as the controller of the whole system. The operating frequency of the single chip microcomputer is 8MHZ, which can meet the requirements of adaptive lighting dimming in theory.


2.2 LED lamp power supply design


The main purpose of the power circuit design is to provide stable DC power to the LED. The more common intelligent lighting systems on the market mainly use the PWM (pulse width modulation) function of the LED driver to control the duty cycle to adjust the voltage to control the brightness of the LED. The brightness of the classroom can be adjusted according to the degree of darkness. Since the electricity in the classroom is 220v alternating current, and the LED can only work normally under the condition of direct current, it is necessary to convert the alternating current into the required direct current through circuit design. In order to realize that classrooms can allow managers to control classroom lighting and intelligently adjust indoor lighting, and try to save lighting power consumption to the greatest extent, the power module can be roughly divided into two parts: when the SPDT switch is in By default, the control circuit in the upper part of the circuit diagram is connected, the system enters the state of automatic lighting control, and the current of 220v voltage enters the rectifier bridge through the switch to rectify the original AC current into DC current, and the current is filtered by C1. Entering the LM317 integrated block controls the current of the entire circuit in a constant environment, thus providing a stable working environment for the LED.


Otherwise, the system enters the manual control state, the 220v AC voltage is converted to 24v AC voltage through the transformer, and the 9v AC voltage is converted to DC by the rectifier bridge and filtered, and the 9v voltage is converted to a stable constant voltage of 5v through the LM7805 integrated block The source powers the LED lights.


2.3 Data acquisition module circuit design


There are two parts in this system design and data collection. The first is to detect the illuminance of indoor lights, and the second is to calculate and detect the number of people. These two parts cooperate with each other and work together to meet the needs of the entire system. demand. The sensor used for the detection of illuminance is PCF8591 integrated block, which integrates photoresistors, thermistors, etc., and has relatively powerful functions. Convert the analog data to digital data output. When PCF8591 performs data exchange and control, it must go through the IIC bus interface.


图 4  PCF8591 外部电路原理图


The thermistor is connected to the AIN1 pin of PCF8591, the photoresistor is connected to the AIN0 pin of PCF8591, the output pins are SC- and SDA for IIC bus protocol communication, SCL is the clock interface, SDA is the data interface, and the microcontroller software Programming simulates the communication protocol of the IIC bus to obtain data through the SDA interface.


2.4 Circuit Design of People Counting Module


The design of this module mainly uses two integrated infrared tubes to realize the function of calculating the number of people in the classroom, and its main design lies in the software design. The hardware of the module is a sensor module, and its appearance is a black tube and a transparent tube, which are the transmitting tube and the receiving tube respectively, that is, the transmitting tube emits infrared rays of a fixed frequency, and the receiving tube is used to receive infrared rays of this frequency. When an obstacle passes by, the signal passes through the comparator, which is the LM393 in the figure below, and after comparison, a low level is sent out at the output terminal, which is convenient for the controller to identify.


图 5  红外对射模块原理图


2.5 Display module circuit design


The main function of this module is to display the number of people in the current classroom through the LCD screen, which is not only convenient for observers to count the number of people in the entire classroom, but also convenient for managers to identify the stability of the classroom lighting adaptive system. The display module is mainly displayed by LCD1602, which is implemented in this system to display the current number of people in the classroom, the current classroom illumination and the current classroom temperature and so on.


3. Software Design of LED Intelligent Lighting System


First of all, the system should be combined with some conventional switch controls to prepare for emergencies. The next step is to design the specific content of the system. The first thing is to detect the current number of people in the classroom. If there is no one in the classroom, the lights will not be turned on. Whether the illuminance reaches the standard, if it is not up to the standard, calculate the difference between the current illuminance value and the standard value through the single-chip microcomputer, and then adjust the light through the PWM function, otherwise, do not turn on the light. The overall program flow chart is shown in Figure 6.


3.1 People counting program


The people counting program is a relatively important part, because on the premise of calculating the current number of people in the classroom, the lighting of the classroom can be controlled more flexibly according to the number of people, so as to save electricity to a greater extent. In addition, the number counting function will also bring some added value, such as reducing the number of roll calls in class and saving more learning time for class. However, the accuracy of counting the number of people is a key factor related to whether it can be promoted, so when writing programs, try to consider various special situations to prevent errors when calculating the current number of people in the classroom. The people counting module can accurately count the current number of people in the classroom, and feed back the number of people to the controller, which then controls the indoor lights.


3.2 Light intensity acquisition module


The light intensity is measured by the photoresistor, and the digital signal of the light intensity can be obtained by using the PCF8591 module, and then transmitted to the single-chip microcomputer. When the IIC protocol is turned on and the IIC protocol is turned off, the data line SDA has a falling transition and a rising transition at the stage when the clock line SCL is kept at "1", that is, the falling edge and the rising edge respectively, and now it is simulated by the program The falling and rising edges.


For the simulation of the falling edge, first set SDA=1, delay for a short period of time, and then let SDA=0, from the perspective of the single-chip compiler program, the program principle conforms to the simulation method of the falling edge, for the simulation of the rising edge as long as Just reverse the above principle.


When there are people in the classroom, check whether the indoor illumination reaches the standard. If it meets the standard, the light is still off. If it does not meet the standard, the light is turned on, and the brightness of the light is adjusted according to the indoor illumination. The average voltage is controlled by adjusting the duty cycle of the pulse width modulation (PWM) waveform, thereby controlling the brightness change of the light.


Summarize


This design uses single-chip programming to design software and hardware, and judges the number of people in the classroom and the intensity of light, as well as PWM control, intelligently controls the brightness of the lights in the classroom. At the same time, the design of the power circuit enables the system to switch between manual control and intelligent control according to the actual situation, which is more flexible. The effect of the physical experiment is ideal, which has further promotion and practical value.


The above is an example of the development of an indoor LED lighting intelligent control system based on single-chip microcomputer and PWM technology introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. If you have the development needs of intelligent lighting system solutions, you can trust us. We represent a variety of single-chip microcomputers, voice chips, dual-mode Bluetooth ICs, and wifi chips. Brands include Songhan MCU, Yingguang MCU, Jerry Bluetooth, Ankai Bluetooth, Allwinner, and Realtek. Our technical services include: PCB design, microcontroller development, Bluetooth solutions, software and hardware custom development, APP development, small program development, WeChat official account development, etc. It can also undertake the design of intelligent electronic products, the development of living appliances, the research and development of beauty equipment, the application of Internet of things platform, the smart home control system, the development of TWS earphones, Bluetooth earphone speakers, the development of children's educational toys, the design of electronic education products, etc.

  • TOP