1 Introduction
With the development of social economy and science and technology, the progress of human society is increasingly dependent on the development and utilization of resources. However, the growing demand for energy and the limited amount of resources have formed a huge contradiction.
Among the ways to ease the energy crisis, such as finding substitutes, improving energy utilization and saving energy, energy conservation is undoubtedly a choice that meets the requirements of sustainable development and can be "started from one's own side". According to statistics, in 2005, the total electricity consumption of the whole society in my country was about 2400 billion kW·h, and the lighting electricity consumption was about 300 billion kW·h, and it increased at a rate of 13% to 14% every year. It is estimated that by 2010, the lighting electricity consumption will exceed 500 billion kW·h, and the new lighting electricity consumption will be 200 billion kW·h. For colleges and universities, it is estimated that their lighting power consumption accounts for about 40% of the total power consumption of the unit. It can be seen that under the premise of ensuring the quality of lighting, the automatic control of classroom lighting has considerable energy-saving and economic benefits.
Based on the above situation, this design automatically controls the classroom lamps according to time, illumination, personnel distribution, etc., and uses the integrated light-to-frequency converter TSL230 to detect the illumination more accurately; fuzzy number of people and number thresholds are introduced in the number detection, and the switch control of lights is no longer solely dependent on human presence signals, which enhances the energy-saving effect, further improves the control method, and makes the performance of the equipment more stable and reliable; multi-mode control and automatic switching between modes make the system more flexible and convenient to use.
2 System Design
The system adopts a master-slave structure and consists of two parts: the upper computer and the lower computer.
2.1 Host computer
The host computer mainly realizes the following functions:
(1) Use the keyboard to complete tasks such as setting passwords, initializing time, setting illumination thresholds, and setting working hours.
(2) Determine the control mode through the signal detector.
(3) The control light group is calculated based on the received data from the lower computer and the internally stored illumination threshold and number threshold, and a light on/off command is sent to the corresponding lower computer.
(4) Display the current working status and working mode through LCD.
The host computer consists of a 5V regulated power supply module, a microcontroller STC89C54, a clock module, a LCD display module, a data storage module, a 485 communication module, an automatic/forced switch, and a key module extended by an interrupt (including a confirmation key, increase/decrease keys, and cursor movement keys) (as shown in Figure 1).
Figure 1: Host computer hardware diagram
2.2 Lower computer
The main functions of the lower computer are as follows:
(1) Human presence signals, blurred number of people and illumination signals are collected in real time through infrared pyroelectric sensors and light-to-frequency converters, and the collected data are sent to the host.
(2) Control the switch of the light group according to the command sent back by the host.
The lower computer mainly includes: central processing chip AT89C2051, 5V voltage regulator, optical frequency conversion module, infrared pyroelectric module, address selector, watchdog circuit, 485 communication module and power devices composed of solid-state relays (as shown in Figure 2).
Figure 2: Lower computer hardware diagram
3 Hardware
3.1 Master and slave central processing chip
STC89C54 and AT89C2051 microcontrollers are selected, which are low-priced, can be erased and written many times, and have a wide range of applications. The microcontroller cooperates with other circuit modules in the system to complete the functions of the upper and lower computers as mentioned above.
3.2 Display module and key module
In order to facilitate system initialization, parameter setting and mode selection, the host is equipped with an LCD display and a key module consisting of four keys. The display part uses the LCD display module LM3033 with a Chinese character library. The four keys are expanded by an external interrupt. Due to the limitations of the number of characters and layout of the LCD display, the system uses a split-screen display, and the cursor needs to be controlled by keys to select the screen; and when setting parameters, the keys are used to increase or decrease the value.
The system's illumination threshold, personnel threshold and working hours can be set through a visual interface, allowing users to flexibly set parameters according to actual conditions and needs, while enhancing system availability and expanding the scope of application of the system. A password control interface is added to enhance the security of system operation and clarify the user's setting authority.
3.3 Optical frequency conversion module
The system uses the programmable light-to-frequency converter TSL230 as the main chip of the light-to-frequency conversion module. TSL230 is a new generation of integrated intelligent sensor. It integrates configurable photodiode arrays and current/frequency converters in a single integrated circuit. It can complete high-resolution light intensity/frequency conversion without external components and output high-precision digital signals. It is a high-performance, low-cost intelligent sensor. Its output is a square wave with a duty cycle of 50%, and the output frequency is linearly related to the illumination, and the sensitivity is adjustable.
3.4 Infrared pyroelectric human body detection module
The infrared pyroelectric module consists of an infrared probe and a signal processing chip LP0001. LP0001 is a high-performance sensor signal processing integrated circuit with an independent high input impedance operational amplifier. The internal bidirectional amplitude detector can effectively suppress interference, and has a built-in delay timer and a blocking timer. The chip can amplify, phase-detect, shape and widen the signal. Its static current is extremely small. It can be equipped with a pyroelectric infrared sensor and a small number of peripheral components to form a passive pyroelectric infrared sensor.
In addition, the system uses MAX485 chip to realize data transmission and command control between the host and multiple slaves. MAX813 chip is used to monitor the lower computer and reset the lower computer when the system fails. The address of multiple slaves is set by dip switches to facilitate the installation and use of the equipment.
4 Software
4.1 Overall design concept
Time, illuminance and personnel distribution constitute the three major elements of the system control basis. Taking time as one of the control bases is to further strengthen the supervision of energy conservation and make the boundary between working hours and non-working hours specific. According to the distribution of light and dark in the classroom and the detection range of the infrared pyroelectric module, the classroom is divided into square areas (as shown in Figure 3) for control. The lower computer panels containing optical frequency sensors and infrared sensors are installed on the ceiling of each area respectively. The lower computer monitors the indoor light intensity and personnel flow, and sends the collected data to the upper computer; the upper computer compares the data sent by each lower computer, and comprehensively considers the decision of switching lights according to the set number threshold and illumination threshold. This design not only takes into account the local area, but also can grasp the overall solution of switching lights, further enhancing the energy-saving effect.
Figure 3 Classroom area division
When processing human body signals collected by infrared pyroelectric sensors, the system uses fuzzy control theory to perform fuzzy statistics on the number of people in each area, solving the problem of being unable to accurately count the number of people and laying the foundation for judging the threshold of the number of people. Adding a fuzzy number judgment standard (the lights are turned on only when the number of people in the area is greater than the threshold Y0) can solve the problem of turning on too many lights when the number of people is too dispersed, thereby enhancing the energy-saving effect.
In terms of illumination control, it is not feasible to rely solely on the judgment basis of turning on the light when the illumination is less than 300 lx: after the illumination does not meet the requirements and the system turns on the light, the illumination will be greater than 300 lx. At this time, the system will misjudge that the illumination meets the requirements and make a decision to turn off the light. In order to avoid this phenomenon, considering that natural light and light are incoherent superposition, an illumination upper limit X0 can be added to the control. When the superposition of natural light and light is greater than X0, the light is turned off. Therefore, the condition for turning on the light becomes that the illumination is less than 300 lx when the light is not turned on and the illumination is less than X0 after the light is turned on.
The system uses multiple modes of control to meet the needs of multiple functions in the classroom. Its modes are mainly divided into: forced mode and automatic mode; the automatic mode is further divided into: multimedia mode, blackboard mode and self-study mode. During working hours, if there is a mode signal input, the system enters the corresponding mode; if not, it enters the self-study mode. During non-working hours, if there is a forced manual signal input, it will run according to the setting of the manual task; if not, all lights will be turned off. The main flow chart of the program is shown in Figure 4.
Figure 4 Main flow chart of the program
4.1.1 Control methods and implementation of each mode
4.1.1.1 Enforcement mode
The administrator sets the automatic/forced switch to low level to put the system into forced mode. In forced mode, the lights in any area can be turned on or off by pressing buttons, without being restricted by working hours, illumination and personnel distribution.
4.1.1.2 Automatic mode
The administrator sets the automatic/forced switch to a high level and the system enters automatic mode.
4.1.1.2.1 Self-study mode
When there is no mode signal input, the system enters self-study mode.
When running in this mode, the system first detects whether there are any area lights on in the classroom, and then detects whether the illuminance reaches the national requirement of 300 lx.
If the light intensity is greater than this standard, the light will not be turned on regardless of whether there is anyone in the area; if it is less than this standard, the light will be turned on according to the situation if there is someone, otherwise it will not be turned on. The specific control rules for switching lights are as follows:
1. Turn on the lights
When the illumination is insufficient, someone enters the classroom. If there is no area with lights on in the classroom, turn on the lights in the area where the person is. If someone else enters, check whether the number of people in the first area with lights on is greater than Y0. If not, do not turn on the lights in other areas. If it is, collect the number of people in each area with people, compare the number of people, turn on the lights in the area with the largest number of people in the unlit area, and turn on the lights in the third area, fourth area, etc. in a cycle. If there are areas with lights on in the classroom, record the number of people in these areas respectively. If the number of people in any area is less than the standard value Y0, do not turn on the lights in other areas; if they are all greater than this value, turn on the lights in the area with the largest number of people in the unlit area.
2. Turn off the lights
After turning on the lights, if the natural light is insufficient (illuminance is less than X0), only one area with lights on is allowed to have fewer people than Y0. If there are multiple areas with fewer people than Y0, keep the lights in the area with the most people on and turn off the others. If no human presence signal is detected in an area continuously, turn off the lights in that area. When there is no one in the classroom, turn off all the lights. If there is sufficient natural light, turn off the lights in that area. The program flow is shown in Figure 5.
Figure 5 Self-study mode flow chart
4.1.1.2.2 Blackboard writing mode
The difference between the blackboard mode and the self-study mode is whether the light is on on the podium. To teach on the blackboard, the teacher must appear on the podium, so the input signal of the blackboard mode is converted into a signal for detecting the presence of a human body through the slave board installed above the podium. When there is always someone on the podium for t time, it is considered that there is someone on the podium. When there is someone on the podium and there is no projection signal input, this mode is entered; in this mode, the control rules of the self-study mode are still used for the seating area. In particular, the podium area is independent of other areas, that is, it is not affected by the number of people in other areas or whether the lights are on, and it does not affect other areas. The judgment of illumination is also added to the switching of the lights in this area.
4.1.1.2.3 Multimedia Mode
The multimedia mode uses the photoelectric coupler installed on the projector's power wire to determine whether there is current passing through the wire. If so, it is considered that the projector is in working condition and automatically switches to projection mode.
When entering this mode, the lights in the front area will be turned off, and the control rules of the self-study mode will still be applied to the back area of the classroom.
4.2 LCD display interface
The LCD display interface process is shown in Figure 6. The process is implemented by the visual interface and buttons. After the system is initialized, the interface conversion and parameter setting can be performed through four buttons extended by an external interrupt. In different interfaces, the functions of the buttons are different, and users can easily complete a series of settings according to the interface prompts.
Figure 6 LCD display interface
4.3 Communication subroutine
In order to avoid the situation where multiple slaves occupy the data line at the same time, RS485 communication adopts the mode of host broadcast and slave *. When the host sends an address frame, only the slave that matches the call address responds, and the other slaves remain *. The slaves with matching addresses then respond accordingly according to the command frame sent by the host.
5 Conclusion
In summary, after many experiments, it has been proved that the performance of this design is stable and reliable, and it has achieved good energy-saving effects. The equipment uses the light-frequency converter TSL230 to overcome the problem of inaccurate illumination measurement in previous designs; the addition of the fuzzy number threshold judgment standard solves the problem of turning on too many lights when the personnel distribution is too dispersed; in addition, the automatic detection conversion of multi-mode control makes the system operation more intelligent and convenient. Today, when the concept of energy saving is deeply rooted in people's hearts, people are easily accepted by such low-cost, high-performance, and easy-to-operate energy-saving products.
Previous article:New traffic light design based on color-changing electroluminescent devices
Next article:Design of LCD display system based on STC89C52 and HT1621D
- Popular Resources
- Popular amplifiers
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Qorvo Online Design Conference - Rapid Customization of Power ICs Using ActiveCiPS Technology
- Switching Power Supply Primer
- [Perf-V Review] + Button Control RGB_LED Color Change
- MSP430 Program Library --- 12864 LCD Program Library
- TMS320F28027 ADC zero offset calibration
- Live broadcast at 14:00 this afternoon [Introduction and application of TI C2000 built-in programmable logic module CLB] (200 gifts)
- After the stepper motor is powered on according to the timing, it just shakes left and right and does not rotate. I would like some guidance.
- TI TMS320C6678 DSP + Xilinx Kintex-7 FPGA LED indicators and buttons
- Detailed explanation of the BLE connection establishment process
- Can't Allegro draw a rectangular box with Line attributes at one time?