Design of wireless data transmission system based on 51 single chip microcomputer

Publisher:数据之翼Latest update time:2011-12-22 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

With the gradual integration of computer, communication and wireless technology, wireless communication technology has emerged on the basis of traditional wired communication. It has the advantages of being fast, convenient, portable and safe, so it is widely used in remote control toys, automotive electronics, environmental monitoring and electrical automation.

In some special applications, the communication between the microcontroller and the host computer no longer uses wired data transmission, such as wired serial, parallel bus, I2C and CAN bus, but requires wireless data transmission. This article introduces the design of a practical microcontroller wireless transmission system based on the nRF905 wireless transceiver module.

2 Wireless transceiver module nRF905

nRF905 is a single-chip RF transceiver launched by Nordic VLSI of Norway. It has an operating voltage of 1.9-3.6 V, a 32-pin QFN package (5×5 mm), and operates in three ISM (industrial, scientific and medical) channels of 433/868/915 MHz. The switching time between channels is less than 650μs. nRF905 consists of a frequency synthesizer, a receiving demodulator, a power amplifier, a crystal oscillator and a modulator. It does not require an external SAW filter, has a ShockBurstTM working mode, automatically processes headers and CRC (cyclic redundancy check), and uses an SPI interface to communicate with a microcontroller, making it very convenient to configure. In addition, its power consumption is very low. When transmitting at an output power of -10 dBm, the current is only 11 mA, and when operating in receiving mode, the current is 12.5 mA. It has built-in idle mode and shutdown mode, making it easy to achieve energy saving. nRF905 is suitable for many fields such as wireless data communication, wireless alarm and security systems, wireless unlocking, wireless monitoring, home automation and toys.

3 Chip Structure and Working Mode

The nRF905 chip integrates power management, crystal oscillator, low noise amplifier, frequency synthesizer, power amplifier and other modules. Manchester encoding/decoding is completed by the on-chip hardware, and the user does not need to Manchester encode the data, so it is very convenient to use.

nRF905 has two working modes and two energy-saving modes. The two working modes are ShockBurstTM receiving mode and ShockBurstTM sending mode, and the two energy-saving modes are shutdown mode and idle mode. The working mode of nRF905 is determined by the three pins TRX_CE, TX_EN and PWR_UP, see Table 1 for details.

: The high-speed signal processing related to the RF data packet is all performed in the nRF905 chip. The data rate is determined by the SPI interface configured by the microcontroller. The data is processed at a low speed in the microcontroller, but sent at a high speed in the nRF905. Therefore, there is a long period of idle time in between, which is beneficial to energy saving. Since the nRF905 works in ShockBurstTM mode, a high RF data transmission rate can be obtained even with a low-speed microcontroller. In the ShockBurstTM receiving mode, when a data packet containing the correct address and data is received, the address match (AM) and data ready (DR) pins notify the microcontroller. In the ShockBurstTM sending mode, the nRF905 automatically generates a header and CRC checksum. When the sending process is completed, the data ready pin notifies the microprocessor that the data transmission is completed. From the above analysis, it can be seen that the ShockBurstTM transceiver mode of the nRF905 is beneficial to saving memory and microcontroller resources, and also reduces the time for writing programs.

4 Device Configuration

All configuration words are sent to nRF905 through the SPI interface. The working mode of the SIP interface can be set through SPI instructions. When nRF905 is in idle mode or shutdown mode, the SPI interface can remain in working state.

(1) SPI interface configuration

The SPI interface consists of five registers: status register, RF configuration register, transmit address register, transmit data register and receive data register.

(2) RF configuration

Assume the value in CH_NO is a, the value in HFREQ_PLL is b, then the operating frequency of nRF905 is given by the formula:

If the operating frequency of nRF905 is 433.20 MHz, then a=108, b=0.

The length of each bit of the RF register is fixed. However, during Shock-BurstTM transmission and reception, the number of bytes used by the 4 registers TX_PAYLOAD, RX_PAYLOAD, TX_ADDRESS and RX_ADDRESS is determined by the configuration word. When the nRF905 enters shutdown mode or idle mode, the contents of the register remain unchanged.

5 Circuit Design

When using nRF905, its circuit diagram varies according to different needs. Figure 1 shows its application schematic diagram. The antenna part of this circuit uses a 50 Ω single-ended antenna. In the circuit board design of nRF905, a loop antenna can also be used. The antenna is laid on the PCB board, which can reduce the size of the system. For more detailed design, please refer to the chip manual of nRF905.

nRF905 transmits data through the SPI interface and the microcontroller, and sends wireless data through the ShockBurstTM transceiver mode. It is reliable and easy to use, and has broad application prospects in various fields such as industrial control and consumer electronics.

6. Program Flow

The system uses the most widely used single-chip microcomputer AT89S52 as the data processing part. The specific reading and sending program flow is shown in Figure 2 and Figure 3.

7 Configuration Program[page]

The register operation of the RF chip nRF905 is a critical issue. Due to the use of the SPI protocol, when applying instructions in the configuration register process and simulating the rising edge of the clock in Pl, it is easy to cause misalignment and invalid rising edge of the clock. The SPI interface has 4 signal lines: MOSI, MISO, SCK, and CSN, which are input line, output line, clock line, and configuration enable line respectively. The communication timing of SPI is shown in Figure 4.

8 System parameter measurements

Calculation method of wireless communication propagation distance in free space: Free space propagation refers to the propagation of radio waves when there is an infinite vacuum around the antenna, which is an ideal propagation condition. When radio waves propagate in free space, their energy will not be absorbed by obstacles, nor will it be reflected or scattered.

The communication distance is related to the transmission power, receiving sensitivity and operating frequency:

Where Lfs (unit: dB) is the transmission loss, d (unit: km) is the transmission distance, and the frequency f is calculated in MHz. As can be seen from the above formula, the propagation loss (also known as attenuation) of radio waves in free space is only related to the operating frequency f and the propagation distance d. When f or d doubles, [Lfs] will increase by 6 dB respectively.

The following formula describes the loss of radio wave propagation in free space:

Los is the propagation loss in dB; d is the distance in km; f is the operating frequency in MHz.

The wireless transceiver module nRF905 of this system is selected to work at the first channel of 433.2 MHz, the transmission power is +10 dBm (10 mW), and the receiving sensitivity is -105 dBm. The propagation distance of the system in free space is:

(1) With a transmit power of +10 dBm and a receive sensitivity of -105 dBm:

Loss = 115 dB

(2) Calculated from Los, f:

d = 31 km

This is the transmission distance under ideal conditions. In actual applications, it will be lower than this value. This is because wireless communication is affected by various external factors, such as losses caused by the atmosphere, obstacles, multipath, etc. By incorporating the reference values ​​of the above losses into the above formula, the approximate communication distance can be calculated.

Assuming that the loss caused by atmosphere, shielding, etc. is 25 dB, the communication distance can be calculated as:

d = 1.7 km = 1 700 m

9 Main factors affecting wireless communication distance

Figure 6 is a channel model of a wireless communication system. Under the premise of a fixed working frequency, the main factors affecting the working distance include transmission power, transmission antenna gain, propagation loss, receiving antenna gain, receiver sensitivity, etc. Increasing the transmission power, antenna gain, and receiver sensitivity can all increase the communication distance. Among the above factors that affect the wireless communication distance, the factors that can be controlled by the designer are: receiving sensitivity, RX antenna gain, and transmission output power. The uncontrollable factors are determined by the characteristics of radio waves, mainly: transmission loss, path loss, multipath loss, and absorption of the surrounding environment.

Among the factors that designers can control, receiving sensitivity, antenna gain, and transmitting power can all be used as means to increase communication distance.

The wireless transmission system has the advantages of small size, strong anti-interference ability, safe and reliable data, no need for wiring, and easy maintenance. It will bring a wide range of markets in various fields. The structure of this system is simple, but this does not affect the performance and use of the system. It can be applied to remote control, telemetry, automotive electronics, safety and fire protection, biological signal collection, environmental monitoring and electrical automation.

Reference address:Design of wireless data transmission system based on 51 single chip microcomputer

Previous article:Using single chip microcomputer and CPLD to realize the control of stepper motor
Next article:Design of CAN and RS-232 Converter Based on Single Chip Microcomputer

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号