## 1 Introduction  
The advancement in nano-semiconductor manufacturing opens up the era of the internet of things. Nowadays, nearly every item in our daily life, from mobile, tablet, watch, refrigerator to even glasses, can be interconnected over Wi-Fi, a global system for mobile communication (GSM), near field communication (NFC), bluetooth, zigbee and multiple other wireless communication technologies [1; 2; 3; 4]. It is needless to say that people could tackle major tasks as well as trivial real-time tasks at their fingertips with the help of simple hand-held devices. However, the application of the Internet of Things is still very restricted due to price, lack of system integration, unfriendly user interface, and no Wi-Fi access in the surrounding area. Among these, the home security system guarding people's lives and properties is one of the issues that needs further research and urgent improvement.  
The old-fashioned key-and-lock is still widely used in the home security system today. With urbanization and diverse criminal types, its efficacy is being challenged. In recent years, governments, schools, companies and even large communities have started to use the radio frequency identification (RFID) instead. Nonetheless, the virtual RFID card is an extra accessory to the user and is prone to being lost or embezzled. Therefore, it is not as convenient as the system that we propose here which utilizes common hand-held devices as electronic locks. Moreover, although there are face, fingerprint, speech and iris recognition systems that differentiate individuals by their unique biometrics, its accuracy is strongly affected by aging, injuries, illness and other uncertain factors that change these features. The biometric systems require extremely high sensor resolution, thereby increasing the product cost and restricting their popularization. Therefore, the future development trend of the household security industry is to develop a low-cost wireless digital door access system that has high convenience, high security, and high transmission speed.  
Based on the above considerations, we proposed a brand-new optical Morse code-based electronic locking system by referring to the visible light communication (VLC) Technology, Light Fidelity (Li-Fi) [5; 6; 7], with the bandwidth 10,000 times higher than that of Wi-Fi. Such a system integrates the smart phone that is indispensable in modern times, with the door access system. It uses the light-emitting diodes (LED) component in smart phones as the encoder for optical Morse code, which not only meets the above requirements of low cost and high convenience, but also has the VLC advantages of high security and high transmission speed. Regarding the working principle, it encodes the Morse code for the data to be transmitted, and sends out the optical Morse code with the LED. Upon receiving the optical signals, the receiving end could decode and compare whether the data are correct. Finally, the real-time information of the lock will be uploaded to the cloud service platform, and users can ensure home safety on the remote monitoring system. Moreover, to avoid errors caused by ambient light, we proposed a novel control circuit based on expert knowledge and empirical laws. The new circuit showed satisfying results as it reaches 100% accuracy under all light intensity tested.