Keywords

1 Introduction

Higher education has been paid great attention and the education population has also increased significantly. Thus the number of classrooms in the campus continues to increase. However, the lights in the classroom are always turned on even if there was few people in it due to the lack of awareness of energy conservation [1]. At night, it is common to see the whole lights are turned on in many classrooms while only a few students studying in the classroom. What is worse, the lights are still on after people leaving [2]. As a result, this kind of energy waste brings the water and electricity costs of the high school a heavy burden. A little waste of one classroom though, a great waste to the school day by day [3]. It is estimated that a school has 240 classrooms and each classroom save electricity about 3° a day, then more than 10 million RMB of electricity fee can be saved a year. As a result, a more intelligent, more effective control of the lights system, which will not affect the students’ vision and learning, is urgently need. The system, with the purpose of energy conservation, can automatically turn on and off according to the actual degree of illumination in the daytime [4]. The intelligent light control system not only can achieve energy conservation, but also promise a comfortable lighting environment. Meanwhile, the main source of electricity in China is coal, the lighting energy saving can also reduce harmful gas emissions and the air pollution.

2 Principle of Classroom Lighting System

The intelligent classroom lighting control system determines the lights on and off according to the distribution of person and the illumination. The standard classroom is divided into five square areas named A, B, C, D, E area, shown in Fig. 1. The optical frequency conversion sensor and infrared pyroelectric sensors are installed in the ceiling of each area to detect the indoor light intensity and personnel flow, then the collected data was sent to the core processor to determine whether the light should be on or not.

Fig. 1.
figure 1

Classroom light layout area

The international standard classroom lighting is controlled at 300Lx–500Lx, where Lx is the illumination unit, which refers to the luminous flux received per unit area on the illuminated surface [5]. If the natural illumination is not satisfied, the light illumination will be more than 300Lx, then the system will be mistakenly meet the requirements of light and turn off the lights. In order to avoid the occurrence of this phenomenon, an upper limit of 500Lx illumination is proposed taking the overlap of the natural light and light generation into account. The lights will be turn off when the natural light and light superimposed illumination is greater than 500Lx and turn on when that is less than 300Lx.

When the daylight illumination is not enough or at night, the lights should be turn on. Assuming the total number of a classroom is Y, then each area can commodate 1/4 of Y, let Y/4 = X. Take A Area as an example, when someone is detected in the A area, then turn on the A area lamps and other areas of lighting remain turn off. There are four lights in each area and only two of them will be turn on if person number is less than 1/4 of X, no matter where the person is sitting in this area. The scheme can save the energy efficiently.

The concrete rules of the scheme are as follows:

When P < X/4, turn on two lamps; When X/4 < P <= X/2, turn on 3 lamps; When P > X/2, turn on four lights; Where, P is the number of person.

On the contrary, the lights keep off if the illumination is sufficient.

3 Hardware Design

The S3C2410 chip with embedded ARM920T core was adopted as the main controller of the system, ARM is the abbreviation of Advanced RISC Machine, has the advantages of small size, low power consumption, low cost, high performance, data processing capacity and so on [6]. S3C2410 can support external expansion SDRAM and NAND FLASH, addressing space is 128 MB/block (8 blocks in total, that is, 1 GB), the chip has 4 KB SRAM, integrated MMU and rich on-chip peripherals, integrated independent 16 KB instruction cache and 16 KB data cache, support μC/OS-II, Window CE and embedded operating system, especially suits for mobile devices and small general-purpose embedded applications [7].

The overall structure of the system is shown in Fig. 2. The external components mainly include the human body signal acquisition module, the optical signal acquisition module, the clock module, the display module, the storage module and the I/O interface. The infrared pyroelectric sensor and optical frequency converter are used for real-time monitoring and detection of the classroom.

Fig. 2.
figure 2

Diagram of system hardware architecture block

3.1 Lighting Module Interface Design

The programmable optical frequency converter TSL230 is adopted to judge whether the classroom lighting is bright enough or not.., It is a high-performance, low-cost smart sensor with programmable sensitivity and full-scale output frequency [8]. As shown in Fig. 3, the logic inputs S0 and S1 are corresponding to the sensitivity, S2 and S3 are corresponding to the frequency, OUT is the output pulse. That is, the optical frequency is converted to frequency via TSL230, then transfer the frequency to the CPU, where the frequency will be converted to illumination and compared with the threshold. In order to ensure the accuracy of the collected signal data, the sensors should be placed away from direct sunlight and lighting and collect the scattered light of its own area.

Fig. 3.
figure 3

Diagram of lighting module interface

3.2 Person Detection Module

The person can be detected by the infrared sensor according to the human body temperature. The paper adopts CS9803GP infrared pyroelectric sensor for personnel information collection. The pyroelectric infrared detector has two key components: one is pyroelectric infrared sensor (PIR), which can be turn wavelength between 8 and 12 μm into electrical signals and inhibit the natural white light and other interference signals; the other is Fresnel lens, which can refract the pyroelectric infrared signal on the PIR and divide the detection area into a number of bright and dark areas [9]. The working principle is: the infrared ray emitted by the human body about 10 μm is enhanced by the Fresnel filter to the infrared sensor source. Then the sensing element will lose the charge balance when the infrared radiation temperature of the human body is received, and the charge is released, Finally, a detection signal will be produced, that is, the infrared signal is converted to electrical signal output.

3.3 RTC Module

The function of adjustment and display of the date and time is necessary for the time is one of the lighting control decision factors. It can also be used as a clock. RTC is inside of the CPU and the external circuit supplies power for the RTC, wiring diagram is shown in Fig. 4.

Fig. 4.
figure 4

Diagram of RTC power supply circuit

3.4 LCD Module and Key Module

The LCD display and the key module are designed to facilitate the system function module selection, parameter setting, system initialization, etc. TSXM, TSXP, TSYM, TSYP are four ports of the four-wire touch screen and can be directly connected to the touch screen; six buttons of the key module and 8 external interrupt ports EINT8, EINT11, EINT13, EINT14, EINT15, EINT19 are used to achieve man-machine interface. Due to limitation of the number of words, the system displays in multi-screen, using the button to select the screens or modify the parameter value.

Users can set the parameters like the thresholds of person numbers, illumination threshold and working time. The password also can be set for system security.

4 Software Programming

The program is operated in μ c/os II operating system, which is a priority-based pre-emptive real-time kernel. In μ c/os II, there are multi-task and each task has its own dedicated stack, the capacity of which can be arbitrary [10].

4.1 Main Program Flow Chart

There are several tasks: ① automatic manual switch; ② record person distribution; ③ manual mode task; ④ automatic mode task.

System work flow chart is shown in Fig. 5. When in the automatic mode task, firstly judge whether the lights are on or off, then turn on the lights if the illumination is less than 300lx and the lights are off, keep the lights off if the illumination is greater than 500lx. Turn off the lights if the illumination is greater than 500lx and the lights are on, otherwise keep the lights on.

Fig. 5.
figure 5

Chart of main system flow

The main task is:

figure a
figure b
figure c

4.2 Other Control Modules

  1. 1.

    System initialization

System initialization includes the configuration initialization of keys, sensors, LCD display and real-time clock.

  1. 2.

    Real-time clock module

The real-time clock (RTC) unit can work with a backup battery when the system is power off. The RTC transfers 8-bit data to the CPU by STRB/LDRB ARM. The data contains seconds, minutes, hours, days, months, and years. The external crystal is 32.768 kHz and the alarm function is provided.

  1. 3.

    Display driver module

The driver module is mainly to configure the ports of LCD, including the display state and the starting line. LCD screen need to be clear before use to avoid incorrect information display. While data displaying, the coordinates, the text and graphics of the data should be pre-written to the LCD.

  1. 4.

    Key module

In the determinant keyboard mode, ARM scans the keyboard repeatedly to catch the users’ command order, and it will no longer respond to other requests while executing or processing the command until the ARM returns to the scanning mode.

5 Conclusion

Based on ARM technology, the proposed classroom lighting intelligent control system, automatically control the light by the ambient light and the person numbers, is more reasonable and effective to reduce the cost of power. The timing parameter is set to make the control system adapt to the school’s schedule. This intelligent light control system can be applied to all types of schools, universities and colleges by simply transforming the original lighting system.