A beginner in IoT development tried to make a smart lock. I will summarize the jammed parts.
I made a smart lock. There are two ways to unlock and lock.
The inside is like this. I'm still using the breadboard and jumper wires, but I'll leave them as they are because it's easier to add new features.
In order to unlock and lock using the endpoint, we created the following configuration.
The backend is serverless. Because I only use it, renting a server is costly. I used Serverless Framework for deployment.
I wanted to use WiFi, so I chose ESP32-WROOM-32. I used it for the first time, but the development was very easy. It can be developed with the Arduino IDE.
I will write about the difficult points in this development.
This time I decided to supply power from the battery. Frequent battery exhaustion is very inconvenient as a smart lock, and it can also cause you to be locked out of your house in the worst case. Therefore, it was necessary to reduce power consumption as much as possible.
As a countermeasure, we aimed for a solution ** by selecting ** ESP32-WROOM-32. ESP32-WROOM-32 has a function called DeepSleep, which can suppress ** current consumption in sleep mode to 10uA ~ 150uA **.
However, when you actually operate it, the battery will run out in about a week. Therefore, it was not possible to make a product equivalent to a commercial smart lock.
The mobile battery was originally made to charge mobile phones, etc., and seems to have a function to automatically stop to prevent overcharging and to avoid wasting power. ** Basically, this function is attached to the products sold at home electronics mass retailers **.
This problem was solved by using this mobile battery. cheero Canvas 3200mAh Mobile Battery for IoT Devices White CHE-061
Of course, if you attach the servo motor to the key, the servo motor will rotate as shown below.
In order to fix this firmly, I used L-shaped metal fittings. However, I didn't have much experience in using such metal fittings, and it looked bad.
It's not the main point, but it was difficult to send a request to DynamoDB using Python's boto3 API. The API specification was complicated and it took me a long time to understand.
I decided to use PynamoDB on the way. Development has become much easier.
Life has become much easier because you can unlock the doorknob just by grabbing it.
Also, when a friend temporarily goes in and out of his room, he can unlock and lock without sharing a physical key, so it seems that there will be convenient situations in the future.
ESP32-WROOM-32 Development using the development board was very smooth. Even if the money is a little expensive, I realized that if you want speed and comfort of development, you should buy a development board. I used to use PIC for money and use ESP-WROOM-02 DIP kit.
I had a hard time installing the smart lock on the door. I also bought a 3D printer because my ancestors on the net often use 3D printers to tackle this problem. I would like to use it from the next development.
When actually developing a product, it is required to meet many standards such as making it small, inexpensive, and of high quality. We also need know-how such as mass production. I would like to work in embedded systems in the future, so I would be happy if I could accumulate more know-how like this.
Recommended Posts