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
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.
Previous article:ATmega16 A/D related registers
Next article:Design and implementation of coal mine gas alarm wireless sensor network nodes
- Popular Resources
- Popular amplifiers
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- 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
MoreDaily News
- 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
Guess you like
- Introduction to the Internet of Things Protocol Coap Protocol
- Android Smart Wear Device Development Guide pdf download
- PIC16+CMT2300A, cannot receive data.
- [Erha Image Recognition Artificial Intelligence Vision Sensor] 2. Firmware Upgrade and Face Recognition Evaluation
- Won the grand prize
- [Project Source Code] FPGA-based 10-channel logic analyzer - 74 pages of excellent project tutorials
- Transformer coupled push-pull power amplifier circuit
- Hangzhou Dahua Hardware Engineer Interview Questions
- UWB Indoor Positioning Technology Solution
- iTOP-3399 development board Linux system compilation and burning - obtain/install/compile Linux source code