## 3 Subsystems
### Intelligent Desk Light Control  
The control of illumination in an office environment has clear advantages regarding energy efficiency and user comfort. However, this type of solution can also be implemented for residential building in working computer desks. The intelligent desk light control system enables the automatic control of the working light regarding environment light and user presence. The biggest difficulty of such a system is the identification of persons, if the system can detect persons then it is easy to control the light according to the environment light. To solve this issue, the system was divided into two parts: the sensing hardware, and the processing software. Figure 7 shows the hardware and software of the intelligent desk light control system. The hardware connects to the software using a serial interface. The software is responsible to read the hardware sensor data, monitor the computer's keyboard and mouse, controls the desk light and store all the system's data. The hardware includes the majority of sensors used in the system. Figure 8a shows the developed board built with its components. The sensors used allows the measuring of temperature, luminosity (LDR), and movement (PIR). The button on the board enables the user configuration when it is pressed a website opens in the user's browser to enable system configuration (Fi  
Figure 6: (a) Television control device; (b) power mode menu. Figure 7: Intelligent desk light control system. V3.0 is used to process sensors' data and send them to the computer through a USB cable--this cable is also used to feed the circuit with 5 V/DC. The software, developed in Java, reads data from Arduino Nano, processes the information, stores the data and controls the light. The software is also responsible to detect mouse movements and pressed keyboard keys. The combination of sensing data from software and hardware provides a unique system that has very little error. The PIR of the hardware is good to detect movement, for instance, it is very effective detecting the person arriving and leaving the desk. However, the minor movements produced by the persons when working at the desk are not enough to trigger the PIR movement. Moreover, because the used PIR is not able to detect movement directions--when a person arrives or leaves--the exclusive use of the PIR to detect persons in a working desk is not sufficient. To solve this issue, the intelligent desk light control uses the Java software to detect if a person is using the computer--by reading mouse and keyboard inputs. The combination between the PIR and the software is able to provide good quality data that can detect, with low error, the presence of a person working in a computer desk. To prevent system errors, visual signals were used to give information and feedback to the user. Figure 9 shows the messages available in the computer to warn the user. If the system does not detect a person, a \"Move\" message is displayed and the user has some time to act, otherwise, the light will be turned off. The two _ifs_ of Figure 9 have associated configurable time periods, for instance, only if no one is detected during a five-minute period that the \"Move\" message appears, and if no one is still not detected for one more minute then the \"Out\" message appears. Figure 8: Intelligent desk light sensors and graphical interface. (**a**) Developed board; (**b**) Computer interface.