Design of remote control of household appliances by telephone based on AT89C51 microcontroller and DTMF communication

Publisher:Serendipity66Latest update time:2023-08-02 Source: elecfansKeywords:AT89C51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Design of remote control of household appliances by telephone based on AT89C51 microcontroller and DTMF communication

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.


Keywords:AT89C51 Reference address:Design of remote control of household appliances by telephone based on AT89C51 microcontroller and DTMF communication

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

Latest Microcontroller Articles
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号