Design of remote control alarm system based on single chip microcomputer

Publisher:EternalBlissLatest update time:2012-03-14 Source: 现代电子技术 Keywords:AT89C51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction
Due to the rapid development of the economy, people's living standards have been greatly improved, and the pace of life has become faster and faster. Therefore, home appliance remote control and family safety are also needed and valued by people. The remote control and alarm device of electrical appliances through telephone with AT89C51 single-chip microcomputer as the core mainly solves these problems. Its main functions are: 16 electrical appliances can be remotely controlled through telephone, and the number of remote control channels can be expanded as needed; it can realize electrical appliance voltage and speed control, with password setting, good confidentiality and security; there are language prompts to avoid blind operation; the input operation command can be canceled; when the single-chip microcomputer receives the signal of natural gas leakage, temperature exceeding the limit and theft at home, it will automatically call the reserved phone and report the situation at home.

2 Hardware Circuit Design
The overall circuit design idea is: the telephone remote alarm is connected in parallel with the home phone. When there is a ringing signal, the single-chip computer starts counting. If someone answers the phone within the first 10 rings, the remote alarm is shielded and does not affect the normal answering of the phone. If no one answers the phone after 10 rings, the remote alarm automatically simulates hanging up and issues a prompt tone to ask the user to enter the password. 3 input errors are allowed, and there are 2 prompts for input errors to re-enter. If the third input error is made, it will automatically hang up. After the password input is confirmed to be correct, a prompt tone is issued to prompt the user to enter the appliance code for the task to be executed. The code is a 3-digit number plus a "#" character for confirmation. The first 2 digits are the appliance code, ranging from 1 to 16 (assuming that there are 16 controlled appliances), and the third digit is the level of voltage and speed regulation, ranging from 1 to 4 (the number of gears is determined as needed). If the appliance has no voltage and speed regulation, the third digit is invalid. If the number of times the same task is entered is an even number, it means that the task is canceled. If the time interval between two key presses is less than 100 ms, the second key input is invalid to prevent jitter. If there is no key input within 10 s after the previous key press, it is assumed that there is no task input and the phone is automatically hung up. After hanging up, the microcontroller sends the input task to the corresponding output port to execute the task and maintains the state until a new task is input.
The hardware circuit mainly includes a ring detection circuit, an analog off-hook and DTMF demodulation circuit, a speed control circuit, a task execution circuit, a 3-way sensor alarm signal circuit, and a voice circuit. The hardware circuit block diagram is shown in Figure 1.
2.1 Ring detection circuit
The circuit is shown in Figure 2. The telephone line ring signal is 25 Hz, 75~100 V. Therefore, it cannot be directly connected to the IC circuit. At the same time, in order to prevent lightning strikes, the input end is isolated with a 1μF/160 V capacitor. The ringing sound is rectified by the full bridge, coupled by the photocoupler 4N25 and shaped by 40106 before being sent to the 89C51 T0 counter to count the number of ringing times. When T0 counts to 10 times, it is agreed that there is a task input. The 89C51 outputs an analog off-hook signal to connect the line. At the same time, the microcontroller controls the voice prompt circuit to send it to the dual-audio DTMF decoding circuit.

2.2 Dual audio decoding DTMF circuit
The DTMF circuit uses the typical MF8870 chip as a dual audio decoding circuit. When the single-chip microcomputer sends an analog off-hook signal to connect the line, enter the password after the prompt tone, such as MF8870. After confirming that there is a signal input, the CIO terminal (pin 15) is "1", the output latch is updated, and the input dual audio signal is decoded into a 4-bit binary number and sent to the output latch D1~D4 terminals. The CIO terminal level is sent to the EN terminal (pin 10) to allow output. The single-chip microcomputer first checks the password, and then sends the task signal sent by MF8870 to the RAM for storage until the input task is completed.
2.3 Voice prompt and dialing circuit
The voice prompt circuit uses the American ISD company voice chip ISD25120, which can record and play 120 s. Due to the use of the patented "direct analog storage" (DAST) technology, the signal does not need to go through D/A, A/D conversion and other processing processes, with low distortion and good sound quality. The chip contains an oscillator, microphone preamplifier, automatic gain control, anti-aliasing filter, smoothing filter, speaker driver and E2PROM display. The peripheral circuit is simple, small in size, powered by a single 3 V power supply, low power consumption, and the maintenance current is only 1μA.
This chip only plays pre-recorded sentences, so the circuit only uses the playback function. The recording/playback mode P/R is connected to a high level, and the power saving mode is working grounding. The clock uses an external clock, and the ISD25120 external clock frequency f = 512 kHz. ISD25120 has a total of 10 address lines, which can achieve an information resolution of 200 ms. However, since we only need to find the starting address of each recording, we can reduce the resolution and use it. Here, A3~A0 is grounded. A9 and A8 determine the meaning of A7~A0. When one of A9 and A8 is "0", A7~A0 indicates the starting address of the current recording and playback operation. When one of A9 and A8 is not "0", A7~A0 indicates different operation modes. Here, A9 and A8 are grounded, indicating that A7~A0 is the address number. When playback is required, 89C51 makes the chip select terminal CE of ISD25120 = "0" and gives the address number of A7~A0 at the same time, which is latched on the falling edge of CE. The specific settings of A9~A0 are as follows:


In this way, the maximum addressable number of the four address lines A7 to A4 is 16, and the length of each time segment can be determined by the designer according to the needs. The relationship between the start time of the recording segment and the start address number of this segment is as follows:
time = the start address number of a segment (decimal) × resolution
Different chips have different resolutions, and you can refer to the relevant manual for details. The resolution of ISD25120 is 200 ms, and the 1st to 7th segments of this device are 6 s. Enter the relevant prompts. The 8th segment is a reserved phone number, the 9th to 11th segments are 15 s, which are used for dialing alarms, and the 12th to 16th segments are 27 s for standby. The voice prompt and dialing circuit diagram is shown in Figure 3. [page]

When 89C51 receives the signal from the natural gas, temperature and theft alarm, it uses the dual audio telephone number and alarm voice pre-recorded in the ISD25120 voice chip to broadcast the alarm. Since the DTMF dual-tone multi-frequency digital signal and the voice signal frequency range transmitted by the ISD voice chip in the telephone and wireless network are the same, this solution is feasible. However, the following issues should be noted: the nominal error of the Bell telephone DTMF signal is ±1.5%. When the telephone crystal is 3.579 45 MHz, the generated tone error range is +0.74% to -0.54%. However, the internal oscillator of most ISD devices has an error of 2.25% over the full voltage and temperature range, that is, the error of the ISD device is greater than the DTMF standard error, as shown in Figure 4. Therefore, the internal oscillator of the ISD cannot be used, and an external crystal oscillator input signal must be used. As can be seen from Figure 4, in the worst recording and playback situation, the external clock provided to the ISD device requires an error of less than 0.75%, which can be TTL or CMOS level. For the ISD25120 sampling rate of 4 kHz, the clock frequency provided is 512 kHz, the microcontroller is a 626 MHz crystal, the operating frequency is 1 MHz, and the frequency provided to the ISD25120 by the external two-way frequency division circuit is 5 kHz, which is very close to the required 512 kHz and will not cause any problems in use. Here, the frequency change error is required to be small, but a very accurate frequency value is not required.

2.4 Electrical control circuit
After the task is input, it is first stored in the memory. When the task input is completed, the software first deletes the task item with an even number of inputs, and then sends the task to the corresponding port line. If the port lines of the single-chip microcomputer are sufficient, the port lines can be directly sent to the external circuit for execution, and the software only needs to invert the state of the task port line. If the port lines of the single chip are not sufficient, the CD4514 chip can be added to expand the 4-16 line decoding, but each channel needs to be maintained by a bistable circuit and current amplification. The execution device generally uses a relay. The contact capacity of the relay should be determined according to the power size of the electrical appliance, and a certain margin should be left.
2.5 Speed ​​regulation and
voltage regulation circuit The execution device of the speed regulation and voltage regulation circuit uses a bidirectional thyristor. The single-chip microcomputer sends different pulse numbers according to the task, so the BT33 relaxation oscillator has different charge and discharge times, which makes the bidirectional thyristor conduction angle different and the output voltage different.

3 Software design
Based on the above analysis, the main flow chart of the software is shown in Figure 5.
In addition to the main program, the subprograms include a 6-digit password verification subprogram, a (3-digit + #) task input verification subprogram, a prompt tone subprogram, an alarm subprogram, a task exclusion even input subprogram, a subprogram for distinguishing the other party's ringback tone and busy tone, and a 10 ms, 10 s, 60 s delay subprogram. When writing the program, please note that when the second key press time is less than 10 ms, the second key press is invalid to prevent jitter. When there is no key input signal for 10 consecutive seconds after the last key press, it is automatically hung up by default.
The difference between the other party's ringback tone and busy tone after alarm dialing: According to regulations, the ringback tone is a 1 s high level and 4 s low level square wave signal, and the busy tone is a 0.35 s square wave signal for both the high level and the low level. The call time of the ringback tone and the busy tone is 60 s, and the phone automatically hangs up after 60 s. When an alarm signal is sent to the single-chip microcomputer, the software simulates picking up the phone, and after reserving the telephone dialing output, when the first ringback tone or busy tone is received, the timer starts timing, and the counter starts counting the number of input ringback tones or busy tones. Then it is judged within 60 seconds. If the count value is greater than 15 pulses (regardless of whether the 60 seconds timing is reached), it means that the other party is busy, and you should hang up and redial the call after a delay of 60 seconds. If the count is less than 14 pulses within 60 seconds, it means it is a ringback tone. If the ringback tone is interrupted in the middle of less than 12 pulses, it means that someone on the other side is answering the call, and the alarm voice corresponding to the alarm signal can be played. If there is a ringback tone within 60 seconds and the timing is reached, it means that no one on the other side is answering the call, so hang up and delay and redial until the telephone alarm is completed.

4 Conclusion
This device is a very useful technology in modern families. For families equipped with wireless control devices, it is only necessary to change the task execution part to wireless remote control transmission. With the development of videophones, installing a miniature camera can also allow you to see the situation at home at a glance when you are away on business.


References

[1]ISD Company. ISD data book:Voice record and play back ICS.[S].
[2]Li Lingqi, Hu Guangcheng. Principle and maintenance of telephone[M]. Beijing: People's Posts and Telecommunications Press, 1993.
[3]Wang Furui. Design of single chip microcomputer measurement and control system[M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 1999.
Keywords:AT89C51 Reference address:Design of remote control alarm system based on single chip microcomputer

Previous article:Knob-type keyboard and its interface technology with AT89C52
Next article:Single chip microcomputer control of urban pipeline precise positioning system based on GPS

Recommended ReadingLatest update time:2024-11-16 16:19

Design of MPX4115 pressure automatic detection system
MPX4115 pressure sensor AT89c51 MCU LED common anode display     MCU Minimum System Display Module Connection between AD0832 and MCU Connection between sensor and AD The microcontroller source program is as follows: #include reg51.h #include intrins.h //ADC0832 pins sbit ADCS=P
[Microcontroller]
Design of MPX4115 pressure automatic detection system
Application Analysis of System Clock Interrupt of AT89C51 Microcontroller with 6MHz Clock
  This article takes the AT89C51 system with a 6MHz clock as an example to illustrate the application of clock interrupts:   Timer initial value and interrupt cycle The clock interrupt does not need to be too frequent, generally 20mS (50Hz) is sufficient. If a time base signal of one hundredth of a second is required,
[Microcontroller]
How to use AT89C51 microcontroller to control the circuit design of LED display screen
LED display screens are widely used in industrial and mining enterprises, schools, shopping malls, shops, public places, etc. for graphic display, advertising, and information release. This paper designs a display screen composed of 4 16×16 dot matrix LED modules, with a single-chip microcomputer as the controller, wh
[Microcontroller]
How to use AT89C51 microcontroller to control the circuit design of LED display screen
Design and research of humidity detection system based on AT89C51
0 Introduction The artificial climate chamber is a widely used experimental equipment in the fields of environmental testing, scientific research (such as breeding, plant protection, tissue culture, bioengineering), etc. It can simulate various meteorological conditions in nature, accurately control the tem
[Microcontroller]
Using AT89C51 single chip microcomputer to control shearing machine
  This article introduces a precision shearing machine that uses AC contactors, intermediate relays, travel switches, and foot switches to control the shearing of the shearing machine. During production and use, due to the high shearing frequency (about 30 cuts per minute), the shearing machine is often operated in th
[Microcontroller]
Using AT89C51 single chip microcomputer to control shearing machine
Design of wireless ward call system based on AT89C51 single chip microcomputer
As a basic medical care equipment, the ward call system has gradually become popular and has been continuously improved. The traditional ward call system uses PC network monitoring and wired control. Although it has strong professional service functions and monitoring capabilities, its implementation method is complic
[Microcontroller]
Design of wireless ward call system based on AT89C51 single chip microcomputer
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号