Go Down

Topic: 5 servos with amplifier and values from medical electrodes (Read 980 times) previous topic - next topic

Kobet

Hello, a newbie here :D

I want to make a robot hand for my school proyect using 5 servo motors Savox SC-0252MG Metal Gear Standard Digital Servo (http://www.amain.com/Savox-SC-0252MG-Standard-Digital-Metal-Gear-Servo/p183310) and taking values from a medical electrode (EMG) connected to my arm, with an Arduino UNO (maybe R1) and want to know from you guys wich amplifier is more accurate for my proyect and if you can help me with de code too?

Like i said... im a beginner in this world of arduino and i dont know how start.

Thanks a lot.




PaulS

Quote
and want to know from you guys wich amplifier is more accurate
I'm partial to Harman-Kardon stuff myself.

Quote
and if you can help me with de code too?
Sure thing. You write it, and we;ll help you understand why it doesn't work, if it doesn't.

If you are looking to hire someone, that's done in Gigs and Collaboration.
The art of getting good answers lies in asking good questions.

zoomkat

Test code for a bunch of servos.

Code: [Select]

//zoomkat 11-22-12 simple delimited ',' string parse
//from serial port input (via serial monitor)
//and print result out serial port
//multi servos added
// Powering a servo from the arduino usually *DOES NOT WORK*.

String readString;
#include <Servo.h>
Servo myservoa, myservob, myservoc, myservod;  // create servo object to control a servo

void setup() {
  Serial.begin(9600);

  //myservoa.writeMicroseconds(1500); //set initial servo position if desired

  myservoa.attach(6);  //the pin for the servoa control
  myservob.attach(7);  //the pin for the servob control
  myservoc.attach(8);  //the pin for the servoc control
  myservod.attach(9);  //the pin for the servod control
  Serial.println("multi-servo-delimit-test-dual-input-11-22-12"); // so I can keep track of what is loaded
}

void loop() {

  //expect single strings like 700a, or 1500c, or 2000d,
  //or like 30c, or 90a, or 180d,
  //or combined like 30c,180b,70a,120d,

  if (Serial.available())  {
    char c = Serial.read();  //gets one byte from serial buffer
    if (c == ',') {
      if (readString.length() >1) {
        Serial.println(readString); //prints string to serial port out

        int n = readString.toInt();  //convert readString into a number

        // auto select appropriate value, copied from someone elses code.
        if(n >= 500)
        {
          Serial.print("writing Microseconds: ");
          Serial.println(n);
          if(readString.indexOf('a') >0) myservoa.writeMicroseconds(n);
          if(readString.indexOf('b') >0) myservob.writeMicroseconds(n);
          if(readString.indexOf('c') >0) myservoc.writeMicroseconds(n);
          if(readString.indexOf('d') >0) myservod.writeMicroseconds(n);
        }
        else
        {   
          Serial.print("writing Angle: ");
          Serial.println(n);
          if(readString.indexOf('a') >0) myservoa.write(n);
          if(readString.indexOf('b') >0) myservob.write(n);
          if(readString.indexOf('c') >0) myservoc.write(n);
          if(readString.indexOf('d') >0) myservod.write(n);
        }
         readString=""; //clears variable for new input
      }
    } 
    else {     
      readString += c; //makes the string readString
    }
  }
}

Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

JimboZA

I can't advise on the signal amplification side, although I'll hazard a guess that noise will be an issue and you may need to investigate how to filter it out.

On the servos, I'd look at the servo knob example, since the use of the potentiometer will probably serve as a mimic for the analog signal from an amplifier. Get a few pots on different analog pins and you can at least get the servos operating.

The pic below shows how you can hook up a bunch of servos. Don't power them from the Arduino although the tutorial tells you to.

Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

Go Up