Design of alarm taps in video surveillance systems

Abstract: In the video surveillance system, the main function of the alarm tap is to receive the alarm input signal sent by the alarm sensor, and transmit the alarm information to the monitoring system host according to a certain protocol and baud rate. This paper introduces the design method of the alarm tap in the video surveillance system, and discusses the performance characteristics and usage of the transmit-receive chip MAX483.

Keywords: video surveillance; alarm tap; MAX483

CLC number: TN943.6 Document code: A Article ID: 1003-353X(2003)04-0068-04

1 Introduction

In recent years, video surveillance systems have been widely used in industries, transportation, shopping malls, banks, public security and intelligent residential quarters. They are one of the important means of modern management and monitoring, which greatly improves management efficiency and automation. Generally speaking, the video surveillance system consists of the following components: control matrix, decoder, camera, pan/tilt, alarm tap, monitor; some systems also include hard disk recorders and multi-picture processors. Usually, the video surveillance system has to set a number of alarm points. Once an abnormal situation occurs at the alarm point, the monitoring system host can automatically switch the monitoring screen to the alarm point and store the alarm record. Since the alarm point is usually far away from the monitoring system host, and some monitoring systems need to set hundreds or even thousands of alarm points, it is unrealistic to use the alarm sensor directly connected to the monitoring system host. The middle must pass the alarm tap. . The main function of the alarm tap is to receive the alarm input signal from the alarm sensor, and transmit the alarm information and the address code of the alarm tap itself to the monitoring system host according to a certain protocol and baud rate. Usually an alarm tap controls several alarm points (such as 8 or 16), and many alarm taps can be connected in series to control many alarm points. Each alarm tap has a unique address code. The monitoring system host can know the specific location of the alarm point through the received address code, and the alarm tap itself does not alarm. The design method of the alarm tap is described in detail below.

2 alarm tap components and main functions

2.1 Composition

Figure 1 shows the block diagram of the alarm tap. It consists of six parts: CPU, transmit and receive circuit, address code circuit, optocoupler, alarm analog switch and switching power supply.

2.2 Main functions

(1) Through the alarm sensor, the alarm tap can control 8 alarm points (each I/O of port C controls one alarm point);

(2) It can be checked whether the alarm tap is working normally and the system can alarm by triggering the alarm analog switch;

(3) Up to 64 alarm taps can be connected in series, and a total of 512 alarm points can be controlled;

(4) The alarm tap can be connected to a control matrix, hard disk recorder or multi-picture processor.

3 hardware structure

3.1 CPU

Because PIC series MCU has the advantages of practicality, low price, power saving, small size and high speed, and the PIC series MCU contains the watchdog timer; the software of the alarm tap is simpler and the program is not large, so the CPU selects PIC16C57. . The chip contains 2k EPROM and does not require an external ROM, so the hardware is simple and easy to debug. The main features of the PIC16C57 are as follows: (1) Using a reduced instruction set, only 33 instructions, the instruction word length is 12 bits, all instructions are single-cycle instructions; (2) the system is a Harvard structure, and the data bus and the instruction bus are separated separately; (3) With internal self-oscillating watchdog (WDT); (4) With low power mode (Standby Mode), power consumption is less than 10mA; (5) With security bit, the security fuse can be selected during program programming If it is blown, the program cannot be read and copied; (6) the operating frequency is DC ~ 20MHz; (7) there are 20 bidirectional independently programmable I / O ports, each I / O line can be programmed by the program Its input/output direction.

3.2 Address Encoding Circuit

Since a video surveillance system needs to control many alarm taps to control many different alarm points, each alarm tap must be given a unique address code. The address coding circuit is composed of a dial switch and a pull-up resistor. Before each power-on, the address of the alarm tap is determined by the dial switch. After each reset of the CPU, the address code of the alarm tap is first read into the RAM of the CPU. The CPU's PB0~PB5 are connected to the six-digit DIP switch, so the system host can connect 64 identical alarm taps in series; the system host and multiple alarm taps can be connected by RS-485 bus in any tree shape. .

3.3 Transmit and Receive Circuit

The transmitting and receiving circuit is mainly used to realize serial communication between the CPU and the system host. The transmitting and receiving circuit is mainly composed of a MAX483 chip, and its function is to convert the RS-485 level of the input signal into a TTL power suitable for the CPU. Flat; converts the TTL level of the CPU output signal to an RS-485 level suitable for long-distance transmission. The main features of the MAX483 chip are: (1) The chip is a low-power, 25-kbps RS-485 communication transmitter and receiver; (2) can reduce EMI by reducing the conversion rate and is caused by improper terminals The reflection of the interference. (3) The communication mode is half-duplex mode; (4) Single 5V power supply, quiescent current is 120mA; (5) It has Shutdown Mode, when the RE and DE pins are low, the chip is off at this time. Mode, lowest power consumption, current consumption is only 0.1 mA.

The interface circuit between the MAX483 and the CPU is shown in Figure 2. The PA0 pin of the CPU is set to the data receiving pin (RXD), the PA2 pin is set to the data transmitting pin (TXD), and PA1 is the control pin. When PA1 is low, the CPU is allowed to send data to the system host; when PA1 is high, the CPU can receive data from the system host. In order to ensure the correct transmission of data and prevent false alarms, in addition to parity, the accumulated sum of data is sent. After the system host receives the data, it must check whether the accumulated sum of the received data is equal to the accumulated sum of the sent, if not If they are equal, it indicates a transmission error. In addition, after the CPU sends all the data, it receives the response information of the system host. This response information is the accumulated sum of the data. Only when the summation of the transmission and reception is the same, the transmission is correct. The baud rate of the communication is set to 4800.

3.4 Optocoupler and alarm analog switch

In order to improve the anti-interference ability of the alarm tap and prevent false alarms, an optocoupler circuit is added between the CPU and the alarm sensor, and a total of eight optocouplers are required. The alarm analog switch consists of an eight-position toggle switch and a pull-up resistor to verify that the alarm tap is working properly and that the system host can alarm. When the toggle switch is connected to the ground, the corresponding pin of the CPU inputs a low level, indicating that there is an alarm signal input. At this time, the system host should be able to alarm and store the corresponding alarm record.

3.5 switching power supply

Since the switching power supply does not require a heavy power transformer, it has the advantages of small size, light weight, and high efficiency. Therefore, the power supply of the alarm tap is a switching power supply, and the switching power supply provides a voltage of +5V. Pay attention to the anti-interference performance of the switching power supply during design, and minimize the interference generated by the switching power supply. The following measures are taken in this design: (1) adding RC absorbing circuit between C and E poles of the switching tube; adding RC absorbing circuit at both ends of the rectifying diode in the secondary rectifying circuit to suppress surge voltage; (2) in two The secondary rectifying circuit is connected with the rectifier diode in series with a coil capable of resisting the saturation core, and suppresses the reverse surge voltage of the rectifier diode; (3) thickening the thickness of the insulating spacer between the switching tube and the heat sink to reduce the switching tube Coupling capacitance between the heat sink and (4) shielding measures to further reduce the interference of the switching power supply.

4 software flow of the alarm tap work

Figure 3 shows the software flow for the operation of the alarm tap. The software program is written in PIC16C57 assembly language. Pay attention to the preparation of the watchdog (WDT) program. The WDT has a basic overflow period of 18ms (no preset multiple). If a longer WDT period is required, Prescaler can be assigned to the WDT. The maximum division ratio is 1:128. At this time, the WDT overflow period is 2.5s. The division ratio of this design is chosen to be 1:16, that is, the overflow period is 288ms.

Pay special attention to "Configuring EPROM (Configuration EPROM)" when programming the PIC16C57. The EPROM contains three items: program security fuse, watchdog timer setting, and oscillation type (RC/XT/HS/LP) settings.

Since the PIC16C57 does not have a dedicated baud rate generator, a software delay subroutine must be programmed. Each time a bit delay is transmitted for about 0.2ms, the delay time can be adjusted by the oscilloscope to make the baud rate equal to 4800.

Due to space limitations, a detailed list of programs is not listed here. Only subroutines that send and receive one byte are given as follows:

STATUS EQU 03H

RA EQU 05H

DATA EQU 08H

ODD EQU 09H ; parity flag

DELAY EQU 0AH; drive delay flag

CT EQU 0BH

(1) PIC microcontroller receives a byte subroutine

RECE BCF RA, 1 ; MAX483 is in receive state

BTFSC RA,0

GOTO WORK

CALL DLY_0.1MS; delay 1/2 BIT

BTFSC RA, 0; Is it still low?

GOTO RECE

CALL DLY_0.2MS

MOVLW 8 ; read in characters

MOVWF CT

CLRF ODD

RECELO CALL DLY_0.2MS

BCF STATUS, C

RRF DATA, 1

BTFSC RA,0

BSF DATA, 7

MOVF DATA,0

XORWF ODD, 1 ; parity property

DECFSZ CT, 1

GOTO RECELO

CALL DLY_0.2MS

CLRW

BTFSC RA, 0; judge whether the check digit is 1

MOVLW 80H

XORWF ODD, 1

BTFSS ODD, 7

GOTO RECE_OK

GOTO REC_ERR ; does not match the parity attribute

RECE_OK ; matches the parity attribute

RETLW 0

RECE_ERR

RETLW 0


(2) PIC microcontroller sends a byte subroutine

BSF RA, 1 ; MAX483 is in the transmitting state

CALL DLY_1MS

MOVLW 8; send characters

MOVWF CT

CLRF ODD

BCF RA, 2; send start bit

SENDLO CALL DLY_0.2MS

MOVF DATA,0

XORWF ODD, 1 ; parity property

BCF STATUS, C

RRF DATA, 1

BCF RA, 2

BCF STATUS, C

BSF RA, 2

DECFSZ CT, 1

GOTO SENDLO

CALL DLY_0.2MS

MOVLW 01H

XORWF ODD, 1

BCF RA, 2

BTFSC ODD, 1 ; send parity flag

BSF RA, 2

CALL DLY_0.2MS

BSF RA, 2; send stop bit

RETLW 0


DLY_1MS

MOVLW 250; delay 1 millisecond

CALL DLY_LO

RETLW 0

DLY_0.1MS

MOVLW 24; delay 0.1 ms

CALL DLY_LO

RETLW 0

DLY_0.2MS

MOVLW 48; delay 0.2 ms

MOVWF DELAY

DLY_LO

NOP

DECFSZ DELAY, 1

GOTO DLY_LO

RETLW 0

5 Conclusion

This paper introduces the design of the alarm tap in the video surveillance system. Since the working principle of the alarm tap is simple, no complicated hardware design and software programming are required. The alarm tap has stable performance during use, and no false alarm, crash and interference have been found.


references:

[1]. MAX483 datasheet http://
[2]. PIC16C57 datasheet http://
[3]. PB5 datasheet http://
[4]. RS-485 datasheet http://
[5]. TTL datasheet http://
[6]. PIC16C5X datasheet http://

[7] Li Dongxing, Chen Xiaomu, Zhou Ligong. Application Design of PIC16C5X Series Single Chip Microcomputer. Electronic Industry Press, 1996.

[8] Wang Xingzhi, Wang Lei et al. Anti-jamming technology of single-chip application system. Beijing University of Aeronautics and Astronautics Press, 2001.

[9] Huang Zaiyin, Zong Jianhua. Design of 256×16 video matrix switching system. Electronic Engineer, 2001, (12).




:
0 times
Window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdMiniList": false, "bdPic": "", "bdStyle": " 0", "bdSize": "24" }, "share": {}, "image": { "viewList": ["qzone", "tsina", "tqq", "renren", "weixin"], "viewText": "Share to:", "viewSize": "16" }, "selectShare": { "bdContainerClass": null, "bdSelectMiniList": ["qzone", "tsina", "tqq", "renren" , "weixin"] } }; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share. Baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];

Needle Rollers

Cemented Carbide Needle Rollers,Chrome Steel Needle Rollers,Stainless Steel Needle Rollers,Carbon Steel Needle Rollers

Qingdao Yukun Bearing Needle Roller Co.,Ltd. , https://www.ykneedleroller.com