Abstract: This paper proposes a design method for a radio frequency wireless remote control with multiple data transmission capabilities, taking a health bed remote control as an example. This remote control uses the AT89S52 microcontroller as its core processor, along with a wireless transmitter/receiver module and encoding/decoding chips (PT2262/PT2272), to achieve wireless remote control. Experimental verification shows that the data transmission of this remote control is secure and reliable, and it can be applied to remote control systems with multiple data transmission capabilities.
0 Introduction
With social development and continuous advancements in science and technology, wireless remote controls have become widely used in people's daily lives. This paper studies a radio frequency wireless remote control used in conjunction with a health care bed. The health care bed utilizes electronic heating and temperature control technology, taking advantage of the various elements released by heated jade to form a natural magnetic field, resulting in a new generation of health products. Currently, most health care bed controllers on the market are motherboard-based and do not come with a matching remote control.
This paper takes a health care bed remote control as an example and develops a radio frequency wireless remote control system based on the AT89S52 microcontroller with multi-data transmission. It achieves wireless communication through a wireless transmitter/receiver module and an encoder/decoder chip to control the temperature of the health care bed. This system is convenient, flexible, safe, and reliable to use.
1 System Overall Structure Design
There are two common wireless remote control modes: infrared remote control, commonly used in home appliances, and radio frequency (RF) wireless remote control, commonly used in burglar alarms, car remotes, and other applications. Each has its own advantages and is applied in different areas. To increase the flexibility of this system while ensuring it doesn't interfere with other remote-controlled appliances, this system uses the RF wireless remote control mode.
This system achieves temperature control of the target motherboard through radio frequency wireless transmission. The "ON/OFF" button controls the remote control to turn on and off; the "+" and "-" buttons respectively set the temperature to increase or decrease. The set temperature is saved in real time to the EEPROM AT24C02 and will not be lost when power is off. After setting, the microcontroller will display the set temperature on the segment LCD and transmit the set temperature value to the motherboard controller through radio frequency wireless transmission. The motherboard controller controls the heating output according to the difference between the actual temperature and the set temperature to achieve a constant temperature effect. The radio frequency wireless temperature remote control is an important component of the health bed controller and has the advantages of small size, low cost, long transmission distance and convenient use [1].
This system uses the AT89S52 microcontroller as its core processor and a wireless transmitter/receiver module in conjunction with a wireless encoder/decoder chip (PT2262/PT2272) for wireless communication, enhancing the anti-interference capability of the wireless communication. The transmitter circuit structure diagram of this system is shown in Figure 1.
The receiver circuit structure diagram is shown in Figure 2:
2 System Hardware Design
2.1 Encoding/Decoding Chips PT2262/PT2272
The PT2262/2272 is a low-power, low-cost general-purpose codec chip manufactured using CMOS technology. The PT2262/2272 can have up to 12 tri-state address pins (A0-A11) (floating, high, low), providing 531,441 possible address codes in any combination. The PT2262 can have up to 6 data pins (D0-D5). The set address and data codes are serially output from pin 17 and can be used in wireless remote control transmitter circuits.
The PT2262's appearance and pinout are shown in Figure 3:
The pinout of the PT2262 is shown in Table 1:
Table 1 PT2262 Pin Description
Tab.1 PT2262 Pin Description
name | pin | illustrate |
A0~A11 | 1-8, 10-13 | The address pin is used for address encoding and can be set to 0, 1, or f (floating). |
D0~D5 | 7-8, 10-13 | At the data input terminal, if one input is "1", an encoding is emitted; internal pull-down... |
Vcc | 18 | Positive power supply terminal (+) |
Vss | 9 | Negative terminal of power supply (-) |
TE | 14 | Encoding start pin, used for encoding and transmitting multiple data streams, active low. |
OSC1 | 16 | The oscillation frequency is determined by the resistor connected to the oscillation resistor input terminal and OSC2. |
OSC2 | 15 | Oscillator output terminal |
Dout | 17 | Encoder output (normally low level) |
The encoding signal of the PT2262 encoding chip is a complete codeword composed of address code, data code and synchronization code. It is output from pin 17 to the data input terminal of the RF transmitter module and then transmitted through the output terminal of the RF transmitter module. After the RF receiver module receives the signal, it sends the received signal to the decoding chip PT2272. After the address code is compared and verified three times, the VT pin of PT2272 outputs a high level. At the same time, the data pin corresponding to PT2262 also outputs the same level. If PT2262 continuously sends the encoding signal, pin 17 of PT2272 will continuously output a high level. When PT2262 stops sending the encoding signal, the VT terminal of PT2272 returns to the low level state [2].
The PT2272's appearance and pinout are shown in Figure 4:
The pinout of PT2272 is shown in Table 2:
Table 2 PT2272 Pin Description
Tab.2 PT2272 Pin Description
name | pin | illustrate |
A0~A11 | 1-8, 10-13 | The address pin is used for address encoding and can be set to 0, 1, or f (floating). It must be consistent with the 2262; otherwise, it will not be decoded. |
D0~D5 | 7-8, 10-13 | When used as a data pin, the address or data pin will only output a high level corresponding to the 2262's data input if the address code matches the 2262's address code. Otherwise, it will output a low level. For latch-type connections, the pin will only switch modes upon receiving the next data input. |
Vcc | 18 | Positive power supply terminal (+) |
Vss | 9 | Negative terminal of power supply (-) |
DIN | 14 | Data signal input terminal, from the output terminal of the receiving module. |
OSC1 | 16 | The oscillation frequency is determined by the resistor connected to the oscillation resistor input terminal and OSC2. |
OSC2 | 15 | Oscillator output terminal |
VT | 17 | The output terminal is normally low upon successful decoding; it then goes high (transient) upon successful decoding. |
The decoding chip PT2272 uses different suffixes to represent different functions, namely L4/M4/L6/M6. L indicates latched output, and the data will always maintain the corresponding level state as long as it is successfully received, and will change when the remote control data changes next time. M indicates non-latched output, and the level of the data pin output is instantaneous and corresponds to whether the transmitter transmits. It can be used for control similar to jogging. The suffixes 6 and 4 indicate the number of parallel data channels. This system uses PT2272-L6 with 6-channel latched output parallel data function, and the corresponding address code is 6 bits. At this time, pins 1 to 6 of the encoding chip PT2262 and the decoding chip PT2272 are address setting pins, and there are three states to choose from: floating, connected to positive power supply, and grounded. 3 to the power of 6 is 729, so the address code has 729 groups of non-repetition. Only when the address codes of the transmitter PT2262 and the receiver PT2272 are completely the same can they be paired and used [3].
The oscillation resistors of PT2262 and PT2272 must be matched; otherwise, the receiving distance will decrease or even fail to receive. In practical applications, the external oscillation resistor can be adjusted appropriately as needed. A higher resistance value results in a lower oscillation frequency, a wider encoding width, and a longer transmission time per frame. Tests have shown that a 1.2MHz resistor for PT2262 and a 200KΩ resistor for PT2272 provide the best matching effect, achieving a safe control distance of up to ten meters.
2.2 Radio Frequency Transmitter/Receiver Module
Radio frequency wireless communication is a communication method that uses high-frequency electromagnetic waves. The commonly used frequencies for radio frequency wireless modules are 315MHz and 433MHz. The radio frequency wireless transceiver module selected in this example has a frequency of 433MHz. The transmitting module (receiving module) generally has four external interfaces: "VCC" is connected to the positive power supply, "DATA" is connected to the data input terminal, "GND" is connected to the negative power supply, and "ANT" is connected to the antenna. Connect an antenna with a length of 12cm and a diameter of 1mm to the transceiver module and keep the antenna straight to achieve the best receiving effect. The transmitting head has high power requirements. If the power supply capacity is insufficient, the transmitting head will transmit at a very short distance or even not transmit at all [4].
2.3 EEPROM and Display
Based on the amount of data to be stored, the EEPROM selected in this example is the AT24C02. Serial EEPROMs are I2C bus-based storage devices that follow a two-wire protocol. Due to their convenient interface, small size, and data retention even when power is off, they are widely used in instrumentation and industrial automation control. The pinout of the AT24C02 is shown in Figure 5.
The pin functions of the AT24C02 are shown in Table 3:
Table 3 AT24C02 Pin Functions
Tab.3 AT24C02 pin function
Pin name | Function |
A0 A1 A2 | Device address selection |
SDA | Serial data/address |
SCL | Serial clock |
WP | Write protection |
VCC | Operating voltage: 1.8~6.0V |
GND | land |
SCL is the serial clock input pin, used to generate the clock for all data transmission or reception of the device.
SDA stands for bidirectional serial data/address pin, used for sending or receiving all data from the device.
A0, A1, and A2 are device address input pins used to set the device address when multiple devices are cascaded. The default value is 0 when these pins are left floating. A maximum of 8 devices can be cascaded when using the AT24C02. If only one AT24C02 is addressed by the bus, these three address input pins A0, A1, and A2 can be left floating or connected to GND.
WP is write-protected. If the WP pin is connected to VCC, all contents are write-protected and can only be read. Normal read/write operations are allowed when the WP pin is connected to GND or left floating[5].
The remote control has a temperature display function. This system uses the SMS0301C3 standard segment LCD module (LCM), which is a segment LCD display capable of displaying 3 digits, 6 segments of prompts, and 2 decimal points. It has low power consumption and can be connected to a microcontroller via a three-wire serial port. It is widely used in handheld instruments. The structure of SMS0301C3 is shown in Figure 6.
2.4 Circuit Schematic
The schematic diagram of the remote control circuit of this system is shown in Figure 7, the schematic diagram of the main control board circuit is shown in Figure 8, the correspondence table between the tens digit of the wireless transmission data and the set temperature is shown in Table 4, and the correspondence table between the units digit of the wireless transmission data and the set temperature is shown in Table 5.
Table 4. Correspondence between launch data and temperature (ten digits)
Tab.4 Emission data and the corresponding temperature(ten)
D5 | D4 | The tens digit of the corresponding temperature value |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 2 |
1 | 1 | 3 |
Table 5. Correspondence between launch data and temperature (units digit)
Tab.5 Emission data and the corresponding temperature(abit)
D3 | D2 | D1 | D0 | The units digit of the corresponding temperature value |
0 | 0 | 0 | 1 | 1 |
0 | 0 | 1 | 0 | 2 |
0 | 0 | 1 | 1 | 3 |
0 | 1 | 0 | 0 | 4 |
0 | 1 | 0 | 1 | 5 |
0 | 1 | 1 | 0 | 6 |
0 | 1 | 1 | 1 | 7 |
1 | 0 | 0 | 0 | 8 |
1 | 0 | 0 | 1 | 9 |
1 | 0 | 1 | 0 | 0 |
The power supply VC for the PT2262 is provided by the microcontroller. The high-level outputs from the microcontroller's output pins D0-D5 power the PT2262 via diode 1N4148. When there is no wireless transmission signal, D0-D5 are low, and VC is also low, so the PT2262 does not operate. When there is a wireless transmission signal, D0-D5 will generate a high level; any high level in any of D0-D5 will cause VC to go high, and the PT2262 will then operate. D0-D5 are the wireless transmission data bits, output to the PT2262 through the microcontroller pins, and then transmitted through the wireless module.
LEDJIA is the indicator light for the "JIA" button. When the "JIA" button is pressed, LEDJIA flashes once. LEDJIAN is the indicator light for the "JIAN" button. When the "JIAN" button is pressed, LEDJIAN flashes once. LEDON is the indicator light for the "ON_OFF" button. When the "ON_OFF" button is pressed, LEDON flashes once.
The PT2272L6 receives wireless signals through its RF receiver module and sends the decoded 6-bit data signal to the microcontroller via the lower 6 bits of port P2. The microcontroller then decodes this signal, calculates the set temperature, and outputs corresponding control signals based on a comparison between the actual temperature and the set temperature to achieve constant temperature control.
3 System Software Design
The flowchart of the receiving program software is shown in Figure 9, and the flowchart of the transmitting program software is shown in Figure 10.
4. Conclusion
Compared to ordinary car and home appliance remote controls, the radio frequency wireless remote control studied in this paper can transmit more data and has higher reliability and stability. Specific conclusions are as follows:
(1) Using an encoding/decoding chip for data transmission can effectively control errors caused by wireless channel noise or interference and improve the accuracy of system data transmission.
(2) This remote control is suitable for remote control systems that require a lot of data transmission. Experiments have shown that this remote control is safe, reliable and easy to operate.
References
[1] Bao Jin. Principle of practical wireless remote control design based on single-chip microcomputer [J]. Yinshan Journal (Natural Science Edition), 2007, (01).
[2] Wang Xiaoli. Application of wireless remote control system in fire alarm [J]. Journal of Baoji University of Arts and Sciences (Natural Science Edition), 2003, (02).
[3] Zhang Ying. Application of single-chip microcomputer in the main control console of training group [J]. Automation and Instrumentation, 2005, (05).
[4] Zhao Na. Development of wireless fire alarm controller [D]. Harbin Institute of Technology, 2006.
[5] N. Plopyls, P. Kawka, and A. Alleyne. Closed-loop control over wireless networks. IEEE Control Systems magazine, June 2004.