Design of MMS alarm system based on GPRS and single chip microcomputer

Publisher:dong125612Latest update time:2013-01-25 Source: dzscKeywords:GPRS Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  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

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

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

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

Figure 4 Serial camera acquisition process

[page]

  Software Design

  2.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

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.

Keywords:GPRS Reference address:Design of MMS alarm system based on GPRS and single chip microcomputer

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

Design of real-time home security system based on ARM and GPRS technology
  introduction   In recent years, with the rapid advancement of urbanization in my country, people's living environment has been greatly improved, and there are more and more valuable items in the home. Due to the relatively complex floating population in cities, home anti-theft has become a very concerned issue for
[Microcontroller]
Design of real-time home security system based on ARM and GPRS technology
Design of remote intrusion monitoring and alarm system based on ARM and GPRS
With the continuous development of electronic and communication technology, single-chip microcomputers have been widely used in data compression and acquisition, electronic equipment, industrial control, and various household appliances. Wireless communication has the advantages of low investment, simple maintenance, c
[Microcontroller]
Design of remote intrusion monitoring and alarm system based on ARM and GPRS
Application of mC/OS-II in GPRS Terminal System
The real-time embedded operating system mC/OS-II is aimed at small and medium-sized embedded applications. The kernel including all functional modules is about 10KB, and the amount of RAM used is mainly related to the number of tasks in the system. GPRS is a data service developed on the basis of the currently
[Microcontroller]
Application of mC/OS-II in GPRS Terminal System
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号