At present, most of the lighting systems in teaching buildings and student dormitories in universities in my country are controlled by timing, which causes problems such as a large waste of electric energy and inflexible lighting modes. Based on the 51 microcontroller, this article realizes intelligent and dynamic control of the lighting system by setting time, sensing light and sound, and setting lighting status according to the different needs of teaching buildings and dormitories. The test results show that the system can change the lighting status under different conditions, adapt to the needs of different places, and achieve the purpose of intelligent control.
In today's society with rapid economic development, the massive consumption of electric energy has made it a scarce resource. How to save energy and reduce consumption has become a hot topic in lighting system research in recent years. At present, most of the lighting systems in teaching buildings and student dormitories in colleges and universities in my country are controlled by timing. Although the control is simple and easy to implement, there are many problems: at night when the flow of people is very small, lighting all the lamps will cause a lot of waste of electric energy; In addition, the timing lighting method makes it impossible to flexibly adjust the working status of the lighting system, especially during thunderstorms and haze weather, posing safety risks. The intelligent lighting control system designed in this article can set the lighting mode and lighting time according to the different functional requirements of different areas of the school to achieve dynamic and intelligent management of the lighting system.
1 system hardware module
The design of this system is based on the 51 series microcontroller and consists of 7 hardware modules, namely control, timing, light control, voice control, buttons, display, and lighting. Among them, the light control and sound control modules realize the collection and judgment of external light and sound signals; the timing realizes the lighting time control of the lighting system; the control module uses STC89C52 single-chip microcomputer to control the lighting circuit and switch different working states according to the external light, sound and timing signals. to adapt to external needs. The lighting system architecture is shown in Figure 1.
1.1 Control module
This article uses STC89C52 microcontroller, which has an 8-bit CPU and in-system programmable Flash. It is a low-power, high-performance microcontroller. In the design of this article, the control module receives the time of the timing module and the light and sound signals of the external environment, and controls the working status of the lighting lamp by judging the lighting level to achieve intelligent and dynamic management of the lighting system.
1.2 Input module
1.2.1 Timing module
The timing module uses the DS1302 chip to provide date and time information to the entire system. It not only has low power consumption and high performance, but also has the function of power-down timekeeping. It will not stop timing even when the microcontroller is powered off. At the same time, it also facilitates the system to judge whether the set night time has been reached.
1.2.2 Light control module
The photoresistor is used in the light control module to collect the light signal, and the LM393 comparator is used to judge the light signal intensity. Figure 2 shows the light control circuit. A potentiometer is connected to the non-inverting and inverting input terminals of the comparator. When there is no natural light, adjust the potentiometer to keep the potential of the two input terminals consistent. At this time, the comparator will output a low voltage. flat signal. When the photoresistor is illuminated by natural light, its resistance will be greatly reduced, causing the potential of the non-inverting input terminal of the comparator to increase and the comparator to output a high-level signal. By outputting the signal of the comparator to the P1.4 port of the microcontroller, the microcontroller can determine whether the external light intensity reaches the threshold intensity, thereby controlling the change of the working status of the lighting module.
1.2.3 Voice control module
The voice control module uses an electret microphone (replaced by R6 resistor in Figure 3) to collect acoustic signals. It is a type of condenser microphone with high sensitivity. The LM393 is used to judge the intensity of the acoustic signal. The principle is the same as that of the light control circuit. The final signal is output to the P1.3 port of the microcontroller, as shown in Figure 3.
1.3 Output module
1.3.1 Display module
As shown in Figure 4, the display circuit uses LCD1602 liquid crystal to display the current date and time. The LCD1602 liquid crystal can display two lines, each line has 16 characters. An additional potentiometer can adjust the contrast of the LCD display at any time.
1.3.2 Lighting module
As shown in Figure 4, the lighting module uses 2 rows of 8 LED lights to simulate the three working states of the lighting: off, interval light and full light. When working in the off or fully bright state, all 8 LED lights are off or on; when interval lighting is required, 1 row of 2 LED lights will light up to provide relatively low-intensity lighting.
2 System software design
The intelligent lighting system combines time, light, and sound to determine changes in the external environment, and sets three working states for the lighting to provide different lighting intensities, namely full brightness, interval brightness, and extinguishing states. The system operation process is shown in Figure 5.
In the lighting working status control, the setting time for the dormitory building is from 18:00 to 6:00 the next day, and the setting time for the teaching building is from 18:00 to 24:00, which is called night mode. During the set time, the lighting Works in interval lighting state to provide basic lighting at night. If the sound intensity collected by the sound control module is greater than the threshold intensity at this time, it means that there is a large flow of people in the teaching building or dormitory. The lighting module will switch to the full brightness state to provide high-intensity lighting, and after the sound signal disappears, it will also Delay for 5 seconds and then resume the working state of interval lighting to ensure the lighting requirements for night activities.
Outside the set time, such as thunderstorms or haze weather, the lighting system collects and judges the natural light intensity from the outside world. Even if it is not in night mode, it still requires a certain amount of lighting. Therefore, when the light intensity collected by the light control module is less than At the threshold intensity, the lighting module will work in a state of interval lighting to ensure basic lighting in the teaching building or dormitory; through the collection and judgment of sound signals, if the flow of people is large, the lighting module will switch to full brightness again. state.
3 system test
According to the functional requirements of the system, the working status of the system under all circumstances (the preset setting time is 18:00~6:00) is tested. The test circuit is shown in Figure 6.
When the set time and light intensity threshold are not reached, the LED light goes out;
When the set time, light intensity When the set time and sound intensity threshold are reached, the LED lights will light up at intervals; When the set time and sound intensity threshold are reached, the LED lights will all light up. It can be seen that this system switches working states as required under various circumstances and meets the design requirements. 4 Conclusion Based on the lighting needs of university teaching buildings and student dormitories, this article designs an intelligent lighting system that can adaptively adjust the working status of the lighting system according to the setting time and changes in external ambient light and sound, and achieve dynamic management of the lighting system. This system can also be applied to lighting in public places. It has the characteristics of low cost, convenient operation, easy expansion of functions, etc., and can save electricity and energy to the maximum extent.
Previous article:Design and application of high-performance matrix switching system based on AD8108
Next article:What is a single-chip microcomputer_51 pre-study knowledge of single-chip microcomputer
Recommended ReadingLatest update time:2024-11-15 13:37
- Popular Resources
- Popular amplifiers
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Traffic Light Control System Based on Fuzzy Control (Single-Chip Microcomputer Implementation)
- Principles and Applications of Single Chip Microcomputers (Second Edition) (Wanlong)
- MCU Principles and C51 Programming Tutorial (2nd Edition)
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Three steps to govern hybrid multicloud environments
- Three steps to govern hybrid multicloud environments
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Hey guys, I can't find the following libraries on Cadence's Psipce
- First look at Texas Instruments' C2000 series
- [Project source code] Digital tube companion - binary to BCD
- 【CLUE】Programming with CircuitPython
- Uncover the mystery of MOS tube damage! What other reasons do you know?
- Let's discuss whether GaN materials are a key technology in 5G applications.
- FPGA Basics (I)
- Sensortile.box
- [GD32E231 DIY Contest]——02. New project engineering and engineering configuration
- Please help me solve the following two pictures, mirror current source problem. Thank you very much