Introduction: Arduino Using NRF24L01 Rf Module

About: Mechanical engineer, Entrepreneur, Maker, robotic systems expert and founder of Robimek and RobiBot

I will discuss the use of NRF24L01 transceiver module of the models commonly used in wireless communications.

You can use it easily to your use of this module is very easy and good range of projects. In addition, the price is also affordable. Low power consumption and 2.4GHz frequency operation also gives us the advantage.

http://www.robimek.com/arduino-ile-nrf24l01-rf-modul-kullanimi/

http://make.robimek.com/arduino-using-nrf24l01-rf-module/

Step 1: NRF24L01 2.4GHz Transceiver Module

  • Pcb module and an external antenna models are available.While the range of PCB model can go up to 250 m to 1000 m in range external antenna model.
  • Bi-directional communication by both the buyer to make your project can use both the transmitter module.

Step 2: Module Pin Connections:

The module communicates using SPI protocol.Therefore, you should make looking at the arduino pin connector model SPI pins. Let's show the pin connections with Arduino UNO as an example.

nRF24L01 Arduino Uno
VCC3.3 V

GNDGND

CS 7

CE 8

MOSI11

MISO12

SCK13

One of the other receiver of the wireless communication module when you need to set the transmitter.
A module according to status of the project can also be used if desired both the transmitter and receiver. In case the receiver or transmitter module that does not change the cable connection. These connections are the same for all situations.

Step 3: Sample Applications:

Wireless servo motor control with potentiometer

You can make the necessary connections by looking at the receiver and transmitter circuit in Fig.A receiver module for other modules of the software will also perform data transfer by identifying the wireless transmitter.

Step 4: Transmitter Software:

#include <SPI.h>

#include "RF24.h"

int msg[1]; //SCK -> 13//MISO -> 12//MOSI -> 11//CSN -> 7//CE -> 8

RF24 radio(8,7);

const uint64_t pipe = 0xE8E8F0F0E1LL;

int potpin = 0;

int val;

void setup(void)

{

radio.begin();

radio.openWritingPipe(pipe);

}

void loop(void)

{

val = analogRead(potpin);

val = map(val, 0, 1023, 0, 179);

msg[0] = val;

radio.write(msg, 1);

}

Step 5: Receiver Software:

#include <Servo.h>

#include <SPI.h>

#include "RF24.h"

Servo myservo;

//SCK -> 13//MISO -> 12//MOSI -> 11//CSN -> 7//CE -> 8

RF24 radio(8,7);

const uint64_t pipe = 0xE8E8F0F0E1LL;

int msg[1];

void setup()

{

myservo.attach(9);

radio.begin();

radio.openReadingPipe(1,pipe);

radio.startListening();

}

void loop()

{

if (radio.available())

{

bool done = false;

while (!done)

{

done = radio.read(msg, 1);

myservo.write (msg[0]);

}

} Servo.h>}

Step 6: Description of Function:

First we need to define the CE Software and CSN pins.
nrf24l01p attractive (7.8); >> Here's command 7.p the CSN 8.p is defined as the CE pin. In this function on behalf of the receiver module "receiver" We named. "nrf24l01p transmitter (7,8);" >> Here's command 7.p the CSN 8.p is defined as the CE pin. On behalf of transmitter modules in this function "transmitter" We named. Spı.beg the added library SP for communicating with the SPI protocol (); The setup communications function is started by writing into. "alici.channel (90);" >> defined communication channel value of 90 yaptık.b receiver module in the setup value should be the same value in both modules. Values between 0 and 125 can be written. "verici.channel (90);" we do >> the value defined in the setup, the communication channel 90 transmitter module. This value can be written in the same value range from 125 olmalıdır.0 in both modules. "alici.rxaddress (" control ");" >> We set the receiver module with the function name and address to the "control" gave the name. "verici.txaddress (" control ");" >> we set this function with the name and address of the transmitter module to the "control" gave the name. The two modules also address the communication channel name and value must be the same.

Important Note: Module communication between both modules also can not be obtained between VCC and GND pins and placing it between 10 uF 3.3 uF capacitor in the value and try again.

http://www.robimek.com/arduino-ile-nrf24l01-rf-modul-kullanimi/

http://make.robimek.com/arduino-using-nrf24l01-rf-module/

Epilog Contest VII

Participated in the
Epilog Contest VII