Abstract: In order to realize wireless automatic alarm and monitoring for major safety places, according to the basic principle of pyroelectric infrared sensing, an infrared detector for receiving mobile body radiation is designed and implemented. The detector is controlled by ATmega16 microcontroller. It integrates wireless communication technology and signal detection technology, communicates with the controller through the wireless transceiver module, and the controller is connected with the control computer through RS-485. The whole system forms a wireless network to realize multi-channel wireless sound and light alarm and remote monitoring. In addition, the system also designed a display module to facilitate data reading and analysis. The design has the advantages of strong real-time performance, high reliability, low cost and convenient maintenance.
With the rapid development and wide application of electronic technology and microcomputer technology, it provides modern home security and garage. The alarm system of major safe places such as offices, banks, museums, etc. has brought about new changes and a new look. In daily life, various wireless detection systems are born, which greatly saves the cost of laying dedicated communication circuits and facilitates the planning of various safe places. Alarming through wireless communication is an extremely convenient and effective means, and related application promotion. As part of a communication system, wireless communication consists of a signal source and a receiver, a transmitting device, a transmission medium, and a receiving device. The transmitting device of the wireless digital communication system is divided into two parts: source coding and source decoding. The receiving device of the wireless digital communication device performs demodulation, decoding, decryption, etc., that is, completes the function of inverse transformation of the transmitting device, and the purpose thereof is to correctly recover the original signal from the signal with interference, and at the same time, the multiplexed signal can be Release, achieve the correct way. The wireless communication-based security system uses various wireless communication technologies to construct basic system functions for control technology, as well as modular, structured, and functional technologies. The system is easy to maintain and improve. According to the infrared detection principle, the infrared detection sensor can be divided into two types: photon detector and heat detector. A photon detector is a radiation detector made by an external photoelectric effect or an internal photoelectric effect, also called a photoelectric detector. The principle is that the electrons in the detector absorb the energy of the photons, causing changes in the state of motion to generate electrical signals, which are commonly used to detect infrared radiation and visible light. The pyroelectric infrared detector is a pyroelectric type infrared sensor based on the principle of thermoelectric effect, and the internal thermoelectric element is composed of a high-thermal coefficient iron-titanium-lead-mercury ceramic and a filter lens window of aluminum cholate and triethylene sulphate. Polarization changes with temperature. The pyroelectric infrared detector is composed of a sensing probe element, an interference filter and a FET matching device. As the collector of the security system, the sensor adopts the common interface as the output interface of the signal, which is very suitable for the signal input of various sensors. After the signal is output, an integrated switch is used. When the signal reaches the preset value, the integrated switch is turned on to make the coded transmitting module work, thereby encoding and modulating the transmitted signal.
1 System principle
The security system device is an acousto-optic alarm device based on pyroelectric infrared detection principle, which wirelessly transmits and receives signals, including data acquisition, data coding, wireless transceiver, single chip control, signal detection, etc., by ATmega16 controller and pyroelectric release. The electric infrared sensor, the coding chip PT2262, the decoding chip PT2272, the liquid crystal display 12864 and the like are composed. The main content of this system research is to detect the alarm signal through the pyroelectric infrared sensor. When there is a signal, the wireless transmitting module is started to encode the signal and then transmitted to the ATmega16 MCU. After receiving the signal through the wireless receiving module, the received encoded data is input to the system. On the decoder, the encoder output terminal drives the AVR microcontroller to generate an external interrupt. The ATmega16 MCU collects the data output from the decoder into the internal MCU to realize the sound and light alarm and judge the alarm number. The data is displayed on the LCD and transmitted to the control center. computer.
2 system circuit design
The system hardware circuit includes a wireless transmitting system, a wireless receiving system, and a power supply circuit. The wireless receiving system is controlled by an ATmega16 single-chip microcomputer, and the peripheral device is mainly composed of a wireless receiving module, a receiving and decoding, an audible and visual alarm circuit, and a display module. The system block diagram is shown in Figure 1.
Figure 1 system block diagram
2.1 Wireless transmitting circuit
The security system collects alarm signals through the pyroelectric infrared sensor principle for encoding and wireless transmission. The signal collected by the sensor is relatively weak and needs to be processed. The processing circuit selects the integrated pyroelectric infrared processing chip BISS0001, which has higher processing signal performance, and is controlled by the op amp, voltage comparator, state controller, and delay time. A digital/analog ASIC consisting of a timer and a lockout timer. It has two modes of work: repeatable trigger mode and non-repeatable trigger mode. The encoding chip adopts Taiwan Pucheng Company to produce PT22 62. The encoded signal is composed of data code, address code and synchronization code to form a complete code. It has the characteristics of low power consumption, low price and good versatility. The signal collected by the pyroelectric infrared sensor is amplified by BISS0001 and the coupling capacitor, and the pyroelectric infrared sensor acquisition circuit is shown in Figure 2.
Figure 2 Schematic diagram of pyroelectric infrared sensor acquisition circuit
After BISS0001 processing, the signal output is connected to the load through two triodes, as shown in Figure 3, where R8-R11 are 1 KΩ pull-up resistors, R4, Q1, Q2 form electronic switching modulation circuit, R7, C18, Q4, L1 and the sound table resonator Y1 form a power oscillation level of 315 MHz. When OUT is high flat, Q1 is turned on, and the encoder is turned on to transmit the data code and the corresponding address code and synchronization code.
Figure 3 wireless transmission schematic
2.2 Wireless receiving circuit
The wireless receiving chip of the system uses super-regeneration SH9902, and the decoding chip uses PT2272. After receiving the signal, after the address code is compared and verified twice, the VT pin outputs a high level and is converted after passing through the Schmitt inverter. When it is low, it triggers the external interrupt of the MCU. At the same time, the corresponding data pin outputs the received data. The address of PT2272 and the address of the encoder PT2 262 must be the same. The schematic diagram of the wireless receiving circuit is shown in Figure 4.
Figure 4 Schematic diagram of the wireless receiving circuit
2.3 LCD display circuit
This system uses LCD display 12864, which uses ST7920 controller, 5 V voltage drive, with backlight, built-in 8192 16×16 dot matrix, 128 characters (8×16 dot matrix) and 64x256 dot matrix display RAM (GDRAM). The interface with the external CPU adopts two parallel or serial control modes. The communication interface between the LCD and the MCU can be designed to use direct or indirect access. The system is connected in parallel with the ATmega16 through the I/O port. The 12864 8-bit data cable is directly connected to the 8-bit I/O port of the ATmega16. When the alarm signal is more than 2 (including 2), the LCD will display the "alarm number" of each alarm point in turn. The block diagram of the parallel interface of the 1212 LCD monitor and ATmega16 is shown in Figure 5.
Figure 5 12864 LCD interface and ATmega16 parallel interface block diagram
2.4 sound and light alarm circuit
When the system detects that there is an alarm signal, the timer starts, and a periodic interrupt is generated. The P4 and P5 ports of the ATmega16 MCU are controlled to emit a pulse signal with a period of 1 s. The buzzer beeps and the LED flashes. Realize the sound and light alarm, when the reset button is pressed, the system resets and the alarm is released. The sound and light alarm circuit is shown in Figure 6.
Figure 6 sound and light alarm circuit
2.5 power circuit
The power circuit is composed of a transformer, a rectification filter circuit and a voltage stabilization circuit. The transformer is used to convert the 220 V AC voltage into 7.5 V and 9 V low voltage AC voltage; the rectification filter circuit is used to rectify the AC current into a smoother DC voltage; then output the +5 V (Vcc) and + through the regulator circuit. 9 V DC for use in the receiving and transmitting systems of the system. The power supply circuit is shown in Figure 7.
Figure 7 power circuit schematic
3 software design
The system software design is mainly AVR microcontroller program design, which consists of main program and various function block subroutines, including LCD display program, external interrupt service program, timer interrupt program, etc. It has the characteristics of clear structure, easy adjustment and improvement. The system mainly implements system control functions by C program, realizes system initialization, control function setting and alarm mode setting, etc., and completes automatic detection control and alarm tasks. When the pyroelectric infrared sensor detects the alarm signal, the wireless code transmitting system starts to work, and encodes and transmits the address signal and the data signal. Signal input to the radio receiving system receives a signal, it demodulates the signal and decodes the demodulated to the integrated circuit, if the address signals match exactly microcontroller external interrupt is triggered, the alarm signal is read in the interrupt service routine and The interrupt flag is set and displayed on the 12864. The buzzer sounds an alarm and the LED flashes. The MCU transmits the received data to the central control computer via RS-485. The main program flow chart of the receiving system is shown in Figure 8.
Figure 8 main program flow chart
3.1 LCD display program design
After the system is powered on, the LCD needs to be initialized first. The 12864 display is divided into two lines. When initializing, the first line displays "Acquisition data: single time", and the second line displays "Control command: Wait". When the lower computer collects single data acquisition When the first line displays the data collected in a single time; when the lower computer continuously collects data, 12864 displays the collected data; the second line displays the command issued by the PC, and when the PC does not send the command, it displays "waiting"; When the PC sends the command, it displays the "command". It can directly use the MCU bus mode to read and write the LCD or indirectly use the I/O software to simulate the LCD timing to read and write the LCD. This design uses an indirect method. First, ATmega16 performs the system on the system. Initialize, set the state of the I/O, initialize the liquid crystal, set the display function of the liquid crystal, and control the write data address by the write command. The flow chart is shown in Figure 9.
Figure 9 12864 control flow chart
The wireless receiving system displays the alarm number in real time on the 12864 through the received alarm signal. If there are multiple alarm data, the alarm point number needs to be displayed cyclically. Therefore, the data displayed on the 12864 needs to be dynamically updated. The flow chart is shown in Figure 10.
Figure 10 Dynamic modification display flow chart
3.2 External Interrupt Service Program Design
The system external interrupt trigger mode selects the edge trigger mode to detect whether the wireless receiving system receives the alarm signal. If the trigger mode is sampled twice in succession, one cycle sampling is high, and the next cycle is low, then the "1" interrupt request is triggered. Until the CPU responds to this interrupt, it is cleared. This will not lose the interrupt, but the negative pulse width of the input needs to be kept for at least 12 clock cycles before it can be sampled by the CPU. When the wireless receiving system receives the alarm data, the external interrupt 0 of the microcontroller generates an external interrupt, receives the alarm data, and turns off the external interrupt 0. At the same time, the timer 1 is started to start counting, and after 2 s, the external interrupt 0 is re-opened to receive the next time. Alarm data. The interrupt service subroutine flow chart is shown in Figure 11.
Figure 11 interrupt service subroutine
3.3 Timed Interrupt Service Program Design
The system uses an 8 MHz clock crystal oscillator, and Timer 1 acts as a time interval counter for the external interrupt response alarm data, avoiding an alarm signal causing the microcontroller to generate multiple interrupts. Timer 1 is 16 for the initial value of the counter 3CAFH, after 5 interruptions, the external interrupt is turned on.
Timer 0 is used as the pulse generation controller of the sound and light alarm circuit. The initial value is set to 06H. Each time it is interrupted 500 times, the P4 and P5 ports of the microcontroller are controlled to change the output level state, that is, the sound and light alarm circuit emits a period of 1 s. Light alarm signal. The interrupt subroutine for Timer 0 and Timer 1 is shown in Figure 12.
Figure 12 timer interrupt subroutine
4 Conclusion
Based on the principle of infrared pyroelectric sensor, the system completes the software and hardware development of multi-channel wireless security system. The system can complete the alarm information of 15 alarm points, and use the liquid crystal display to display the alarm serial number cyclically, and perform sound and light alarm through the light-emitting diode and buzzer, and transmit the obtained data to the upper computer. The system has the advantages of easy operation and maintenance, strong real-time performance, etc. The system can also improve the electromagnetic interference. The internal crystal oscillator of the single-chip microcomputer can reduce the electromagnetic interference of the system itself.
references:
[1]. ATmega16 datasheet http://
[2]. RS-485 datasheet http://
[3]. PT2262 datasheet http://
[4]. PT2272 datasheet http://
[5]. BISS0001 datasheet http://
UPVC JIS K-6739 Drainage Fitting
Drainage Tee,Jis Drainage Tee Blue,Upvc Drainage Tee Blue,Upvc Jis Drainage Fittings
Zhejiang Huangyan Minghua Plastic Pipe Fitting CO.,LTD , https://www.pipefitting-mh.com