The principle and design of an intelligent infrared remote control switch

Publisher:cyzceeLatest update time:2015-10-15 Source: eechina Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Infrared remote control is one of the most widely used communication and control means at present. It is widely used in household appliances, industrial control and intelligent instrument systems due to its simple structure, small size, low power consumption, strong anti-interference ability, high reliability and low cost. However, most of the remote controls on the market are designed for their specific remote control objects and cannot be directly applied to the development of general intelligent instruments and their more general control occasions. Usually, household appliances such as televisions, air conditioners, VCD/DVDs used in ordinary households all use infrared remote controls, and these infrared remote controls are designed for their respective products, resulting in several remote controls in ordinary households. Therefore, it is very necessary to reuse the functions of these remote controls to reduce the number of remote controls and make the functions of remote controls more powerful.

Power switches are widely used in homes, factories, warehouses, offices and other places. Traditional mechanical power switches have the disadvantages of large contact resistance, easy wear, low reliability and short life. Especially when there are many remote controls for household appliances, if switches can be designed with the help of these remote controls to replace traditional mechanical power switches, it will not only save costs but also be easy to operate. Using the remote control of household appliances such as televisions to achieve switch operation is very convenient to install and replace. It can be used to replace the very popular wall switches in the home, thereby improving the practical value of remote controls in the field of home appliances.

1 Working Principle

The intelligent infrared remote control switch is mainly composed of infrared receiving, amplification and shaping, microcontroller, switch control and step-down power supply modules. Its principle block diagram is shown in Figure 1.






The function of the intelligent infrared remote control switch is to use the remote control of common household appliances, such as televisions, VCD/DVD, etc., and the user can arbitrarily specify a button as the control key of this infrared remote control switch. When using it, the user presses the "learning" button of the intelligent infrared remote control switch, and then presses the designated switch control button on the remote control by aiming at the infrared receiving head of the remote control switch. The infrared coded signal emitted by the remote control is received by the infrared receiving head, and then amplified and shaped, and input into the microcontroller. The microcontroller remembers the code of the designated button of the remote control through the built-in E2PROM. Then, the next time the user uses it, when the designated button of the remote control is pressed, the infrared code signal sent by it will also pass through the infrared receiving head, amplify and shape it, and then input it into the microcontroller. The microcontroller sends a control signal to control the conduction and disconnection of the relay in the switch control module, and then control the on and off of the output voltage.

In order to ensure the remote control of various electrical appliances, the control signal must be stable and safe. To this end, the communication signal between each module must be strong enough during the transmission process, which requires the power supply of the circuit to independently supply power to each part of the circuit. Therefore, the infrared remote control switch must also have a step-down power supply module.

2 Circuit Design

The hardware circuit design includes two parts: the design of the power supply circuit and the design of the decoding circuit. The power supply circuit is designed to provide power for the decoding circuit. In addition to requiring stable voltage, it is also required to be small in size and low in cost. The decoding circuit requires reliable reception of infrared codes and stable control of the switch of the relay.

2.1 Power Supply Design

Considering that the power consumption of the decoding circuit is very small, the power supply design adopts a capacitor step-down power supply. It is much simpler than the design of transformer power supply and switching power supply, and it is small in size and low in cost, making it suitable as the power supply of the remote control switch. The schematic diagram of the power supply design is shown in Figure 2. MC2 is a step-down capacitor, D1 is a half-wave rectifier diode, D2 provides a discharge circuit for MC2 during the negative half cycle of the mains, ZD1 is a 5.1 V voltage regulator diode, and R1 is the charge discharge resistor of MC2 after the power supply is turned off. The





capacitor step-down power supply uses the capacitive reactance generated by the capacitor under a certain AC signal frequency to limit the maximum working current. When the AC voltage is 220 V and the frequency is 50 Hz, the capacitive reactance Xc (unit: Ω) of the capacitor MC2 in the circuit is:







The charging current Ic (unit: mA) flowing through the capacitor MC2 is:







The current Io provided to the load through the step-down capacitor MC2 is actually the charge and discharge current IC flowing through MC2. Obviously, the larger the capacity of the capacitor MC2, the smaller the capacitive reactance Xc, and the larger the charge and discharge current flowing through MC2. When the load current Io is less than the charge and discharge current of MC2, the excess current will flow through the voltage regulator. If the maximum allowable current Idmax of the voltage regulator is less than IC-Io, it is easy to cause the voltage regulator to burn out.

Although the current IC flowing through capacitor MC2 is 69.08 mA, almost no power consumption is generated on the capacitor. This is because for an ideal capacitor, the current flowing through the capacitor is the imaginary current, and the work it does is reactive power. It can be seen that the efficiency of the capacitor step-down power supply is also very high. After experimental testing, the power supply circuit outputs a DC voltage of 4.88 V after power is turned on, and the AC voltage component is less than 3 mV. When the output current is 50 mA, the voltage is not less than 4.7 V, which can meet the power supply requirements of the decoding circuit.

2.2 Decoding circuit design

The hardware core of the intelligent infrared remote control switch is the microcontroller and the infrared receiving part, and its schematic diagram is shown in Figure 3.





The microcontroller in the infrared decoding circuit uses the ATmega8L AVR microcontroller. Its operating voltage is 2.7-5.5 V, and its power consumption at 4 MHz (3 V, 25°C) is 3.6 mA in working mode, 1.0 mA in idle mode, and only 0.5 μA in power-down mode. It adopts advanced RISC structure. In addition to 8 KB of in-system programmable FLASH memory, it also has 512 B of E2PROM, which can be used to memorize various infrared coded signals emitted by various remote controllers. [page]

The infrared receiving circuit uses an integrated infrared receiver product, which realizes the functions of infrared receiving, amplification, and shaping at the same time. Generally, it can complete all the work from infrared receiving to outputting TTL level compatible signals without any external components. The receiver has only 3 pins to the outside: power supply Vcc, common ground GND and 1 pulse signal output OUT. As can be seen from Figure 3, it is very convenient to interface with the single-chip microcomputer.

When the "memory" button S1 is pressed, the infrared receiving head SPH starts to record the signal emitted by the remote control, and at the same time saves the received signal in the E2PROM of the single-chip microcomputer ATmega8L. When the remote control sends out the same infrared pulse signal in the future, it will be received by the infrared receiving head and compared with the data in the E2PROM. If they are consistent, a control signal will be sent to control the switch on and off.

3 Program Design

The code demodulated by the infrared remote control receiving head is a serial binary code, which contains the remote control key information. However, it is not convenient for the CPU to read and identify it, so these serial binary codes need to be decoded first. This design uses software decoding to decode the received infrared signal.

3.1 Introduction to infrared remote control transmission coding

The principles of various infrared remote control systems currently in use are similar, and the only difference is that the signal coding format of each system is different. The format of the pulse code generated by the remote control is generally:







Among them, the guide pulse is a combination of a high pulse and a low pulse with a width of about 10 ms, which is used to identify the beginning of the command code. The identification code, key code, and the inverse code of the key code are all data encoding pulses, represented by binary numbers. "O" and "1" are both represented by a combination of high and low pulses in the millisecond range. The identification code (i.e., user code) is the identification of each remote control system. When the command key is pressed, the command signal generating circuit generates a pulse code. The key code is usually followed by a key code check code to verify the correctness of the key code received, prevent misoperation, and enhance the reliability of the system.

3.2 Storage Encoding Program Design

When the "Memory" button S1 is pressed, the microcontroller enters the state of storing and memorizing the infrared remote control code. The ATmega8L microcontroller first turns off the interrupt and waits for the infrared remote control code input from the remote control. When the infrared remote control code is input, the microcontroller saves it to the E2PROM. In this way, even after power failure, the information stored in the E2PROM by the microcontroller will not be lost, which can ensure normal use after power failure. The flow chart of the encoding program for storing infrared signals is shown in Figure 4. 





3.3 Software decoding program design

The software decoding consists of the external interrupt, timer and software of the ATmega8L microcontroller to form an infrared remote control receiving system. The timer is used to delay the measurement of the interval between two pulse trains. The external interrupt is used to trigger the timer to receive data when an infrared pulse signal is received. When the infrared receiving tube receives an infrared pulse, the program first triggers an external interrupt, and the timer is started by the external interrupt. The sample is taken once every time interval, and the sampled infrared pulse code is saved in the RAM variable, and then compared with the code saved in the storage code program. When the two are the same, it is considered that the switch button is pressed and the corresponding switch operation is performed, otherwise the program does not perform the switch operation. The flowchart of the software decoding program is shown in Figure 5.

4 Conclusion

Current household appliances, such as televisions, VCDs, DVDs, and amplifiers, are generally equipped with remote controls and intelligent control technology, which brings great convenience to people's use. The control of small household appliances such as lights is also developing towards automation and intelligent operation, so as to meet people's life needs. The intelligent infrared remote control switch makes full use of the numerous remote controls of household appliances now, realizes the function reuse of the remote control, and in the software decoding infrared remote control system, the core of the decoding is the CPU, the circuit is extremely simple and does not require peripheral devices, the size is small, and the anti-interference ability is strong. After multiple experimental tests, the switch can replace the original wall switch without adding wiring, which provides convenience for installation and use. Replacing the original mechanical wall with this remote control switch is not only practical, but also safe and economical.
Reference address:The principle and design of an intelligent infrared remote control switch

Previous article:ATmega16 A/D related registers
Next article:Design and implementation of coal mine gas alarm wireless sensor network nodes

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号