Project Overview:
This project is an intelligent servo motor door lock system integrating multiple sensors and communication modules. The core control unit uses the LCSC STM32F103C8T6 microcontroller. The system achieves contactless door lock control through voice recognition and Bluetooth technology, and is equipped with a DHT11 temperature and humidity sensor and an OLED display to provide real-time environmental information and operational feedback.
Project Functions:
This project designs a multi-functional intelligent servo motor door lock system with the following core functions:
Voice Control: Through the integrated voice recognition module, users can issue voice commands to control the opening and closing of the servo motor, achieving automatic door unlocking.
Bluetooth Remote Control: Users can connect to the door lock system via Bluetooth and remotely control the door lock using a mobile phone or other Bluetooth devices.
OLED Display: The system is equipped with an OLED display to show the current operating mode (voice or Bluetooth), the opening and closing angle of the servo motor, and environmental temperature and humidity data acquired by the DHT11 sensor in real time.
Temperature and Humidity Monitoring: The DHT11 sensor can monitor the environmental temperature and humidity in real time and display the data to the user through the OLED display, ensuring the user has an intuitive understanding of environmental conditions.
Status Feedback: When performing door opening or closing operations, the system displays the current servo angle on the OLED screen, providing operational feedback to the user.
Project Parameters:
This design uses the LCSC STM32F103C8T6 microcontroller, featuring a high-performance ARM Cortex-M3 core, providing powerful processing capabilities.
The design employs the LD3320 integrated high-performance voice recognition module, accurately recognizing user voice commands for contactless door lock control.
A Bluetooth HC-05 module supports low-power Bluetooth communication, ensuring stable connection with smart devices.
An SG90 servo module provides precise angle control, ensuring smooth door lock opening and closing.
A fully digital DHT11 temperature and humidity sensor with a wide temperature measurement range meets general needs;
a 0.96-inch OLED display provides clear text display for showing operating modes, servo angles, and ambient temperature and humidity.
The system supports 5V DC power input and can be powered via USB interface.
Principle Analysis (Hardware Description)
The design principle of this project can be divided into the following core parts: voice recognition, Bluetooth communication, servo motor control, temperature and humidity monitoring, and OLED display output. This project mainly enables door opening via voice and Bluetooth control of the servo motor. When the user outputs corresponding commands via voice or Bluetooth, the corresponding control operation is performed. Simultaneously, the control mode (voice, Bluetooth), servo motor angle, and current ambient temperature and humidity are displayed on the OLED screen.

Figure 1 – Voice Recognition:
The LD3320 integrates a high-performance voice recognition module, which can accurately recognize the user's voice commands, realizing contactless door lock control. It operates on 5V power and communicates via interrupts (9600 baud rate) through PA2 and PA3.

Figure 2 – Bluetooth HC-05 Module:
The Bluetooth HC-05 module is responsible for wireless communication with the user's smart device (such as a smartphone). The user sends a door opening command via Bluetooth through a smart device (such as a smartphone). After receiving the command, the Bluetooth module controls the servo motor to execute the door opening action. It operates on 5V power and communicates via interrupts (115200 baud rate) through PA9 and PA10.

Figure 3 – SG90 Servo Module:
The SG90 servo module receives PWM signals from the microcontroller and adjusts the servo's rotation angle according to the PWM duty cycle to open and close the door lock. The PWM signal is output through CH1 (PA0) of TIM2 to control the servo's rotation angle.

Figure 4 – DHT11 Module:
The DHT11 sensor monitors the ambient temperature and humidity and transmits the data to the STM32 via PB11. After processing the data, the STM32 sends it to the OLED display via the IIC interface.

Figure 5 – OLED Module:
The OLED display shows the system's real-time operating status, including operating mode, servo angle, and ambient temperature and humidity.
The display communicates with the STM32 via the IIC interfaces (PB8, PB9) to receive and display data sent by the microcontroller.
The software code is as follows
: `int main(void)
{
OLED_Init();
Servo_Init();
USART1_Init(115200);
USART2_Init(9600);
DHT11_Init();
OLED_ShowString(2, 1, "Angle:");
OLED_ShowString(1, 1, "Mode:");
while (1)
{
//servo motor to open/close door
control_door();
//OLED display mode
oled_mode();
//OLED display temperature and humidity
oled_dht();
} }
`
This displays the main program code. See the project attachment for detailed code.
**Notes :**
The voice module requires downloading the corresponding program via serial port (see attachment).
The Bluetooth module requires AT command settings; many are available online.
**Note:** Modules must be connected correctly; do not connect them backwards. **Note
:** Modules may vary; adjust the spacing between modules on the PCB accordingly. For example, increase the spacing between the LD3320 and STM32, and modify the position of the DHT11. **
Assembly Process:
** Connect the corresponding modules; do not connect them backwards. Figure 6: Actual product
image