Based on the Tuya IoT smart door lock, I was very excited when I first heard about the free engineering project. But I didn’t expect that the course would be followed immediately by the start of the project. This is really difficult for me, who has no experience in the project. I was totally confused. I started by learning about the power supply circuit. Then I made a board and covered it with copper to connect the power supply and the ground. Then I made the board again. It was a difficult journey, but luckily I made it.
STM32 chip
I chose the mcu development solution, using the STM32F103C8T6 chip
Motor drive circuit

pwm output diagram
If it is detected that it is greater than CCR, it will be judged as high level, otherwise it will be judged as low level.
WBR3 module specification sheet
WBR3 is a low-power embedded Wi-Fi+BLE module developed by Tuya Smart. It consists of a highly integrated wireless radio frequency chip RTL8720CF, with built-in Wi-Fi network protocol stack and rich library functions.
product description
WBR3 includes low-power KM4 MCU, WLAN MAC, 1T1R WLAN, with a maximum frequency of 100MHz, built-in 256K SRAM, built-in 2Mbyte flash and rich peripheral resources in the chip.
WBR3 is an RTOS platform that integrates all Wi-Fi MAC and TCP/IP protocol function libraries. Users can develop embedded Wi-Fi products that meet their own needs based on these.
characteristic
- Built-in low-power KM4 MCU, which can double as an application processor
- Main frequency 100MHz
- Working voltage: 3V-3.6V
- Peripherals: 9×GPIOs, 1×UART, 1×Log_Tx
Wi-Fi/BT connectivity
- 802.11 B/G/N20
- Channel 1-14@2.4GHz(CH1-11 for US/CA, CH1-13 for EU/CN)
- Support WEP/WPA/WPA2/WPA2 PSK (AES) security mode
- Support Bluetooth 4.2 Low Energy
- +20dBm output power in 802.11b mode
- Support SmartConfig function, including Android and iOS devices
- Onboard PCB Onboard antenna
- Passed CE, FCC certification
- Working temperature: -20℃ to 85℃
welding gun
It was my first time to hand-solder a patch. It was quite interesting, but the chip was too small and the equipment couldn't keep up. It took me a long time to solder it.
Control APP
Use Tuya App to control the starting and closing of the motor to open and close the door
[Link to Tuya IoT development platform] https://auth.tuya.com/?from=https://www.tuya.com/cn/&_source=cbc30f99f7a6c4aebca6755c2fab437f (contains detailed development documents)
Photo of motor and board
Before you buy a motor, use a small motor to simulate it first. If you want to open and close the door, it is more reasonable to choose a 180-degree motor with high torque.
There are still a lot of bugs, and the code is not open source for the time being. It will be released after it is perfected (probably it will be released, manual dog-heading)