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:
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
[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.
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
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Adafruit LED glasses running circuitpython
- Detect and harden against non-invasive tampering attacks
- How to implement backup uninterruptible power supply
- COVID-19 and other challenges to LED design and coping strategies
- purchase
- Shocked! One person made a company popular
- [Evaluation of EC-01F-Kit, the NB-IoT development board of Anxinke] + Try to connect the serial port assistant to Alibaba Cloud
- A brief list of long and short distance wireless communication technologies
- A classic foreign book about semaphores
- If there is a hidden function on the right side, the reading area will be larger.