WIRELESS COMMUNICATION ARDUINO NRF24L01

Wireless Communication NRF24L01 Arduino

Posted on

Various electronic devices are made as small as possible for portable needs. One of these communication devices is nRF24L01. This device works on the 2.4 – 2.5 GHz ISM (Industrial, Scientific and Medical) frequencies. The nRF24L01 chip made by Nordic Semiconductor has a data rate specification of 1 or 2Mbps. This means that by using this chip you can send data at 1 mega (1,000,000) or 2 mega (2,000,000) data bits per second. This nRF24L01 chip can be used as a transceiver, receiver or bi-directional (transceiver and receiver simultaneously).

nrf24l01 pinout

This nRF24L01 wireless chip can communicate with 125 other nRF24L01 devices in a location. How can we make this large number of nRF24L01 devices communicate? Is it not mutually data conferencing when sent? The answer is no, because each device must be given an address (pipe). Look at the picture above.

nrf24l01 pinout

Based on the dataheet given information of this chip uses a power supply of 1.9 – 3.6 volts, but in addition to the power supply pin like SPI connection can be given a voltage of 5 volts. This chip requires a current of 11.3 mA when sending data and 12.3mA when receiving data. For uC communication such as Arduino, used the SPI (Serial Peripheral Interface) protocol. The SPI data transmission speed on this chip is 0 to 8Mbps. If you want to see more of this chip, please download the datasheet on the text “nrf24L01 datasheet” below.

Download nRF24L01 Datasheet

nrf24l01 pinout
nRF24L01 PinOut

Look at circuit below. Now we will try this module in a way the module that is connected to Arduino is set as the transmitter, while Arduino Pro Mini on the right is the receiver. We will create a program that can send this word “Hello Word” for one second. If the receiver receives data from the sender, then the receiver will display the data to the serial Arduino monitor.nrf24l01 pinout

In this program a library called RF24 is needed. Please download here.

Transceiver:

Read other articles  DIY Arduino Minimum System

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 10); // CE, CSN
const byte address[6] = "00001";
void setup() {
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
}
void loop() {
const char text[] = "Hello World";
radio.write(&text, sizeof(text));
delay(1000);
}

 

Receiver:

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 10); // CE, CSN
const byte address[6] = "00001";
void setup() {
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
}
void loop() {
if (radio.available()) {
char text[32] = "";
radio.read(&text, sizeof(text));
Serial.println(text);
}
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *