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:
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(&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(&text, sizeof(text)); Serial.println(text); } } |
Thank You
SHARE THIS!!!