A real-time home security system is designed using the STM32F103C8T6, a 32-bit ARM microcontroller as the central control unit. The system integrates a vibration sensor and a pyroelectric infrared sensor to detect intrusions. When activated, it continuously monitors the area and automatically sends MMS alerts when an intrusion is detected. The system uses the OV7670 image sensor to capture images, which are then processed and converted into JPEG format. These images are sent via the GPRS module SIM900 to a pre-set mobile phone number, while also being stored on an SD card for later review. Experimental results confirm that the system operates stably and meets its design objectives effectively.
In recent years, with the rapid development of urbanization in China, people's living environments have improved significantly, and the number of valuable items in homes has increased. Due to the complex nature of the urban population, home security has become a critical concern. Many research projects have been conducted both domestically and internationally, typically using high-performance ARM9 or ARM11 platforms running embedded operating systems with advanced sensors. However, these solutions tend to be expensive. This paper presents a cost-effective real-time home security system based on a low-cost 32-bit ARM platform. It offers a practical and affordable solution that meets the security needs of most households.
1. System Architecture
As shown in Figure 1, the system follows a modular design approach, leveraging mature technologies and standard modules to reduce complexity and overall costs. It uses a low-ripple, high-efficiency 5V switching power supply as the main power source. After voltage regulation through a multi-channel power management unit, the system supplies stable power to each module, ensuring strong anti-interference performance. The core of the system is the STM32F103C8T6 microcontroller, while the vibration sensor SW-180 acts as an interrupt input unit. Users can place it in an appropriate location to detect vibration signals. The system block diagram is illustrated in Figure 1.
The pyroelectric infrared sensor used is the HC-SR501, another one-way input unit. It can accurately detect human movement within a range of 5–7 meters at 100°C and send real-time signals to the system’s control core. The OV7670 image sensor is connected to the STM32F103C8T6 through a data buffer FIFO, reducing the microprocessor’s speed requirements and easing the system’s processing load.
Once image data is captured, the system performs preliminary processing and converts it into JPEG format. The resulting images are sent via the GPRS module SIM900 as MMS messages to a designated mobile number. In the event of an intruder, the system triggers an automatic photo capture, sends a multimedia alert to the user, and saves the image to the SD card for future reference.
2. Hardware Design
2.1 System Core Unit
The STM32F103C8T6 is a high-performance 32-bit ARM Cortex-M3 RISC core operating at 72 MHz, featuring 64 KB flash memory and 20 KB SRAM. It includes numerous I/O ports and peripherals such as two ADCs, three general-purpose timers, one PWM timer, two I2C interfaces, one SPI interface, three USART interfaces, one USB port, and one CAN bus interface. It operates from 2.0 V to 3.6 V and is available in an LQFP48 package. A low-dropout regulator (LDO) is used to convert the 5 V supply to 3.3 V for the microcontroller.
Figure 2 illustrates the clock and reset circuits. The SD card communicates with the core processor via the SPI interface. The vibration and pyroelectric sensors are connected through the interrupt I/O ports. The SCCB interface of the OV7670 image sensor is linked to the I2C bus of the core processor, while the GPRS module SIM900 communicates through UART1.
2.2 Image Acquisition Unit
The OV7670 is a 30W pixel CMOS image sensor from OmniVision. It features a compact size and low operating voltage, providing all the functions of a single VGA camera and image processor. The system controls the OV7670 via the I2C bus, supporting various resolutions including full frame, sub-sampling, and window modes. It can output up to 30 frames per second in VGA resolution. Users can adjust image quality, data format, and transmission method. OmniVision’s unique sensor technology enhances image quality by minimizing issues like fixed pattern noise, trailing, and color distortion.
A 12 MHz active crystal is used in the circuit of Figure 3 to generate a 12 MHz clock signal for the XCLK input of the OV7670. The PAM3101DAB28 provides a stable 2.8 V power supply for the analog section of the OV7670, and the same 2.8 V is used for the I/O section. This allows the LV7670’s internal LDO to operate normally, supplying 1.8 V to the core of the OV7670.
To reduce the system’s data acquisition burden, a FIFO chip AL422B with a capacity of 384 KB is used. This is sufficient to store two QVGA image frames. By using the FIFO as a buffer, the system no longer needs to manage the timing and control of the OV7670 directly, making the image acquisition process much simpler.
2.3 Vibration Sensor Unit
Connector 3.96Mm Pitch,Ressure Welding Bar Connector,Wire To Board Power Connector,Tcj6 Wire-To-Board Connector
YUEQING WEIMAI ELECTRONICS CO.,LTD , https://www.wmconnector.com