
Follow Us By Clicking The Blue Text

Abstract
With the development of smart home technology, home security risks have attracted attention. To reduce risks and achieve real-time monitoring and alarms, we designed a smart anti-theft alarm system based on the 51 microcontroller. This system uses the STM32 microcontroller as the main control unit, employing infrared, flame, and DHT11 temperature and humidity sensors to monitor the home environment. The HC-SR505 PIR sensor detects human presence, and a 0.96-inch OLED screen displays monitoring data in real-time. Additionally, the SIM800L module enables wireless communication with mobile phones, allowing users to set thresholds and view data on their phones. In case of anomalies, a buzzer alarm activates, providing convenient and secure services.
The overall software and hardware design was completed, and physical prototypes were tested. The tests showed that the system can effectively monitor human presence, issue alerts, and communicate wirelessly, providing users with accurate environmental safety monitoring services with high practical value.

1
Overall System Design

System Scheme Design:
By analyzing the functional design of the system, we determined the system scheme selection. The architecture design of the smart anti-theft alarm system based on the 51 microcontroller is shown in Figure 2.1. The system uses the 51 microcontroller as the controller, detecting the internal environment of the house through infrared sensors, flame sensors, and DHT11 temperature and humidity sensors. The HC-SR505 PIR sensor is used for human presence detection. Communication with mobile phones is realized through the SIM800L module, allowing users to view relevant data on their phones and set temperature and humidity thresholds for the house. When any monitored parameter is abnormal, a buzzer alarm is triggered, and real-time parameters are displayed on a 0.96-inch OLED screen.

System Structure Diagram

2. Hardware Circuit Design

Main Control Module:
The smart anti-theft alarm system based on the 51 microcontroller uses the STM32F103C8 minimum system board as the controller. The minimum system of the microcontroller is shown in Figure 3.1, which includes the STM32F103C8 microcontroller, crystal oscillator circuit, reset circuit, and BOOT configuration circuit.

Minimum System of Microcontroller
Human Sensing Detection Module:

Display Module:

Alarm Module:


3
Software Design

Main Program Design:
When the smart anti-theft alarm system based on the 51 microcontroller is started, it first initializes the microcontroller, infrared sensor, flame sensor, DHT11 temperature and humidity sensor, HC-SR505 PIR sensor, and SMS module. According to actual needs, safety thresholds are set. The system detects flame and infrared sensor data, and when any monitored data exceeds the set threshold range, the buzzer is activated to issue an alarm. The system also sends an SMS alert to the phone. The main program flow is shown in Figure 4.1.

Temperature and Humidity Detection Program Design:

Human Sensing Module Program Design:


4
System Testing

According to the design scheme, various hardware modules were assembled together to form a complete smart anti-theft alarm system based on the 51 microcontroller. During this process, it is essential to ensure that the connections between each module are correct and stable to avoid system failures caused by poor contact or incorrect wiring. The system’s physical model is shown in the figure.

LCD Display Testing:

Flame Detection Testing:


Infrared Detection Testing:


5
Conclusion

The smart anti-theft alarm system integrates the STM32 microcontroller, various sensors, and communication modules to provide users with convenient security services. On one hand, it meets design requirements, successfully completing the construction of hardware circuits and software programs, validated through physical production and functional testing. On the other hand, it utilizes the 51 microcontroller to control the overall system, driving the infrared, flame, and DHT11 temperature and humidity sensors to monitor the home environment, issuing immediate alerts in case of anomalies; it captures human dynamics with the HC-SR505 PIR sensor. The SIM800L module establishes a communication link with mobile phones, allowing users to view data and flexibly set temperature and humidity thresholds via their phones or buttons. Once any detected parameters are abnormal, the buzzer alarms, and the 0.96-inch OLED display simultaneously presents real-time parameters. The system is well-suited for home security, with portable monitoring equipment, enabling users to engage in smart theft prevention anytime, anywhere, promoting the widespread adoption of home security.


Scan to Get More Graduation Project Cases!
Free Consultation on Thesis-Related Issues!