Make a Robotic Hand with Wireless Controlled - nRF24L01



Make a low cost robotic hand with wireless controlled (using nRF24L01)

In this tutorial, we will learn how to make a robotic hand. And how to controlled it via wireless. 
We will control 5 servo motor using with 5 pcs flex sensor. 
Also we will controlled robotic hand using with nRF24L01.
This video shows the low-cost "robotic hand" construction. You can get excellent results with better flex sensors and servo motors.

---

Created the flex sensors myself. Watch the flex sensor tutorial:


You can watch this tutorial for library installing and possible problems:


---

Hardware Required:

Arduino Board - https://goo.gl/Rqc5w2
nRF24L01 Adapter - https://goo.gl/UWQtWy
Flex Sensor - https://goo.gl/Wp7LPC
Servo Motor - https://goo.gl/iywd5p
Steel Coin Spring - https://goo.gl/IfeBgQ
F to F Jumper - https://goo.gl/TdGrkk
M to M Jumper - https://goo.gl/VRzUN4
Breadboard - https://goo.gl/GjpqVW
Foam Board or similar - https://goo.gl/Xf3Wsi
Nylon Strings - https://goo.gl/880dU0
Hot Glue Gun - https://goo.gl/G3TUQ4
Cable Ties - https://goo.gl/OPy0vC

Recomended Site - https://goo.gl/V9nYtx

---

RF24 Library - https://goo.gl/z8uy2d

---

Get the Code :

/*
---- Receiver Code ----
Mert Arduino Tutorial & Projects (YouTube)
Please Subscribe for Support
*/

#include <Servo.h>    //the library which helps us to control the servo motor
#include <SPI.h>      //the communication interface with the modem
#include "RF24.h"     //the library which helps us to control the radio modem

//define the servo name
Servo myServo1;
Servo myServo3;
Servo myServo4;
Servo myServo2;
Servo myServo5;

RF24 radio(5,10);     /*This object represents a modem connected to the Arduino. 
                      Arguments 5 and 10 are a digital pin numbers to which signals 
                      CE and CSN are connected.*/

const uint64_t pipe = 0xE8E8F0F0E1LL; //the address of the modem,that will receive data from the Arduino.

int msg[1];

int data; //data variable
int pos; //position variable

void setup(){

  //define the servo input pins
  myServo1.attach(15); //A1
  myServo3.attach(16); //A2
  myServo4.attach(17); //A3
  myServo2.attach(18); //A4
  myServo5.attach(19); //A5
  
  radio.begin();                    //it activates the modem.
  radio.openReadingPipe(1, pipe);   //determines the address of our modem which receive data.
  radio.startListening();           //enable receiving data via modem
  }


//You don't need to make changes in this section
void loop(){
  if(radio.available()){
    radio.read(msg, 1);

    if(msg[0] <11 && msg[0] >-1){
      data = msg[0], pos=map(data, 0, 10, 175, 0);
      myServo1.write(pos); 
    }
    if(msg[0] <21 && msg[0]>10){
      data = msg[0], pos=map(data, 11, 20, 175, 0);
      myServo3.write(pos);
    }
    if(msg[0] <31 && msg[0]>20){
      data = msg[0], pos=map(data, 21, 30, 175, 0);
      myServo4.write(pos);
    }
    if(msg[0] <41 && msg[0]>30){
      data = msg[0], pos=map(data, 31, 40, 175, 0);
      myServo2.write(pos);
    }
    if(msg[0] <51 && msg[0]>40){
      data = msg[0], pos=map(data, 41, 50, 175, 0);
      myServo5.write(pos);
    }
  }
}
/*
---- Transmitter Code ----
Mert Arduino Tutorial & Projects (YouTube)
Please Subscribe for Support
*/

#include <SPI.h>                      //the communication interface with the modem
#include "RF24.h"                     //the library which helps us to control the radio modem

int msg[1];

//define the flex sensor input pins
int flex_5 = A5;
int flex_4 = A4;
int flex_3 = A3;
int flex_2 = A2;
int flex_1 = A1;

//define variables for flex sensor values
int flex_5_val;
int flex_4_val;
int flex_3_val;
int flex_2_val;
int flex_1_val;

RF24 radio(5,10);                     //5 and 10 are a digital pin numbers to which signals CE and CSN are connected.
                                      
const uint64_t pipe = 0xE8E8F0F0E1LL; //the address of the modem, that will receive data from Arduino.


void setup(void){
  Serial.begin(9600);
  radio.begin();                      //it activates the modem.
  radio.openWritingPipe(pipe);        //sets the address of the receiver to which the program will send data.
}

void loop(){

  flex_5_val = analogRead(flex_5); 
                             //175 - 0
  flex_5_val = map(flex_5_val, 1023, 0, 0, 10);
  msg[0] = flex_5_val;
  radio.write(msg, 1);

  flex_4_val = analogRead(flex_4);
                             //175 - 0
  flex_4_val = map(flex_4_val, 1023, 0, 11, 20);
  msg[0] = flex_4_val;
  radio.write(msg, 1);

  flex_3_val = analogRead(flex_3);
                             //175 - 0
  flex_3_val = map(flex_3_val, 1023, 0, 21, 30);
  msg[0] = flex_3_val;
  radio.write(msg, 1);

  flex_2_val = analogRead(flex_2);
                             //175 - 0
  flex_2_val = map(flex_2_val, 1023, 0, 31, 40);
  msg[0] = flex_2_val;
  radio.write(msg, 1);

  flex_1_val = analogRead(flex_1);
                             //175 - 0
  flex_1_val = map(flex_1_val, 1023, 0, 41, 50);
  msg[0] = flex_1_val;
  radio.write(msg, 1);
}