Application of Bluetooth Technology in Short-distance Wireless Remote Control

Publisher:Susan苏Latest update time:2012-04-18 Source: 今日电子 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

There is a great demand for short-range radio remote control, but the design and debugging of radio frequency circuits are relatively complex, and the requirements for personnel and equipment are high, thus limiting its scope of use.

Bluetooth technology provides low-cost, short-range wireless communication. It supports point-to-point and point-to-multipoint bidirectional digital transmission. It works in the ISM band of 2.402-2.480GHz. The data rate is 1Mb/s, the error correction code uses a 1/3 repetition code, a 2/3 Hamming code, 79 frequency hopping points, and a frequency hopping rate of 1600 times/second. The transmission distance of Class 2 modules is about 10m, and that of Class 1 modules can reach 100m.

The Bluetooth module is used in the radio remote control system, and the work of the wireless radio frequency part is completed by the Bluetooth module, making the remote control system design simple and convenient.

Wireless remote control transmitter

The block diagram of the transmitter in the wireless remote control system is shown in Figure 1.

Figure 1 Transmitter block diagram

It has three analog (joystick) inputs and six switch (button) inputs. The microcontroller uses TI's MSP430F2274 single-chip microcomputer, which has the main advantage of low power consumption. The Bluetooth module uses Stollmann's BlueRS+ Class1 module.

Transmit command coding: There are 64 groups of codes for the combination of all states of the six switch quantities. Since the number of groups of effective coding is much smaller than the number of combined codes of all states, and the effective combination coding of the switch state is represented by a length of 2 bytes (16 bits), the Hamming distance between code groups is increased, and a group code with error correction function is used as the transmission coding of the switch state.

The transmitter commands the code to send a frame every 20ms. The format of each frame of data is shown in Figure 2.

Figure 2 Transmitter command frame

One frame of data is 18 bytes. The frame header field occupies 4 bytes, of which the 4th byte is the frame number, with 256 as the modulus; the three fields of analog 1, analog 2 and analog 3 each occupy 2 bytes, which are the digital encodings of the position information of the 1st, 2nd and 3rd joysticks respectively; the switch 1 field occupies 2 bytes, which is the encoding indicating the status of the six switches; the switch 2 and switch 3 fields are the repetitions of the switch 1 field, respectively, in order to increase the anti-interference capability. When the receiver decodes the information, as long as the error code of one of the three groups of codes received, switch 1, switch 2 and switch 3, does not exceed the error-correctable range, the corresponding action can be correctly executed. There is no need to wait for the next frame of data to be received, which can reduce the delay time.

The connection between the Bluetooth module and the microcontroller is shown in Figure 3. The microcontroller transmits the frame information representing the command code to the connected Bluetooth module, which sends it to another Bluetooth module connected to the receiver via a wireless channel, which transmits the data to the microcontroller of the receiver.

Figure 3 Connection between Bluetooth module and microcontroller

Transmitter Microcontroller Program

The transmitter program flowchart is shown in Figure 4. The time required for the microcontroller to execute instructions such as reading switch status, switch code, reading joystick, and framing is very short. Most of the time is waiting for the 20ms timer. When the 20ms timer is interrupted, the timing flag is set to be valid. When the main program sees that the timing flag is valid, it moves the prepared framing data to the transmission buffer and starts the serial port to send data. The serial port transmission uses the interrupt method. [page]

(a) Interrupt program flowchart

(b) Main program flowchart

Figure 4 Remote control transmitter program block diagram

The transmitter is designed to send a frame of remote control instructions every 20ms in order to cooperate with a model servo in the remote control object.

The microcontroller and the Bluetooth module use serial communication, and the baud rate is selected as 9600b/s. A frame of data is 18 bytes long, and the transmission time is approximately:
18 bytes × 10 bits × (1/9600) seconds ≈ 18.75ms

The channel coding of the information to be transmitted (remote control command coding), its error correction, frequency hopping timing control and other tasks are completed by the Bluetooth module under its embedded Bluetooth protocol operation.

Receiver

The block diagram of the remote control receiver is shown in Figure 5. The Bluetooth module is connected to the microcontroller. The data containing the remote control command coding information sent by the remote control transmitter received by the Bluetooth module is transmitted to the microcontroller. The microcontroller decodes and transforms the command coding, isolates and amplifies it through the corresponding drive circuit, and then controls the corresponding controlled object action.

Figure 5 Receiver composition

The information received by the microcontroller of the remote control receiver should theoretically be the same transmitter command coded data as shown in Figure 2. However, since the data is transmitted via radio frequency wireless transmission during the transmission process, it is more likely to cause errors due to interference and other reasons, making the received information inconsistent with the sender's information, which requires error correction processing of the received coded information again. For switch quantity information, the method of increasing the Hamming distance between code groups is adopted to increase the error correction capability. For analog quantities such as the joystick position, the method of continuous sliding filtering is adopted to reduce the impact of errors.

Conclusion

The actual measurement shows that when the distance between the transmitter and the receiver is 70m and there is no obstruction, the receiver does not refuse to operate or malfunction. It does not work reliably at a distance of 100m. The delay from the transmitter pressing the switch to the corresponding port of the receiver responding is about 50-70ms.

Since it is a short-distance remote control, the operator can visually observe the response status of the controlled object. For simplicity, only the forward channel is used to transmit remote control commands. The reverse channel is not used.

Reference address:Application of Bluetooth Technology in Short-distance Wireless Remote Control

Previous article:Wireless intelligent lighting system based on ZigBee technology
Next article:Design of Universal Operation Panel Using CY8C21534

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号