## 3 Subsystems
### Intelligent Light Control  
The intelligent light control system was developed and implemented in one of our labs with a clear idea: to have a contextual awareness and fully autonomous system resulting in a consumption decrease. Because labs are used by multiple researchers and students, it was common to have the lights turned on even though there were no persons inside. The lab includes a total of five lamps and three windows. Figure 2 shows the intelligent light control system with its components. Physically, the system is divided into six boards: the light control hardware board were the system core is at, the outside hardware board that is placed outside of the building to measure the sunlight, three-zone hardware boards to measure each room zone, and the shutter hardware board that has a window's shutter system. The system has a total of 5 controllable lamps connected. For the system to be possible, the lights ballasts were changed to provide fine analog control over the light intensity--this is done using an analog signal from 0 V/DC to 10 V/DC. The system uses an amplifier circuit (Figure 2) to amplify the 0-5 V/DC Arduino's signals to 0-10 V/DC for the lamps control. The system also integrates three internal light dependent resistor (LDR) to measure the light intensity in three locations, three passive infrared (PIR) sensors to detect movement, and one LDR located in the outside of the windows to measure the external light. The control of the windows' shutters implies a change in the room's light. Therefore, the shutters can be used to increase or decrease the external light entering into the room. For this, the shutter control of the three lab's windows was integrated into the intelligent light control to promote the use of natural light. The window's shutters control, seen in the right side of Figure 2, uses an Arduino Mega 2560 R3 to control two relays, for each window, connected to a 230 V/AC motor. The Arduino controls the relays according to commands provided by the wall switches or the programmable logic controller (PLC)--connected to the Arduino using Modbus/RTU protocol over RS485. To monitor the shutter's  
Figure 2: The intelligent light control system. position, an encoder was placed in the shutters' motor. The communication between light control and shutter system is done using Modbus/RTU. The room's light control is done using a web interface with login, allowing the user to control the room's light. A total of five individually controlled dimmable lamps are available in the room. Figure 3 shows the existed webpage where it is possible to control the lights. This webpage was developed in PHP and allows the control of the building. The system was built having assisted manual control and autonomous control. The assisted control monitors the control actions and provides the user with information regarding the windows' shutters. For instance, every time a user wants to turn on the lights, the system will validate that control with the external light value, and if there are light in the outside, then the system will suggest the user to open the shutters before turning on the light, if the user agrees then the system will automatically open the shutters, in the other hand, if there are not external light or the user do not agree to open the shutters, then the system will turn on the lights. The lights autonomous control defines the individual control of three zones in the lab. Figure 4 shows and identifies the lab layout and the autonomous control zones. Each zone has two lamps and three sensor boxes with one PIR sensor and one LDR sensor. Lamp 2 is shared by Zone 1 and Zone 2. The PIR sensor provides information regarding heat movement inside a zone, and when this occurs the zone's lamps will be turned on. The LDR sensor will then adjust the intensity of the lamp to provide a 1000 lux intensity inside the zone. According to [33], a 1000 lux value is recommended for detailed mechanical workshops.