Design for a Cause 2021 - Robotic Hand (Blog #6) – Project Complete (Part 1)
Material:
- Arduino Nano 33 IOT
- 5 – Servos
- 50lb Fishing Line (Simulate Tendons)
- 3D Printed hand
- INA828 Precision Instrumentation Amplifier chip
- Surface Electrode Pads (Attach to arm)
Cost to complete the project:
· $185.00 CDN
· 50+ hours of time (Estimate)
Overview:
This project had to be the most challenging for me. Designing the hand to be 3D printed took a lot of time. I am very new to 3D printing so I through myself into the deep end with this. The sensor was fun to figure out how to make it work.
The 3D printed circuit board worked well but something I won’t do again until I learn more. It was a good thing I bought 2 INA828 sensors since I fried the first one (To many volts by accident).
Setting up the sensor pads was quite easy, just strap them on and plug into the board. The code to make the Arduino read the sensor was a new experience for me, but it went well.
My biggest issue with this whole project was deciding which to use, servos or stepper motors. Up to 4 days ago I was using stepper motors but found the ones I had didn’t have the strength to move the fingers fully. The servos I had worked great (Programming them is more involved).
Sensor:
The sensor is quite impressive!! The EMG sensor (electromyography sensor) measures small electrical signals generated by your muscles when you move them. EMG sensors and systems are used extensively in the fields of ergonomics, sports science and medical research.
The EMG sensor electrode pads are placed in the innervation zone of both tendons for better detection quality. The electrodes detect the electrical activity of the muscle which is amplified by the INA828 microchip. This signal is then sent to the Arduino to figure which finger to move. By setting parameters of the signal strength makes it easy to decide which servo to activate. I found that the location of the electrodes greatly changes the signal strength. Once I got the location pin pointed, each finger movement had specific signal strengths.
Example:
We’ll use the base signal of no muscle movement as 0.
The following are the signal strength of each finger:
Small Finger: 200 - 300
Ring Finger: 300 - 500
Middle Finger: 900 +
Index Finger: 700 - 900
Thumb: 500 - 800
With this information I programmed the Arduino for finger movement.
Arduino Code:
Once I got started into programming the Arduino Nano 33 IOT it went fairly smooth. I did run into a few minor issues but that is what the internet is for. Below is the working code for the robotic hand.
#if defined(ARDUINO) && ARDUINO >= 100 #include "Arduino.h" #else #include "WProgram.h" #endif #include "EMGFilters.h" #include <Servo.h> #define TIMING_DEBUG 1 #define SensorPin A0 // input pin number EMGFilters myFilter; SAMPLE_FREQUENCY sampleRate = SAMPLE_FREQ_500HZ; NOTCH_FREQUENCY humFreq = NOTCH_FREQ_60HZ; Servo myservo1; Servo myservo2; Servo myservo3; Servo myservo4; Servo myservo5; static int Threshold = 0; const int stepsPer = 200; int envlope = 0; const int ledPin = 13; unsigned long timeStamp; unsigned long timeBudget; int sensorValue = 0; // the sensor value int sensorMin = 200; // minimum sensor value int sensorMax = 0; // maximum sensor value void setup() { myFilter.init(sampleRate, humFreq, true, true, true); Serial.begin(115200); timeStamp = micros(); myservo1.attach(2); myservo1.attach(3); myservo1.attach(4); myservo1.attach(5); myservo1.attach(6); // turn on LED to signal the start of the calibration period. 1 second start notice pinMode(ledPin, OUTPUT); digitalWrite(ledPin, HIGH); delay(250); digitalWrite(ledPin, LOW); delay(250); digitalWrite(ledPin, HIGH); delay(250); digitalWrite(ledPin, LOW); delay(250); digitalWrite(ledPin, HIGH); // calibrate during the first fifteen seconds while (millis() < 15000) { timeStamp = micros(); int Value = analogRead(SensorPin); // filter processing int DataAfterFilter = myFilter.update(Value); int envlope = (sq(DataAfterFilter)); // any value under threshold will be set to zero envlope = (envlope > Threshold) ? envlope : 0; sensorValue = envlope; // record the minimum sensor value while relaxed if (sensorValue < sensorMin) { sensorMin = sensorValue; } } // signal the end of the calibration period. 1 second notification to start program digitalWrite(ledPin, LOW); delay(250); digitalWrite(ledPin, HIGH); delay(250); digitalWrite(ledPin, LOW); delay(250); digitalWrite(ledPin, HIGH); delay(250); digitalWrite(ledPin, LOW); } void loop() { timeStamp = micros(); int Value = analogRead(SensorPin); // filter processing int DataAfterFilter = myFilter.update(Value); int envlope = (sq(DataAfterFilter)); envlope = (envlope > Threshold) ? envlope : 0; if (envlope < sensorMin){ Serial.println("0"); Serial.println(envlope); } if (envlope > sensorMin + 200){ if (envlope > sensorMin + 199 && envlope < sensorMin + 300){ //Small finger servo1(); //Goto function servo1 Serial.println("1"); Serial.println(envlope); delay(100); } if (envlope > sensorMin + 299 && envlope < sensorMin + 500){ //Ring Finger servo2(); //Goto function servo2 Serial.println("2"); Serial.println(envlope); delay(100); } if (envlope > sensorMin + 499 && envlope < sensorMin + 800){ //Thumb servo3(); //Goto function servo3 Serial.println("3"); Serial.println(envlope); delay(100); } if (envlope > sensorMin + 699 && envlope < sensorMin + 900){ //Index Finger servo4(); //Goto function servo4 Serial.println("4"); Serial.println(envlope); delay(100); } if (envlope > sensorMin + 899 && envlope < sensorMin + 5000){ //Middle Finger servo5(); //Goto function servo5 Serial.println("5"); Serial.println(envlope); delay(100); } delay(100); } } void servo1(){ myservo1.attach(2); //Power to servo delay(15); //Short delay myservo1.write(180); //Turn servo 180° delay(1000); //Delay 1 second myservo1.write(0); //Return servo to 0° delay(1000); //Delay 1 second myservo1.detach(); //Power off to servo } void servo2(){ myservo2.attach(3); delay(15); myservo2.write(180); delay(1000); myservo2.write(0); delay(1000); myservo2.detach(); } void servo3(){ myservo3.attach(4); delay(15); myservo3.write(180); delay(1000); myservo3.write(0); delay(1000); myservo3.detach(); } void servo4(){ myservo4.attach(5); delay(15); myservo4.write(180); delay(1000); myservo4.write(0); delay(1000); myservo4.detach(); } void servo5(){ myservo5.attach(6); delay(15); myservo5.write(180); delay(1000); myservo5.write(0); delay(1000); myservo5.detach(); }
Photos:
Below are photos of the finished robotic hand!!
Working Video:
I have been awake since 2am doing the final touches on this project. I will be uploading the video this afternoon to show how it all works!!
I want to thank our sponsor for organizing and supplying us with the Arduino Nano 33 IOT. This is a challenge that could help may people!!
Dale Winhold
Top Comments