luiz_coppini
Published

Myoelectric sensor-controlled hand prosthesis

Print a prosthesis on your 3D printer and use a myoelectric sensor to control it.

IntermediateWork in progress915
Myoelectric sensor-controlled hand prosthesis

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
MyoWare Muscle Sensor Development Kit
SparkFun MyoWare Muscle Sensor Development Kit
×1
Grove Shield for Arduino Nano
Seeed Studio Grove Shield for Arduino Nano
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×5
9V battery (generic)
9V battery (generic)
×2
9V Battery Clip
9V Battery Clip
×2
Jumper wires (generic)
Jumper wires (generic)
×1

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Hot glue gun (generic)
Hot glue gun (generic)
nylon thread roll

Story

Read more

Custom parts and enclosures

Hand prosthesis CAD.

Modeling of the hand parts in Solid Works.

Schematics

Myoeletric sensor schema.

Battery connection pic1

Battery connection pic2

Myoelectric sensor connection

Order of muscle connectors

Place one electrode in the middle of the muscle body, connect this electrode to the RED snap connector.

Place a second electrode at one end of the muscle body, connect this electrode to the GREEN snap connector.

Place a third electrode on a bony or non-muscular part of your body near the targeted muscle, connect this electrode to the YELLOW snap connector.

Code

Control the protestic hand with myoelectric sensor.

C/C++
#include <Servo.h>

//Threshold for servo motor control with muscle sensor.
//You can set a threshold according to the maximum and minimum values of the muscle sensor.
#define THRESHOLD 200

//Pin number where the sensor is connected. (Analog 0)
#define EMG_PIN 0

//Define Servo motor

const int servoPinA = 4;
Servo servoA;

const int servoPinB = 5;
Servo servoB;

const int servoPinC = 6;
Servo servoC;

const int servoPinD = 7;
Servo servoD;

/*-------------------------------- void setup ------------------------------------------------*/

void setup() {

  //BAUDRATE set to 115200, remember it to set monitor serial properly.
  //Used this Baud Rate and "NL&CR" option to visualize the values correctly.
  Serial.begin(115200);

  servoA.attach(servoPinA);
  servoB.attach(servoPinB);
  servoC.attach(servoPinC);
  servoD.attach(servoPinD);// damos um "start" nos pulsos do servomotor, associando o pino de controle com a gerao de pulsos promovida pela funo e mtodo - "servo.attach()"


  openGripper();
  //servoA.write(90);        // Definimos o ngulo inicial do servo em 90 graus (posio central do servomotor)
  //servoB.write(90);
  //servoC.write(90);
  //servoD.write(90);
}

/*--------------------------------  void loop  ------------------------------------------------*/

void loop() {

  //The "Value" variable reads the value from the analog pin to which the sensor is connected.
  int value = analogRead(EMG_PIN);

  //If the sensor value is GREATER than the THRESHOLD, the servo motor will turn to 170 degrees.
  if (Serial.available())
  {
    if (value > THRESHOLD) {
      closeGripper();
    } else {
      openGripper();
    }
  }

  //You can use serial monitor to set THRESHOLD properly, comparing the values shown when you open and close your hand.
  Serial.println(value);
}

void openGripper() {

  servoB.write(150);
  servoC.write(0);
  delay(500);
  servoA.write(150);
  servoD.write(0);

}

void closeGripper() {

  servoB.write(0);
  servoC.write(150);
  delay(500);
  servoA.write(0);
  servoD.write(150);
}

Credits

luiz_coppini

luiz_coppini

2 projects • 0 followers

Comments