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
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Accelerometer and gyroscope
- Download of Siemens e-book "PCB Manufacturing Process - Optimization through Digital Transformation" has started~
- DP83822I Industrial Ethernet PHY auto-negotiation function and its strap resistor configuration
- 【DIY】Remodeling the mobile phone battery charger
- TMS320F28035 ECAN interrupt sending and receiving
- TI CCS compiler download update
- Simple and efficient zero-point acquisition circuit
- BMS solutions for electric bicycles and electric motorcycles under the new national standard for electric vehicles
- IIC communication problem between MSP430 and SHT11
- A Problem with TTL Inverter Circuit