Real-time EMG signals to control a servo motor.

Hi everyone,

I am relatively new to Arduino. I need to control a servo motor using real time EMG signals. I have an Arduino Uno Rev3 board and an EMG/EKG/ECG shield from Olimex as well as gel electrodes and all the required circuitry. I am able to control the servo motor but purely without anything EMG related. My goal is to use different arm movements (collected from the EMG electrodes) to switch the motor on and off once a certain threshold has been exceeded.

Would really appreciate some advice and/or guidance to help me get on the right track.

Thank you for your time !

:smiley: :smiley: :smiley:

I don't have that shield. I don't understand the "packet" of information that is produced by the shield.

But in general terms, do you understand when the packet is reporting the arm movement that you want to couple with a servo motor? You probably do. If not, Olimex has a forum too. ;D

Determine how much you want the servo to move. For example 90 degrees.

Determine the range of the packet that you want to move the servo 90 degrees.

Use a separate power supply for the servo.

Again, I don't understand the packet but here is another example...

I want to read an analog input (range 0 to 1023) and move the servo 90 degrees max based upon the ananlog read...
If the analog read is 0 - the servo is 0; if the analog read is 1023 - the servo is 90.

Didn't show any setup code in example code below...

int Demo_Read = analogRead ( A5 ); // Read A5
int servo_position = Demo_Read / 1023 * 90;
myservo.write(servo_position);