Unmanned remote automatic alarm and inquiry system for stores

Publisher:神雕Latest update time:2016-12-28 Source: eechina Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction

Many stores are unattended after work. When there is a theft alarm or fire alarm, people hope that the store can automatically alarm, and at the same time, they can use the phone to further inquire and verify the alarm situation. This article uses the AT89LV51 Flash microcontroller , combined with the new MODEM communication chip and voice circuit , to successfully realize the unattended automatic alarm and inquiry function of the store.

1 Introduction to the main chips

1.1 AT89LV51 Flash microcontroller

AT89LV51 is a single-chip microcomputer with Flash memory compatible with the MCS-51 series produced by Atmel . The main features are: it can work in the low voltage range of 2.7~6V; 4K bytes of programmable Flash EEPROM, three-level program memory confidentiality; 128 bytes of internal RAM; 32 programmable I/O pins, 2 16-bit timers/counters, 6 interrupt sources, 1 full-duplex serial port, etc.; the pins are fully compatible with MCS-51.

1.2 MODEM communication chip

SS173K222AL is a highly integrated single-chip microcomputer programmable MODEM chip produced by TDK, and the pinout is shown in Figure 1.

.gif 

The chip is easy to control with a single-chip microcomputer; it can transmit data serially; it is compatible with CCITT V.22, V.21, BELL212A, 103 standards; it has the functions of call progress, carrier, answer tone, and long loopback detection; it can generate DTMF signals through programming, etc. There are 4 8-bit registers CR0, CR1, DR, and TR for monitoring inside the SSI73K222AL chip: CR0 is used to control the data transmission mode of the telephone line, CR1 is used to control the interface between the internal state of the chip and the single-chip microcomputer, DR is used to monitor the working state of the MODEM, and TR is used to control the generation of audio signals. It can be programmed to generate DTMF signals and answer tone signals. The meaning of each bit of the 4 registers is listed in Table 1.

Table 1 The meaning of each bit of the internal register of SS173K22 2A

nameaddressData Bits
AD2AD0D7D6D5D4D3D2D1D0
CR000Modulation selection0Set the sending mode, where 1100 means FSK modeSend permissionAnswer/Originate


CR001Data transmission methodInterrupt EnableBypass EncodingClock ControlReset OperationMode test, where 00
means normal

DR010UnusedUnusedReceive dataDecoding flagsCarrier DetectAnswer toneCall ProcessLong loop detection
TR011RXD controlDefensive soundAnswer toneSend DTMF toneCorresponding to 116 DTMF signals, such as: 0001=1, 0010=2, etc.


1.3 ISD33060 Voice Chip

ISD33060 is the third generation 3V single-chip voice IC of ISD Company, and its pins are shown in Figure 2.

.gif 

The total storage time of this chip is up to 60s; the interface with the external microprocessor adopts SPI (Serial Peripheral Interface) serial peripheral interface or MSI (Microwire Serial Interface) micro transmission line serial interface, which realizes the flexible control and addressing of the voice chip by the host, reduces the number of pins of the interface, and improves the flexibility of use; the recording and playback time can be arbitrarily segmented by control instructions, and the shortest length of each segment is 150ms.

When using the SPI interface protocol, five control lines are mainly used:
* Pin 1 (SS) - chip selection input, low level is valid;
* Pin 2 (MOS1) - serial data input, ISD chip receives control command data from the microcontroller from this pin;
* Pin 3 (MISO) - serial data output, microcontroller obtains ISD return data from this pin;
* Pin 28 (SCLK) - SPI interface serial clock input, used for synchronous data transmission;
* Pin 25 (INT) - when the voice playback ends or the recording and playback overflows, it becomes low level, and at the beginning of the next SPI cycle, the signal is cleared and returns to high level.

.gif 

Figure 3 Automatic alarm and query circuit diagram

2 Hardware circuit design

The hardware circuit principle is shown in Figure 3. The main functions of this system are:
* Using the telephone line and the interrupt function of the microcontroller to automatically remotely voice alarm fire and theft;
* Multiple numbers can be dialed, and each number can be dialed repeatedly until it is dialed through;
* There are signs for fire and theft alarms, and the alarm situation can be checked and verified by phone with the password;
* The alarm sign can be eliminated on the spot or by phone;
* The password can be modified by phone.

In Figure 3, L1 and L2 are connected to the telephone line; U1 is the AT89LV51 Flash microcontroller, U2 is the MODEM chip SSI73K222AL, U3 is the voice chip ISD33060, U4 and U5 are the output and input amplifier LM358; K is the on-site alarm elimination switch, D7 and D8 are the alarm elimination and alarm indications respectively, INT0 and INT1 interrupts are connected to the fire alarm and theft alarm signals respectively, and the falling edge is effective.

.gif 

Figure 4 Main program flowchart

After power is turned on, the system first initializes the P1, P3 ports and the INT0, INT1 interrupts, and then continuously queries the P1.6 and P1.7 pins. To avoid repeated alarms in the system, the program automatically sets the fire and theft alarm flags for each effective fire and theft alarm. Only when the alarm flag is cancelled can a new alarm be accepted. When K is pressed, P1.6 is low level, the alarm flag is cancelled on site, and the alarm indication LED D7 is on, and the alarm indication LED D8 is off. If there is a telephone inquiry, the ring current comes, P1.7 is low level, the program controls P1.5 to be high level, relay J is activated, the line is connected, and the voice prompt is: "Please enter the alarm system password, ending with #". Then, wait for the password to be entered. If no password is entered within the specified time, it will prompt: "Time is up, please hang up", and then disconnect the line and exit the inquiry. If a password is entered, it will determine whether the password is correct. If the password is wrong and does not exceed three times, it can be re-entered. If it exceeds three times, the inquiry will be exited; if the password is correct, it will prompt: "Please choose: 1 Check the alarm situation, 2 Eliminate the alarm, 3 Change the password, 4 Exit the inquiry". At this time, you can check whether there is an alarm, fire alarm or burglary alarm according to the alarm sign; select 2 to eliminate the alarm sign and achieve the same effect as switch K; select 3 to set a personalized password; select 4, the relay J is reset, the line is disconnected, and the query is exited.

When a fire or burglary alarm occurs, the INT0 and INT1 pins of the microcontroller have falling edge signals, and the interrupt processing is turned on. The processing of fire and burglary alarms is completely similar. For example, when a fire alarm comes, first check whether there is a fire alarm sign. If there is a sign, it means that the alarm has been reported and the system exits the interrupt; if there is no sign, the system immediately connects the line and dials the preset phone number. If there is an answering tone, a voice prompt is issued: "There is a fire alarm in the store! There is a fire alarm!", and a fire alarm sign is set in the memory, and then the line is disconnected, and then it is determined whether all the preset numbers have been dialed. If the number has not been dialed, the next one is dialed; if the number has been dialed, the interrupt is exited.

It is worth noting that in order to improve the accuracy of the alarm and reduce false alarms, in addition to adopting certain anti-interference measures, multiple sensors are also used for the same alarm situation . For fire alarm, smoke and infrared sensors can be used together to improve the reliability and accuracy of the alarm.

3 Software Design

Due to space limitations, the program list is omitted. The main program flowchart of this system is shown in Figure 4, the fire alarm interrupt processing program flowchart is shown in Figure 5, and the theft alarm interrupt processing program flowchart is shown in Figure 6.

.gif 

.gif 

Conclusion

Although this device is developed for general stores, it can be fully extended to other unmanned and security-required places.

References

   1. Yu Yongquan Flash Microcontroller Principles and Applications 1997
   2. TDK Semiconductor Corp TDK 2001 EmbeddedModem Data Book
   3. ISD. ISD33060/120/150/180/240 Products Manual.1998
   4. He Limin Single Chip Microcomputer Application Technology Selection⑧ 2000


Reference address:Unmanned remote automatic alarm and inquiry system for stores

Previous article:The data acquisition and control system composed of C8051F
Next article:Linear frequency modulation altimeter based on Xilinx FPGA and MCU structure

Latest Microcontroller Articles
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号