First, project overview
1.1 introduction
Energy shortage is a new issue in the 21st century. In addition to the new reserve energy, save energy, improve benefits, will become a topic that is more in line with the research. With the rapid development of the national economy and social progress, education is more concerned and attaches importance in the whole society, and the scale of campus has also increased with the expansion of the enrollment scale, and the number of classrooms has also increased significantly. However, for all kinds of colleges and universities, the use of lighting control systems is still in the primary stage. Due to the promulgation of the "Create Save Campus" policy, the traditional manual turn-off mode is cumbersome and there is a larger human waste. The disadvantages, the use of new lighting energy-saving automatic control systems in the teaching building has become a general trend.
In the research phase of this contest, we also noticed that although there is a formal intelligent light control device in the market, or its equipment is too large, or its cost is high, only in certain public situations or manufacturers, Severely limit the general and extensive use of the usage, and the application of lighting energy saving automatic control equipment technology in our family life is almost a blank. Especially in today's idea of intelligent home is deeply rooted, simple and environmentally friendly has become a new point of view. It has become a goal that people have pursued.
This system is the core of the controller, through its powerful microstructure, expands wireless communication, sensing and display module, and realizes automatic control of the lighting system, which is not only to some extent, to give the classroom power resources waste phenomenon. The emergence, but also satisfies the simple convenience and automatic control of people advocated in daily life, reducing the cost of operating maintenance, saving management costs, has huge ecological, environmental and economic benefits.
1.2 Project Background / Punch Motivation
Today's social life, especially in many colleges, existing energy waste, expenditure and student visual health have become more concerned, and the problem of power saving in college classroom has to mention important agenda. In addition, people today improve the intelligent simplicity requirements of life, can you use an existing resource design to automatically control and have a relatively practical lighting system, a blank of family life automatic lighting technology, improve the defects in existing lighting equipment It is the top priority of our team.
In the preparation stage of this competition, we specialize in research and analysis of the human infrared induction switch circuits widely used in today's market. Existing human body sensing equipment is the use of human infrared thermal release induction technology, and it is said that the action of the person's action has an inexposition of the light, its spiritual sensitivity, anti-interference is really worthy of praise. But we have this experience, when you sit in the classroom for a while, due to the changes in the body's movement, the lamp will automatically go out, until we give relevant actions will re-enhance the lamp, which gives us normal learning Brought great inconvenience; and due to the delay setting in the system, after the people in the classroom walk, all the lamps will still be shining for a while, if we can save the unnecessary power resources in this time Down, accumulate months, for any university classroom, it is definitely a small expenditure. We believe that the above two points are the performance vulnerabilities that existing equipment does not consider and cannot overcome. It is more apparent that such equipment is not suitable for applications in our daily family life. Imperative if we take a break in the room, the lamp is automatically extinguished, will bring more inconvenient and unaccustomed.
In view of the analysis of the above functions and demand, we decided to use the ATmegal28 single-chip microcomputer and peripherals, and judge the inclination of the people in the room to the human body, but also overcome the shortcomings of the changing, it is reduced. The resources caused by unnecessary delays can be used automatically. It is good to apply to school factories and family daily lives, with better application prospects, which is the direct background and fundamental motivation of this project.
Second, demand analysis
2.1 functional requirements
This system mainly uses the light sensor and the infrared light sensing counter to set the tab to control the brightness and destruction of the indoor lighting device. When the indoor light is dark to a certain extent and the calculation results of the counting device are ≥1 (ie, someone in the room), the conditions satisfaction The microcontroller control system automatically operates the switch of the lighting device. When the conditions are not met, the control system will also turn off the switch immediately.
Due to the beginning of the design, our team mainly positioned the application applications of the equipment in large-scale public applications such as schools or factories. First, if we use our university classroom lighting as an application, we have added some optional features. For example, according to our investigation, it is generally six rows of ordinary classrooms like our school, but when only a small number of people (the specific number is due to the situation), we only ask for the top three rows of lights. But if this small number of people have special circumstances, we have to open all the lamps. We set a button feature on the keyboard. This button action will open the remaining unopened three rows of lamps.
However, due to the universality of energy saving concept, our device can also be installed in a normal home lighting system. In view of this, we have added a remote control device to the device, the user can use the remote control through the wireless device long distance operation forced open And close the lighting.
In order to enrich the function of the device, we also add a display and a keyboard module to the control system. The current time, current temperature, current count value is displayed by the single-chip drive drive on the display. The keyboard is used to adjust the corresponding parameters. For example, when the system is unavoidable, the counter will have an error. At this time, the keyboard re-enter the value correctly, and the keyboard can also be used to adjust the time, and the function keys mentioned before. Part of the part.
Figure 1 System architecture
2.2 Performance requirements
1 The light sensation is sensitive, the response speed is fast (2us), the operating temperature range is wide (-25 ° C ~ + 70 ° C).
2 The count is accurate.
3 The temperature measurement is high, the accuracy is ± 0.5 ° C; the adaptive voltage range is wider, the voltage range: 3.0 ~ 5.5V.
4 Using the PT2262 RF wireless communication chip, in the indoor available communication distance is several tens of meters, the wireless remote control is over the general classroom (or factory) space.
This system has two modules that require relatively rigorous. The first is the counting module, because we use the way to recover the rays, the infrared sensor will issue a counting pulse. However, when the person relatively densely, that is, when the door is width, two people appear side by two people, but when they still cover the light, the counter only remembers a number, so there is an error. Therefore, the device we designed can only be adapted to the door not too wide so that many people will continue to cover the light, so that the numerical value is not allowed. In our school's observation and measurement, we have almost the above cases, so this device is hard to produce an error in the classroom count.
Secondly, the wireless remote control module (this module is mainly used in a home lighting system or factory), which is limited in the transmission distance, typically in dozens of meters, but the user may fail when the user is remotely remote.
Third, program design
3.1 System function implementation principle
This system mainly includes the following modules: 1 counting module
2 light sensing module
3 display module
4 temperature measurement module
5 keyboard module
6 wireless remote control module
1, count module
The counting module we use an infrared induction counter that is generally divided into two, one of which is an alternative, and the other is reflective. The reflection is a receiving head using an emission head. If an object occurs to block the light, output a pulse counter, count once; reflecting is an emuncher and receiving head to do a piece of infrared probe, when an infrared probe The front object appears to reflect the infrared light of the emission head to the receiving head, the probe outputs a count pulse to the counter, counts once. Since the application of our system is accurate than reflective counting, a number of ribs is used. We directly connect the pulse output of the infrared induction counter directly on the I / O port of the microcontroller to count, and count the results to display it on the LCD screen display.
Infrared sensor and single-chip connection diagram
2. Photomostable module
Light sensing module we preferred to the Patent Project developed in 2006 in 2006, ON Optoelectronics Technology. The product uses a CMOS process to have a compulsive pressure, OP amplification, infrared differential, and the advantages such as small current, low illuminance, and so on, in practical applications, just add a drop-down resistor. This product is suitable for energy-saving control, automatic photosensitive, adaptive control, etc. in many fields such as TV, LCD backlight, digital products, instrumentation, industrial equipment, and can be positioned as environmental protection products, replacing traditional photosensitive resistors, photosensitive diodes, photosensitive triodes, Comply with the concept of environmental protection in this competition.
Principle: When the light is irradiated onto the photosensitive triode, the resistance of the photosensitive triode is sharply reduced, and the photosensitive triode ON9658 is used as a sensor to be connected in series with a 7.5k resistance. The change in the light source is reflected by the illuminating intensity of the light source by the light source. Change. Enter the ATMEGA128 single chip in the voltage follower circuit by voltage follower. The circuit structure is simple, high sensitivity, and the detection voltage signal is stable, and the effect is obvious.
Sampling signal op amps, the intensity of the enhanced signal, can increase the stability of the signal voltage by the voltage follower, and the post-second voltage follower enhances the capacity of the circuit belt load.
3. Display module
The main role of LCD in the design: This design LCD mainly shows the current indoor number and the operation menu at the time of system operation, and the display is convenient to the visual interface.
LCD Display Principle: This design uses the LCD12864 character liquid crystal display with ST7920 as the drive chip. The ST7920 can be accessed by DDRAM, CGRAM by accessing the internal data register DR and the instruction register IR through the timing of RS, R / W and E, through the DB0-DB7 eight-bit data port, by accessing the data register DR , The value of CGROM and IRAM. Write the word code to be displayed to the DDRAM, ST7920 will automatically display the words displayed from the CGROM from the CGRO to the screen.
LCD initialization process:
LCD display content:
Time setting number change setting
4. Temperature Module
Our other product: