Wireless Communication Using NRF24L01 Transceiver Module for Arduino Based Projects

2,421

40

4

Published

Introduction: Wireless Communication Using NRF24L01 Transceiver Module for Arduino Based Projects

About: Electrical Engineering student, seeking and sharing knowledge related to my field. Crazy about robotics and embedded system.

This is my second instructable tutorial about the robots and micro-controllers. It is really amazing to see your robot alive and working as expected and believe me it will be more fun if you control your robot or other things wireless with fast and wide range of communication. That is why this instructable is about wireless communication.

Step 1: PARTS

For Transmitter

  1. Arduino Nano or Uno (I’m using Arduino UNO) x1
  2. Transceiver module NRF24L01 x1
  3. Dual Axis Joysticks x2. (or other things like push buttons, sensors etc . I’m using Joystick because I want to send data about the position of joystick).

For Receiver:

  1. Arduino Nano or Uno (I’m using Arduino Nano). x2
  2. Transceiver module NRF24L01. x1

Others:

Jumper wires

Batteries for Arduino supply

Step 2: Introduction to NRF and Connections

By the name of Transceiver it is clear that this module can communicate in both ways as a transmitter or as a receiver depends upon programming. It has 8 pins and we are going to use 7 pins. You may observe pins in attached picture.

VCC & GND for supply.

For this purpose we will use 3.3v pin of Arduino.

CE & CSN

Transmitter and receiver pins. We are going to use Arduino (Nano and Uno) Pin 9 for CE and Pin 10 for CSN.

MOSI, MISO & SCK

These are SPI pins.

It communicate with Arduino by SPI pins. Every member in Arduino family has some specific pins for SPI communication.

For Arduino UNO:

SPI pins are

Pin 11 (MOSI)

Pin 12 (MISO)

Pin 13 (SCK)

Arduino Nano SPI pins:

Pin 11 (MOSI)

Pin 12 (MISO)

Pin 13 (SCK)

Same as Arduino UNO.

Now you can make connections for both transmitter and receiver.

Note: You must have a library for NRF24L01 in your Arduino IDE software. Download it by Here.

Step 3: Introduction to Joystick and Connections.

Joystick in nothing but a simple potentiometer. The 2 axis joystick we are using in this tutorial have 5 pins as shown in picture..

Connections for joystick at transmitter end:

VCC to Arduino 5v pin.

GND to Arduino GND

VRx to Arduino Analogue pin A0

VRy to Arduino Analogue pin A1

SW to any spare digital pin of Arduino. (I'm not using this pin but you may use by a little change in code).

For second Joystick

You may use arduino 5V pin for both joysticks.

VRx to Arduino Analogue pin A2
VRy to Arduino Analogue pin A3

Using two joysticks means you have to transmit 4-6 channels.

Step 4: Working and Programming Part

After the construction of transmitter and receiver take out output pins from receiver. I'm using Arduino's digital pin 2 to digital pin 5 for my 4 channel wireless communication. You may extend it upto available digital pins. To check the working of system I attached a robotic arm having 4 servo motors at receiver end.

Arduino Nano Digital pin 2 => Channel 1 => THR

Arduino Nano Digital pin 3 => Channel 2 => YAW

Arduino Nano Digital pin 4 => Channel 3 => PITCH

Arduino Nano Digital pin 5 => Channel 4 => ROLL

Codes for transmitter and receiver are attached. Don't forget to include libraries first in your Arduino IDE software before uploading the code to Arduino.

Step 5: Upgrading

The basic purpose of this tutorial was to cover the part of wireless communication. But you have to make changing according to your purpose and project. For any question and help use the email address given in code files, must watch the video attached at top and subscribe the channel for support, Thank you.

Share

    Recommendations

    • Clocks Contest

      Clocks Contest
    • Oil Contest

      Oil Contest
    • Creative Misuse Contest

      Creative Misuse Contest

    4 Discussions

    Hi.. this is a full code to control 4 servo use two joystick module via nrf24l01??
    This project is what i looking for. I have a tank control by joystick use nrf24l01. I want to combine it together.

    Hi.. this is a full code to control 4 servo use two joystick modile via nrf24l01??
    This project is what i looking for. I have a tank control by joystick use nrf24l01. I want to combine it in.

    0
    user
    lsifor

    5 months ago

    it keeps coming up with ANOLOG stick not declared in scope or RIGHT, LEFT stick not declared in scope. ther was others which I think I fixed but cant figure these out. how do I fix it?

    1 reply

    The code is easily compiled in my Arduino IDE. I don't think so there is any error.