The wireless universal remote control device with a frequency of 433MHz provides a very simple solution for short-distance wireless communication. It is an ideal solution for developing low-cost and low-power wireless communication systems. It is generally composed of a single-chip control circuit, an LCD display circuit, a wireless code sending circuit, etc. According to the number of nodes, it can be divided into single-node and multi-node modes. Single-node is also called point-to-point mode. It has a simple structure and a small size. It is easy to carry and is used to control the communication of a single household appliance; while multi-node is also called point-to-multi-node mode. It can be designed with different numbers of channels according to user requirements, and can also be easily expanded. It can control multiple household appliances at the same time and has complete functions. This system is designed with 16 channels. In the receiving part, multiple household appliances can be controlled according to the received information.
The structural principle and design of system hardware
1 System Introduction
Universal remote control devices are mainly composed of an on/off key, an LCD display, a set key, a confirmation key, a return key, a numeric keypad, etc. Its appearance is similar to that of a mobile phone. Its operation is also very simple. Take the remote control of an electric fan as an example. After turning on the remote control, first
The main menu is displayed, which is the name of various electrical appliances. Use the up and down keys to select the household appliance you want to operate. For example, select "Electric Fan" and press the confirm key to enter its submenu. Then select the item to be operated, such as the size of the wind speed gear, the direction of the fan, etc., and then press the confirm key to enter the next submenu to perform specific operations, such as adjusting the wind speed and wind direction, etc. The other household appliances are operated similarly.
The hardware circuit is composed of a 4-bit DIP switch circuit, a wireless transmission circuit, an ST20P18 microcontroller main control circuit, a keyboard scanning circuit, a liquid crystal (LCD) display circuit, etc.
2 Wireless code sending circuit
The single-chip microcomputer used is ST20P18, which is a low-power and low-cost 8-bit single-chip microcomputer manufactured by Taiwan Silicon Creation Company using CMOS technology. The chip has an oscillator, system timer, watchdog timer counter, LCD controller, 16Kb ROM and 192B RAM inside. The schematic diagram of the code sending circuit controlled by ST20P18 is shown in Figure 1. The basic principle of its code sending is: the system uses the code switch to control the setting of the address bit and data bit (binary) information, and then runs the code sending program through the single-chip microcomputer to encode and transform the address bit and data bit information into a series of pulse signals, which are finally transmitted by the wireless transmission circuit. The specific implementation is: the PB0 port of the single-chip microcomputer is the data output port and control port of the code sending circuit. When the code needs to be sent, the port is set as the output port, and then the correct data to be sent is output in the form of pulses according to the relevant communication protocol. Conversely, the PB0 port can be reused for other functions. The pulse data of the PB0 port is modulated by the code sending circuit and transmits 433MHz radio waves.
Figure 1 Wireless code sending circuit
The analog transmitter module circuit built with surface acoustic wave filter in the wireless transmitter circuit has an operating frequency of 433MHz and uses surface acoustic wave resonator SAW for frequency stabilization. The frequency stability is extremely high. When the ambient temperature changes between -25 and +85℃, the frequency drift is only 10-6/℃, which is particularly suitable for one-transmit-multiple-receive wireless remote control and data transmission systems. However, since the transmission of radio signals is affected by many factors, the general practical distance is only half of the standard ideal distance or even less. This needs to be noted during development. If a longer transmission distance is required, a first-level RF power amplifier can be added at the output end of the transmitter module.
After studying the circuit, the following conclusions were drawn:
● In order to obtain a stable and correct frequency, after repeated debugging, it was found that the radio wave frequency depends on R3. When R3=15kΩ, the transmitted radio frequency is 433MHz.
● Since the module is built with analog circuits, its performance is not as good as other types of digital RF chips, but its cost is quite low! Considering the size and cost factors and the short RF wavelength, a 50Ω 1/4 wavelength dipole microstrip printed circuit antenna is selected in the design, that is, a printed electrical conductor separated by a dielectric in the ground layer. Therefore, the shape and length of the antenna play a vital role in this circuit. Design practice shows that if the shape and length of the antenna do not meet the 50Ω 1/4 wavelength dipole antenna, the circuit will be unstable in transmission, and more seriously, it will directly lead to the circuit being unable to oscillate.
3 Keyboard scanning circuit
Since the I/O ports of ST20P18 are limited, the keyboard circuit is implemented by scanning. The implementation of this circuit is shown in Figure 2. The basic principle of its operation is: after the microcontroller is initialized, PA0 to PA5 and 6 I/O ports are set to input mode. Taking K1 as the research object, first set the PA0 port to a high level and the PA5 port to a low level. When the K1 button is pressed, PA0 jumps from a high level to a low level and generates an interrupt. The microcontroller responds to the interrupt and executes the interrupt service program. Similarly, the other 6 buttons also work in this way. The microcontroller scanning principle is from top to bottom and from left to right.
Figure 2 Keyboard scanning circuit
4 LCD display circuit
The ST20P18 microcontroller used in this design has a built-in control/drive LCD module in its core. The LCD (Figure 3) display module is an 8×40 dot matrix, which is often used for LCD display of remote control devices. The main control pins of the LCD display are COM0~COM7. This design only uses COM0~COM3.
Figure 3 LCD display circuit [page]
The display RAM of this module is divided into 4 blocks, each with 5 rows and 8 columns, so there are 4×5×8 bits in total. Each 8-dot column on the LCD screen corresponds to a column byte in the display RAM. When the block address and column address are set, a column byte in the display RAM is uniquely determined. The top bit in each column byte is the LSB, and the bottom bit is the MSB. Assigning a column byte of the display RAM is to control whether the corresponding pixel on the LCD screen is displayed. By writing the fonts of different characters into the display RAM bytes at different positions, the corresponding required characters can be displayed on the screen.
Software Design of Universal Remote Control
After powering on, the system will be initialized first, including the initialization of the MCU, LCD and other modules. For power saving, if no key is pressed within 40 seconds, the LCD controller of the MCU will enter the idle mode. Use the "for" loop to count, and set the initial value to zero. Then start the 40-second count. If a key is pressed during this period, the interrupt service program will be entered. If no key is pressed within 40 seconds, the LCD controller of the MCU will enter the idle mode. If a key is pressed during the idle mode, the MCU will be awakened and the interrupt service program will be executed. Since the LCD controller of the MCU is awakened by the interrupt and returns after executing the interrupt program, the MCU will continue to execute the next instruction of the instruction that sets the LCD controller of the MCU to the idle mode. Therefore, there is another loop to count after the instruction that sets the LCD controller of the MCU to the idle mode. Since the initial value of the count is reset to zero before the interrupt returns, the 5-second count will be restarted. If no key is pressed within 40 seconds, the LCD controller of the MCU will enter the idle mode again. The program flow chart is shown in Figure 4.
Figure 4 Software design process
Communication Protocol
1 Codeword format
The logic circuit that can realize the encoding function is called an encoder. Each remote control encoding chip has a specific encoding format. We take the time to transmit a binary number 0 or 1 as a time unit T, and the frequency of the encoding signal is F=1/T. The commonly used encoding format is used here. Each frame consists of a step code, an address code and a data code. The synchronization code is used at the beginning of a frame and is the identification mark of a frame. The width is 8T; the address code is 20 (A0-A19), the width is 20T; the data code is 4 bits (D0-D3), the width is 4T, and the total time occupied by a frame is 32T.
Corresponding to each state, a special code can be generated inside the encoding chip. This code is also composed of "1" and "0", but it does not simply use high level to represent "1" and low level to represent "0". Instead, it uses the difference in the width ratio of high level to low level to distinguish "1" and "0", which is the so-called duty cycle. In order to improve the reliability of this encoding transmission serial signal, this encoding uses a pulse with a duty cycle of 1/4 to represent 0, a pulse with a duty cycle of 3/4 to represent 1, and a pulse with a duty cycle of 1/32 to represent the synchronization signal, as shown in Figure 5.
[page]
Figure 5 Signal duty cycle
2 Protocol Design
Usually, the transmission of remote control signals is to modulate the control instructions and information codes (a sequence of 0s and 1s) corresponding to a certain button on a carrier in the range of 32 to 56 kHz, and then amplify and drive the wireless transmission circuit to transmit the signal.
As shown in Table 1, the functions of each part of the code are as follows: The guide code is used to inform the receiver that the following is remote control data. The address code is used to distinguish which model the data is for, and the receiving end uses this to determine whether the subsequent data is a command that must be executed by the machine. The information code is used to distinguish which key is pressed. The receiving end receives the data of the information code and makes a judgment on what action should be performed based on it. The information code also includes the continuous code sent when the key is pressed continuously. It tells the receiving end that a certain key is being pressed continuously. The end code is used to notify the receiver that a frame of data has been sent.
The key to the remote control data transmission system is the reliability of data transmission. In order to improve the reliability of coding, this protocol stipulates that an inverse code is transmitted after the address code for error checking. A parity bit is transmitted after each bit of information code and is also used for error checking.
Conclusion
The innovation of this design is that it proposes a design scheme for universal home appliance remote control equipment, which can control multiple home appliances according to actual requirements, achieve low power consumption in sleep mode, and has a lower cost than other similar products. After actual operation measurement, the wireless transmission system works stably, has strong penetration ability, and low power consumption (when in idle mode, the current in the circuit is less than 10μA), which can well realize the functions required by the corresponding design.
Previous article:Electric heater application scheme based on CW77P203 single chip microcomputer
Next article:Development of electronic ballast for metal halide lamp based on single chip microcomputer
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
- A new version of micro:bit (V2) will be released soon
- What is this error?
- Some Problems of PMOS as Anti-Reverse Connection Circuit
- Recruiting analog IC design engineers
- Does anyone know how to connect this refrigerator starter?
- IAR msp430 memory allocation keywords
- Where are my favorite articles? Where are the collectors?
- In addition to round and square, are there other shapes of NFC tags?
- 【GD32L233C-START Review】+Unboxing【1】
- Starting this year, does that mean April 1st is no longer a festival?