Project function description:
1. Use HK32F030M as the microcontroller and MDK5 as the development platform
2. Use Tuya smart module WB3S to connect to Tuya platform
3. Use RC522 module to identify RF cards
4. OLED12832 as screen display
5. FLASH uses 24C02 to store the IC card number that allows identification
6. Press buttons to enter, clear and confirm passwords
7. Use LED to realize power indication and passive buzzer to simulate doorbell sound.
8. Relay controls the opening and closing of the external electromagnetic lock
Design ideas:
This project is also more practical. The inspiration was the door lock switch made by an old man at the last event. I happened to have a lot of idle modules on hand, so I thought about making one myself for fun.
Schematic analysis:
Most of the circuits are copied from Mo Gong's routines and module designs, so they are not shown too much.
The chip is powered by ASM1117, and the electromagnetic lock is powered by DC-DC12V. Please refer to the design of the MT3608 module for details.
The relay driver uses optocoupler isolation, but since the electromagnetic lock has not yet arrived, it cannot be confirmed that the function is normal. The specific results will be updated later.
The 3D preview is as follows:
The shell was originally planned to be 3D printed, but due to time issues, we finally chose an acrylic shell. Since it has not yet arrived, the complete physical picture is not shown.
The current physical picture is as follows:
Function implementation:
Connect the external power supply, enter the system, and select the three modes of administrator/card door control/smart door control by pressing the button.
When KEY1 is pressed, the system enters the administrator mode. After entering the set administrator password, the user can enter and delete user information according to the ID card, enter the card password, and set the user name corresponding to the card. After the setting is completed, the user data It will be saved to FLASH, and user data will be loaded from FLASH every time it is powered on.
When KEY2 is pressed, the system enters the card gate control mode. When the card reader module detects an external card, after detecting the card, if the ID card has been entered into the system, the password interface is entered. The user presses the keys KEY1~KEY3 (input, Confirm and clear) to set the entered password. If entered correctly, the buzzer doorbell will sound and the electronic lock will open.
When KEY3 is pressed, the system enters the smart door control mode. At this time, the system communicates with the Tuya module. When the WIFI indicator light is on, the user can connect to the Tuya module through the APP. Intelligent unlocking can be achieved through the switch on the APP interface, and The system will also obtain the current time data through the Tuya module and display it on the OLED screen in a rolling refresh manner.
Physical demonstration:
See Appendix 1 for the administrator mode, and Appendix 2 for the other modes. Since the electromagnetic lock has not yet arrived, the indicator light is used instead of the effect, and the buzzer is used to ring.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet