The traditional domestic electronic anti-theft alarm system solution is often to detect theft and other alarm information through electronic equipment at the user end, and then automatically transmit the signal to the alarm center through the communicator via the telephone line to complete the alarm process. This kind of alarm center often has many limitations. For example: the location and personnel of the alarm center need to be fixed, the alarm communication speed is slow, reverse query, control and other operations are difficult and professional, the problem of telephone line disconnection is difficult to solve, the communication cost, especially the long-distance communication cost is high, which is not conducive to the establishment of a long-distance network, the communication bandwidth is too small, the amount of information loaded is small, the technical means of audio and video signals are difficult to apply, and it is difficult to apply to the home security market, etc.
Since China Mobile officially launched the MMS service in September 2002, along with the establishment and continuous optimization of the MMS network project, MMS has gradually entered a stage of rapid development and stable application. Therefore, people are paying more and more attention to developing modern electronic anti-theft alarm systems based on China Mobile's network and MMS services, so that the system can play its advantages of monitoring anytime and anywhere, large network coverage, simple query control, low cost, fast alarm communication speed, simple audio and video application, etc., so that it can be widely used in various places such as homes, offices, factories, shops, etc.
1 System Hardware Design
1.1 System Bus Design
This MMS alarm system uses a common AT89C52 single-chip computer and a wireless module GPRS with MMS function. The front-end device can collect pictures according to the control camera and send them to the user's mobile phone. At the same time, the user can check the system status at any time through SMS commands, or control the front-end camera to collect images and monitor the on-site situation. The product designed with this solution is simple to operate. In order to reduce costs, on the basis of the minimum hardware design, the system functions are implemented as much as possible with software programs to reduce costs and meet market needs.
The designed hardware circuit mainly consists of three parts: Image capture and image compression encoding are realized through the serial port camera; the main controller processes image data and task control is realized by AT89C52 single chip microcomputer; the wireless part is GPRS module with MMS protocol. The circuit diagram is used in the design. In the design process, the structural block diagram of the hardware is designed first, as shown in Figure 1:
Figure 1 System hardware structure diagram
The MMS alarm system is composed of the single-chip microcomputer AT89C52 as the core. AT89C52 has a fast 8051 core, 8kB Flash E2PROM, and 256BI DATA RAM, which meets the hardware requirements; the MMS alarm function uses the MC55 chip of GPRS Module with MMS protocol stack MMS function; the serial port camera is used to realize the scene capture and image compression storage function.
1.2 MCU interface design
In the AT89C52 microcontroller interface, as only one set of serial ports, GM8123 can expand a full-duplex standard serial port into three standard serial ports, and can control the serial port expansion mode through external pins. The working baud rate of the mother and child serial ports of this chip can be adjusted by software without modifying the external circuit and crystal frequency. It has less external control, flexible application, simple programming and use, and is suitable for most systems with serial port expansion requirements. Therefore, GM8123 is used to expand three sets of serial ports for AT89C52, which can be connected and communicated with serial port cameras and GPRS modules. As shown in Figure 2.
Figure 2 MCU interface circuit design [page]
1.3 GPRS data transmission module hardware design
Since the on-site pictures need to be sent in the form of MMS, a wireless module with MMS function is selected. The GPRS module selected here is Siemens MC55[5]. The data communication between the GPRS module and the microcontroller is mainly completed through data transmission between ports TXD0 and TXD1, and between RXD0 and RXD1. The TXD0 port on the GPRS module is used to receive data from the microcontroller, while the extended TXD2 port on the microcontroller is used to transmit data to the GPRS module. The RXD0 port on the GPRS module is used to send data to the microcontroller, and the extended RXD2 port of the microcontroller is used to receive data transmitted from the GPRS module.
The circuit schematic diagram of the hardware part of the GPRS data transmission module is shown in Figure 3.
Figure 3 GPRS data transmission module circuit design
1.4 Serial Camera
The ZSV-01P serial port camera is a camera with video acquisition and image compression functions. It has a 1.3 million pixel CMOS camera with a maximum resolution of 1,280×960. It is a complete industrial image acquisition device with built-in functions such as shooting control, video capture, image data acquisition, image JPEG compression, and serial port communication. The maximum serial port communication rate can reach 115.2kbs[6]. This design uses a camera with a serial port. The host controls the camera through the serial port with an agreed protocol. The host and the camera are in a master-slave relationship. The camera's operating commands are issued by the host. The host can control the camera's output format and resolution, and the camera sends a response message to the host. Specific parameters:
(1) Interface: The interface between the host and the camera is the RS-232 standard interface, with a baud rate of 57,600, 8 data bits, no parity, and 1 stop bit.
(2) Image format: The image format output by the camera is JPEG.
(3) The image resolution can be: 640×480, 320×240, 160×120, 352×288, 176×144. The higher the image resolution, the larger the image data volume. Figure 4 shows the process of collecting a complete picture during packet transmission.
Figure 4 Serial camera acquisition process
[page]
Software Design2.1 Module Software Design
The software is constructed using standard C language and compiled by Keil C51 compiler. The system software design includes two parts: one is the writing of control words of each functional chip by the single-chip microcomputer and the expansion program of the single-chip microcomputer serial port; the other is the design of GPRS data receiving and sending program.
2.1.1 MCU and GPRS wireless module
Program This program is mainly used to complete the data transmission between the GPRS module and the microcontroller. The microcontroller is of the 51 series. The microcontroller serial port is set to work in mode 1, 8-bit UART, and the data transmission rate is variable; the working mode of timer 1 is mode 2, the data transmission rate is set to 9 600 b/s, and the crystal oscillator is 11.059 2 MHz. What we transmit mainly are AT commands, including the dialed number, the IP address of the DNS service, the password of the GPRS service provider, and the APN for accessing the GPRS service. Of course, a TCP communication needs to be established. The customer content of this service includes the IP, address, and TCP port number of the remote host and other transmitted information.
The main program of this program is to send and receive AT commands. When sending and receiving data, the data sending subroutine and data receiving subroutine are called respectively. There are three subroutines here: data sending subroutine, data receiving subroutine and delay subroutine.
2.1.2 The control process of the microcontroller camera.
The host operates as follows when acquiring images from the camera: (1) Open the serial port; (2) Start acquiring images and set the image resolution; (3) Acquire image data; (4) End image acquisition; (5) Close the serial port. Step (3) of acquiring images can be executed repeatedly. If the image resolution is reset, step (2) should be executed again.
2.1.3 MCU serial port expansion program design
The associated port status and meaning are as follows:
(1) sbit MS=P3^6; //GM8123 working mode control
(2) sbit RESET = P3^7; //GM8123 reset pin control
(3) unsigned char SendBuff[5]={0x67,0xbc,0xc9}; // Three slave serial ports are required
Defined in the main program:
TMOD = 0x20; //Specify timer 1 to work in mode 2
IE = 0x90; // Open serial port interrupt
SCON=0xc0; //Serial port works in mode 3
TH1 = 0xf8; // Load the initial value of timer 1 and set the host operating baud rate to 7200bs
P1=0x00; // Set GM8123 command word address
SBUF=Contr_data; // Set the GM8123 slave serial port baud rate to 19 200bs and the mother serial port baud rate to 11 5200bs
Therefore, the whole control process is: define and initialize the control words and ports of each component, and then the microcontroller sends commands through the serial port to check and control the work of each sensor, serial camera and MCC55.
2.2 Program Flow
After the system is powered on, the microcontroller is initialized first, the baud rate and timer of the serial port are set; then the GM8123 and various sensors are initialized; then the MC55 is powered on and initialized.
The system program flow is shown in Figure 5.
Figure 5 System program flow chart
3 Conclusion
This design uses the serial port camera of Zhongshen Microelectronics Company to realize image capture and image compression coding in one, simplifying the complexity of the circuit. The wireless part of the GPRS module with MMS protocol uses SIEMENS's MC55, which has stable performance, reliability and easy operation. The experiment verifies that the alarm system works well. Users can use their mobile phones to remotely control the system anytime and anywhere, take photos of the scene and send them to a designated mobile phone or email address. It can be connected to a variety of wireless sensor alarms, such as smoke sensors, wireless door magnets, infrared human body sensors, gas sensors, etc., to realize alarms with multiple triggering methods, and has image motion detection function, which can automatically trigger alarms for moving objects, and has certain practical value.
References:
[1]. GPRS datasheet http://www.dzsc.com/datasheet/GPRS+_1594650.html.
[2]. AT89C52 datasheet http://www.dzsc.com/datasheet/AT89C52+_1064535.html.
[3 ]. TXD1 datasheet http://www.dzsc.com/datasheet/TXD1+_666125.html.
[4]. RS-232 datasheet http://www.dzsc.com/datasheet/RS-232+_584855.html.
Previous article:Design of multi-gas detection system based on single chip microcomputer
Next article:Design of Ultrasonic Distance Meter Based on AT89C52
Recommended ReadingLatest update time:2024-11-16 19:47
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Study stickers
- 24 "Millions" Raspberry Pi Car - Bullseye Benchmark Test of Raspberry Pi 64-bit System
- Sensors and measurement and control circuits
- Advanced usage of embedded C language
- A strange problem of TMS320F2812 caused by an eCAN bug
- [Evaluation of EVAL-M3-TS6-665PN development board] 2. Detailed explanation of functions
- A brief discussion on PCI_Express architecture.rar
- Free application: Allwinner heterogeneous multi-core AI intelligent vision V853 development board
- [Mill MYB-YT507 development board trial experience] Python displays memory and CPU real-time status 2
- I can't understand the circuit diagram at all