INTERFACING NRF24L01

nRF24Lo1 is a sing chip 2.4GHz Transceiver with 250kbps, 1Mbps and 2Mbps on air data rates. It has a supply voltage about 1.9 to 3.6v.

Applications:

  • Wireless PC Peripherals
  • Mouse, keyboards and remotes.
  • Game controllers
  • Active RFID
  • Home Automation
  • Ultra low power sensor networks.

CIRCUIT DIAGRAM:

NRF24L01_bb

CODE :

Library to be downloaded is RF24 library on Github.

TRANSMITTER PROGRAM :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
 
RF24 radio(7, 8);
//The pipe address
const byte rxAddr[6] = "00001";
void setup()
{
  radio.begin();
  radio.setRetries(15, 15);
  radio.openWritingPipe(rxAddr);
  radio.stopListening();
}
void loop()
{
  //The text to be sent
  const char text[] = "Hello World";
  radio.write(&amp;text, sizeof(text));
  delay(1000);
}

RECEIVER PROGRAM:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
 
RF24 radio(7, 8);
const byte rxAddr[6] = "00001";
void setup()
{
  while (!Serial);
  Serial.begin(9600);
 
  radio.begin();
  radio.openReadingPipe(0, rxAddr);
  radio.startListening();
}
 
void loop()
{
  if (radio.available())
  {
    char text[32] = {0};
    radio.read(&amp;text, sizeof(text));
    Serial.println(text);
  }
}

 

monitor

Thank You
SHARE THIS!!!

Gowtham S

Gowtham is a programming enthusiast. His field of interest includes Arduino, NodeMCU, Raspberry Pi, and Python. To know more about him visit https://mybtechprojects.tech/about-us/.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.