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.
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
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
- A5 Why is there no ttyUSB in the dev directory?
- stm32h750 canfd analyzer DIY
- 【NXP Rapid IoT Review】+ Review Summary
- Gigabit RISC-V GD32VF103 debugging tool introduction
- Professional embedded software development: moving towards high-quality and efficient programming
- Recruitment: Ningbo listed auto parts company - motor control software development engineer
- Today at 10:00 AM, there will be a live broadcast with awards [Fujitsu empowers automotive electronics technology transformation]
- ESP32-Cam Programmer
- NXP Rapid IoT Review] + ⑤ Full Interpretation of NXP Rapid IoT Code, Finding Traces of RTC
- Boosting the electric era, explore the three major product technologies of electric vehicles with Infineon