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.
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
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.
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.
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.
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.
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
Previous article:The data acquisition and control system composed of C8051F
Next article:Linear frequency modulation altimeter based on Xilinx FPGA and MCU structure
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- USB Type-C® and USB Power Delivery: Designed for extended power range and battery-powered systems
- RAQ #223: How to measure and determine soft-start timing without a soft-start equation?
- RAQ #223: How to measure and determine soft-start timing without a soft-start equation?
- GigaDevice's full range of automotive-grade SPI NOR Flash GD25/55 wins ISO 26262 ASIL D functional safety certification
- GigaDevice's full range of automotive-grade SPI NOR Flash GD25/55 wins ISO 26262 ASIL D functional safety certification
- New IsoVu™ Isolated Current Probes: Bringing a New Dimension to Current Measurements
- New IsoVu™ Isolated Current Probes: Bringing a New Dimension to Current Measurements
- Infineon Technologies Launches ModusToolbox™ Motor Kit to Simplify Motor Control Development
- Infineon Technologies Launches ModusToolbox™ Motor Kit to Simplify Motor Control Development
- STMicroelectronics IO-Link Actuator Board Brings Turnkey Reference Design to Industrial Monitoring and Equipment Manufacturers
- [NXP Rapid IoT Review] Power on (finally received the goods)
- What are the pseudo instructions for PIC series microcontrollers?
- [XMC4800 Relax EtherCAT Kit Review] + Getting Started with DAVE, XMC4800 EtherCAT Slave Module Example Analysis
- Six-function multi-mode time controller
- 555 classic circuit diagram: dual tone generator circuit diagram
- Implementation of Automobile Instrument Software Based on CAN Bus
- Several C language algorithms commonly used in single chip microcomputers
- Analog Circuits in One Day 1.0
- Cypress PSoC devices can be dynamically reconfigured and are popular in automotive and other fields
- Xinchao Electronics--4-digit LED frequency meter