All you have to do is configure the required registers, put your data into the TX FIFO and issue the TX command… and whoa…!! your packet will be in the air, and to receive, configure the radio to be a receiver and when a it gets a packet, it disassembles the packet and makes the data available in RX FIFO. The automatic packet handler in the Nordic radio assembles the preamble, address, packet control field, payload and CRC to make a complete packet before it is transmitted and disassembles it to give the payload after reception of the packet. The radio also features automatic packet handling which features automatic acknowledgement and re-transmission of packets.
This module uses the 2.4GHz transceiver from Nordic Semiconductor, the nRF24L01+. This transceiver IC operates in the 2.4GHz band and can operate in air data-rates of 250kbps, 1Mbps and 2 Mbps with a maximum power of 0 dBm. The NRF24L01+ IC is a 3.3V device, but its I/O pins are 5 V tolerant , which makes it easier to interface with the standard microcontrollers. The board that Sparkfun designed is having a 3.3 v regulator for power supply, so it is possible to use a common 5 V supply for powering both the micro-controller and RF module.The RF module has an SPI interface and there are about 29 registers inside the radio which can be configured via SPI.
Since I was lazy to write my own library, I choose the RF24 library. MIRF library also works fine, but it provides only a handful of the numerous capabilities of the radio. The sketch was developed step by step, with progress on each step. Initially a one-way remote was developed, which enabled to switch on and off an LED over the wireless link, then a serial port interface was also added, which made it capable to send ASCII strings from a computer. The next step was to create the bidirectional serial data capability, that means the same system should work both as a transmitter and a receiver ( at different instances of time, of course..). The radios were configured normally to be in receiver state when idle and it will wait for any packets on the air. When a packet was detected, it will inform the microcontroller to read it out and spit it into the serial port. The microcontroller waits for data from the serial port, and when a data rrives, toggles the radio into transmit mode, fills the TX FIFO with the data and transmits it. After receiveing the acknowledgement, it changes back to the default receive mode
All the codes are hosted in the github repository.
As antennas play a crucial role in deciding the characteristics of a radio system, much care & study was done in choosing them. As the system is intended to be a point to point link, the antenna can be directional and with a high gain. Biquad antenna with reflectors was chosen (thanks to Trevor Marshall) . It is having a good gain of about 10dB and can be made in a couple of hours. The antenna model was made using NEC2 and simulations done. The radiation patterns seemed perfect. The figure below shows a rendering of the 3D radiation pattern of the antenna.
I could not find a mating connector for the reverse polarised connector on the radio module, so the radio had to be mounted right behind the reflector, the antenna directly fed from the connector on the board.. The link worked fine and gave an approx 2 Km line of sight amazing range in the 250 Kbps mode. It was quite wonderful that such a low power device could give such a great distance of link when coupled with a good antenna. The range can be further increased if an antenna with a much more gain is used, like a parabolic reflector antenna ( a parabolic with a biquad feed element would have outstanding performance). Here are a few pictures of the antenna.
The above figure shows the crudely built connector to the feed. The gold colored one is the connector on the Nordic board. A folded aluminium foil was used to connect the signal line of the sub miniature coaxial RF connector to the feed, and a small piece of plastic ( the white thing) was needed to hold the connector tightly.
In the end, I was left with a pair of transcivers operating in half duplex mode which I could plug in directly to the USB port, launch a serial port terminal, and start chatting or send files. 🙂