introduction
With the development of computer technology and telecommunications, remote communication through telephone lines has become more and more common. People usually use MODEM for communication, but in applications where the amount of communication data is not large and the communication rate is not high, we can consider a DTMF communication method, which has the characteristics of simple interface, low cost and high reliability. This article introduces a method for remote control of household appliances by telephone. Users can start, stop, and set up the household appliances installed in their homes through any dual-tone phone (including mobile phones and telephone extensions).
1. System structure
This system mainly includes a telephone ringing detection circuit, a telephone automatic on-hook circuit, a DTMF signal decoding circuit, a voice prompt circuit, and the CPU circuit that controls the entire system. When a call comes in, the phone ringing detection circuit detects ringing and waits for the system's default number of rings. The controller automatically picks up the phone and inputs the user's operating password and operating instructions in sequence at the prompts of the voice circuit. . The DTMF decoding circuit sends the received DTMF decoded digital signal to the CPU. If the incorrect password is entered more than 3 times, the system automatically hangs up the phone. After entering the normal remote control state, the CPU uses control commands to open the household appliance interface circuit. The structural block diagram of the entire system is shown in Figure 1.
2. Implementation method of telephone remote control part
The telephone remote control part is mainly composed of a telephone ringing detection circuit, an automatic on-hook circuit, a DTMF signal decoding circuit, a voice prompt circuit, a real-time clock circuit and a CPU. The CPU is the control core of the entire system. This system uses AT89C51, and all circuits complete various specified operations under its control. The design scheme of each unit circuit is introduced in detail below.
2.1 Ringing detection circuit design
When there is no ringing signal on the telephone line, the telephone line is provided with a DC voltage of approximately 48V by the telephone switch. When the user is called, the AC signal of about 70V sent by the telephone switch is corrected by the polarity of the full-bridge BRIDGE1, and then stepped down using a high-voltage Zener diode, and then input to the input end of the optocoupler 4N35, and the output pulse square wave The signal is then amplified and reshaped before being sent to the T0 end of the AT89C51. The CPU counts the ringing signals and completes the entire ringing tone detection and counting process.
2.2 DTMF decoding circuit design
The DTMF signal sent by the remote user through the phone button is DC blocked and filtered by the coupling capacitor, and then received and hardware decoded by the MT8870. The output four-bit binary data is directly connected to the P1.0~P1.3 port of the AT89C51 microcontroller. When MT8870 receives a valid DTMF signal and decodes the correct BCD data, it will set the STD terminal to high level and notify the CPU to take the data. The CPU reads the data from the P1 port, removes the high four bits, and saves the data in the internal R7 register unit, and judges the read value to obtain the input command from the remote controller.
2.3 Real-time clock circuit design
DS12887 is a real-time clock chip produced by DALLAS. In addition to the real-time clock function, it also has 114 bytes of general-purpose RAM and a built-in lithium battery. In this system, the clever application of DS12887 realizes the following functions: (1) Multi-function calendar and clock. (2) Save the switch status of various household appliances during power outage. (3) Save the system password, and the password can be changed online. (4) Combined with software to implement watchdog, it enhances the reliability and stability of the system.
AT89C51 is an INTEL series bus, so the MOT pin of DS12887 is connected to ground, and AS, DS, and RW are connected to the AT89C51 ALE, RD, and WR pins respectively. In order to save I/O port lines as much as possible, the MOVX A, @DPTR instructions are not used to read and write the DS12887, but P3.5 is used as the chip select signal. All the reading and writing of the DS12887 are completed using MOVX A, @R0. This can make full use of the CPU's P2 port to avoid affecting the electrical status during reading and writing.
2.4 Voice prompt circuit design
Telephone remote control systems use voice prompt circuits to communicate between users and the system. The voice prompt circuit stores several segments of system prompt tones in advance. After the AT89C51 central processing unit circuit determines the DTMF signal sent by the user, it addresses the voice prompt circuit and plays the corresponding prompt tones, thereby feeding back information to the user to prompt what to do next.
The voice storage of this system uses the ISD2590 chip from the American ISD Company. This chip has the advantages of resistance to power outages, good sound quality, and easy use. There are 10 address input terminals, and the addressing capability can reach 1024 bits; it can be divided into up to 600 segments; it is equipped with an OVF (overflow) terminal to facilitate the cascading of multiple devices. The interface circuit with the CPU is shown in Figure 4.
When the highest address bits A8 (pin 9) and A9 (pin 10) of ISD2590 are set to high level, the chip enters the operating mode state. The operation mode is divided into 6 different modes according to the different combinations of high and low levels of pins A1 to A8 to achieve different functions.
In order to save I/O lines as much as possible, a combination of M1 and M6 is used to operate the ISD2590. The required voice is recorded into the chip from the microphone segment by segment through the start/pause button. Just remember the serial number of each segment. .
How to use the information retrieval mode of ISD2590: First, set the recording and playback control P/R terminal of the chip high, and set the address bits A4 and A0 high. Now the chip is in the information reading state of the information retrieval mode. To play the Nth segment of voice, first give the PD end a high-level pulse to reset the address pointer to 0. Because all sequence numbers are based on the beginning of the memory, except for the first segment, the CE end only needs to send N-1 low pulses of no more than 10us to make the address pointer reach the beginning of the Nth segment, and then pull it high A0, add a low pulse to the CE end to play the Nth segment of voice information until the EOM mark after this segment appears.
It can be seen that the key to accurate retrieval is to correctly detect the EOM end mark of each segment. Because in the fast forward state, the width of the EOM pulse is only about 10us, which is difficult to detect for microcontrollers with low speed. At this time, an external interrupt can be used to detect the EOM flag.
3. Software design
How to use the limited 16 kinds of DTMF signals to realize various system control functions is the key to the success of the system. With the help of software programming, the system can interpret any combination of the 16 kinds of DTMF signals, thus enriching the system functions. The main functions of the system software are as follows:
(1) System identity authentication function In order to ensure that only legitimate users can operate the system, after the telephone remote control system is online, the user must enter a password, and only after the system has confirmed it will have the authority to operate the system.
(2) The user signaling interpretation function interprets the received user signals according to the software settings, decides to address the voice prompt circuit, plays the corresponding system prompt tone, and realizes the interactive operation between the user and the telephone remote control system. , or send corresponding driving signals to external controlled devices.
(3) Software timing function The system software sets the software timer for automatic system reset. The setting value of the timer specifies the maximum time for the system to be online at one time. If a work timeout occurs, the system automatically goes offline and enters standby mode.
4. Conclusion
The smart phone remote control system can be used to remotely control air conditioners, lights, rice cookers and other household appliances via landline and mobile phones. For example, the air conditioner in the room can be turned on in advance and enjoy a cool world as soon as the user enters the house; the user is traveling or on a business trip At this time, the system can turn on and off the lights and TV in the room to create the illusion that someone is at home and improve home safety. This system can be extended to remote communication situations where the data communication volume is not large and the speed requirements are not high. It can be used in automatic anti-theft alarm devices, public telephone centralized management systems and remote distributed data collection systems to achieve remote control of unattended posts. The system software and hardware implementation technology has the advantages of simple interface circuit, high reliability, low cost, and strong flexibility.
Previous article:Implementing the transplantation of μC/OS-II on the development board based on the C8051F015 chip
Next article:Design of intelligent humidity monitoring system using AT89C51 microcontroller and SHT15 sensor
- 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
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Three steps to govern hybrid multicloud environments
- Three steps to govern hybrid multicloud environments
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Interface corresponding to SNVS_TAMPER3 signal
- Looking for a good and available domestic accelerometer
- nRF52832-QFAA Hardware Reference Design
- How to design the MCU+8266 program structure
- 【RPi PICO】Snapshot of the RP2040 chip
- Why does TIM1_CH3N not output PWM after configuring PWM in STM32F103C8T6?
- Please advise on the PinMux code
- Can you recommend a chip that can boost 3.3V to 5V?
- How to quickly gain points?
- [National Technology N32G457 Review] RT_Thread solves the problem that SPI NSS cannot be pulled low