Robotic hand with wireless glove controlled | nRF24L01+ | Arduino Source



In this video; 3D robot hand assembly, servo control, flex sensor control, wireless control with nRF24L01, Arduino receiver and transmitter source code are available. In short, in this project we will learn how to control a robot hand with a wireless glove. The hand is part of an open-source project called InMoov. It's a 3D-printable robot, and this is just the hand and forearm assembly. Required Hardware: 2x Arduino Board (Nano) -- https://goo.gl/QbEmNL 2x nRF24L01+ Transceiver -- https://goo.gl/FePZu9 2x nRF24L01+ Adapter -- https://goo.gl/HSfTWq 5x MG996R Servo -- https://goo.gl/gj2cZs 5x 4.5 Inch Flex Sensor -- https://goo.gl/ZVqfyY 5x 10k Resistor -- https://goo.gl/uSYHGx 2x 18650 3.7V Battery -- https://goo.gl/UEJTff 1x 18650 Battery Holder -- https://goo.gl/VU4dfb 1x 9V Battery -- https://goo.gl/xaD6Tf 1x 9V Battery Connector -- https://goo.gl/fLjKL7 1x Glove -- https://goo.gl/Jrykxx 1x String / Braid Line -- https://goo.gl/EhSdXM 3x Mini Breadboard -- https://goo.gl/uvEhR1 Jumper Wires -- https://goo.gl/EGTafY 1x Rubber / Tire or Spring 1x Steel Wire or Filament 3x Bolt ( 8mm diameter) Required Tools (Optional): Hilda Drill + Dremel Tool -- https://goo.gl/mXoFqY Anet A8 3D Printer -- https://goo.gl/rpdqQ4 PLA 22M 1.75mm Red Filament -- https://goo.gl/35MSfn Hot Glue Gun -- https://goo.gl/2znyr6 Cable Ties -- https://goo.gl/8FbDzU Super Fast Adhesive -- https://goo.gl/aGnizS DANIU Screwdriver Wallet Set -- https://goo.gl/i75Au5 DANIU Adjustable Solder -- https://goo.gl/2oZhtu DANIU Soldering Stand -- https://goo.gl/2n8gds DANIU Solder Wire -- https://goo.gl/FC7W6o DANIU Heat Shrink Tube -- https://goo.gl/j2xcVf DANIU Wire Cable Cutter -- https://goo.gl/b96G4X PCB Board -- https://goo.gl/D1so5j Screws Nuts Assortment Kit --https://goo.gl/EzxHyj

------------------------------------------------------------------------- 

Thanks to InMoov -- http://inmoov.fr/ For more information, visit the official InMoov website. You can visit the "Assembly Sketches" and "Assembly Help" pages in the InMoov website for more details on assembly. All 3D parts used in this project -- https://goo.gl/npCuQd RF24.h Library Link -- https://github.com/maniacbug/RF24

-------------------------------------------------------------------------

Source Code:
//Transmitter Code (Glove) - Mert Arduino and Tech

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

int msg[5]; //Total number of data to be sent (data package)

//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(9,10);                     //9 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(void){

  flex_5_val = analogRead(flex_5); 
  flex_5_val = map(flex_5_val, 630, 730, 80, 20);
  
  flex_4_val = analogRead(flex_4);
  flex_4_val = map(flex_4_val, 520, 710, 70, 175);
 
  flex_3_val = analogRead(flex_3);
  flex_3_val = map(flex_3_val, 510, 680, 140, 10);
 
  flex_2_val = analogRead(flex_2);
  flex_2_val = map(flex_2_val, 580, 715, 90, 175);
  
  flex_1_val = analogRead(flex_1);
  flex_1_val = map(flex_1_val, 550, 700, 90, 175);
  
  msg[0] = flex_5_val;
  msg[1] = flex_4_val;
  msg[2] = flex_3_val;
  msg[3] = flex_2_val;
  msg[4] = flex_1_val;
  radio.write(msg, sizeof(msg));
}

//Receiver Code (Hand) - Mert Arduino and Tech

#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(9,10);     /*This object represents a modem connected to the Arduino. 
                      Arguments 9 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[5];

void setup(){

  //define the servo input pins
  myServo1.attach(15); //A1
  myServo2.attach(16); //A2
  myServo3.attach(17); //A3
  myServo4.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
  }


void loop(){
  if(radio.available()){
    bool done = false;
    while (!done){
    done = radio.read(msg, sizeof(msg));

    myServo1.write(msg[2]); //A1
    myServo2.write(msg[4]); //A2
    myServo3.write(msg[3]); //A3
    myServo4.write(msg[1]); //A4
    myServo5.write(msg[0]); //A5
    }
  }
}