Internet of Things (IoT) is technology which provides communication between machines without human intervention. There are many applications that implement IoT technology e.g. smart power, smart home, transportation management, and smart city. This paper proposes the usage of IoT to develop electronic key that can help to improve the security in apartment. Electronic key uses Android smart phone to access and control the door. Electronic key uses Raspberry pii, motor DC, webcam, microswitch, and Arduino GSM. Raspberry is used to get command from server and instruct the Arduino GSM to open or close the door and webcam is used to take picture from the environment for documentation. This research uses three steps to verify the user who want to open or close the door i.e. using username and password, bluetooth, and QR code scanner.