## 3 Theoretical Analysis of Proposed Smart Home Control System  
### Architecture Design of Smart Home Control with Cloud Server  
The VLC-based smart home control system consists of the hardware infrastructure made up of driverless AC-powered VLC lightbulbs with standard E27 sockets supporting direct plug-n-play capability. It also includes the supporting software which comprises a back-end cloud server storing the world coordinates of the lightbulbs and information of the smart devices in a look-up table (LUT) and a smartphone software application that implements the VLC decoding algorithm, Bluetooth-based control for the smart devices, and interfacing with the information stored in the cloud server. These three components network and manage various smart devices in the SHS.  
The architecture and signal flows are presented in Figure 2. First, after the VLC lightbulb sends out the VLC signal containing a unique ID code, the user receives this signal through the smartphone app which captures the image of the VLC lightbulb as a rolling shutter pattern because of the CMOS image sensor (CIS)-based camera operation. Next, the decoding process is performed in the smartphone application. After the smartphone receives the rolling shutter patterns captured by the camera, the region of interest (ROI) which contains the patterns will be cropped and used in the threshold-determination process. The pixel values of the ROI-contained rolling shutter patterns will be read out, and the maximum and minimum values can be determined. Then the thresholds are calculated as the middle point of maximum and minimum values. The pixel values larger than the threshold are converted to \"1\" bits, and those smaller than the threshold are converted to \"0\" bits. Finally, the different binary streams are combined to form a complete data frame consisting of a preamble, payload (ID code), and error check sequence. The unique ID code contained in this data frame will be mapped to a uniform resource identifier (URI) database. Then the translation of ID code to URI is processed. The translated URI can be eventually used by the application software to interact with the cloud server on the Internet through wireless network communication methods such as Wi-Fi and LTE [32]. In the cloud server, the location data associated with each lightbulb are stored according to their ID code. Additionally, the Bluetooth MAC addresses of the smart devices installed in the same room as the lightbulb are recorded in terms of the ID code of the lightbulb. Therefore, each lightbulb has a pre-recorded file in the cloud server with its location data in a global map and the MAC address information of the smart devices co-located in the same room. After matching the ID code received from the smartphone, the cloud server can then provide the corresponding location data with the MAC addresses of the co-located smart devices. Since all smart devices are continuously broadcasting, the smartphone may detect many devices installed in different rooms in a home as the Bluetooth signal can penetrate through walls. With the returned MAC address, the smartphone can now identify which smart devices are installed in the same room as the VLC lightbulb and send out connection request only to these devices. Through the Bluetooth connection, the user can then manage and control these smart devices precisely.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Typical Methods** & **PLC** & **IoT** & **Information Fusion** & **ZigBee** & **VLC** & **VLC + BLE + VLP** \\ \hline System Scalability & Low & High & Middle & High & Low & High \\ User Convenience & Middle & High & High & Middle & Low & High \\ Control Accuracy & High & Low & Middle & Low & Middle & High \\ \hline \multirow{2}{*}{Considered} & Security Issue & No & No & No & No & Yes & Yes \\  & Indoor Positioning & No & No & No & No & Yes \\ \hline \hline \end{tabular}
\end{table}
Table 2: Comparison of typical methods adopted in smart home control systems.