Welcome, Guest

Author Topic: Olimex SHIELD-EKG-EMG  (Read 847 times)

Ghidi

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Olimex SHIELD-EKG-EMG
« on: May 31, 2018, 08:13:49 PM »
Hi, I bought Olimex Shield EKG-EMG. does anyone know how to configure it to read EMG signals? Does anyone even have a sketch to operate a servomotor with EMG signals as input?

svan

  • Newbie
  • *
  • Posts: 48
  • Karma: +11/-0
Re: Olimex SHIELD-EKG-EMG
« Reply #1 on: June 29, 2018, 09:24:18 PM »
>does anyone know how to configure it to read EMG signals?

Parts: Arduino UNO, Olimex EKG/EMG shield, Servo (Towerpro MG92B)

Configuration for Olimex:
AIN SEL A5 Jumper across pins 10,11
D4
Ref E closed
5 v

Servo leads connect to D9, 5v, GND on Olimex shield.

Three electrodes (adhesive): 2 left mid-forearm, one lateral (black), one medial (red). Other electrode (white) posteriorly above elbow (distal humerus).

>Does anyone even have a sketch to operate a servomotor with EMG signals as input?

Basic Arduino code which should get you started:

#include <Servo.h>

Servo servo;
int servoPin = 9; // D9
int angle = 0;   // servo position in degrees

//AIN SEL jumpers across 10,11
const int analogInPin = A5;
int sensorValue = 0;

void setup()
{
   Serial.begin(9600);
   servo.attach(servoPin);
}

void loop()
{
   sensorValue = analogRead(analogInPin);               
   sensorValue = sensorValue >> 2;
   Serial.println(sensorValue);
  // Controls the sensitivity
   if (sensorValue > 135) {
    Serial.println(sensorValue);
     for(angle = 0; angle < 180; angle+=4) {
    //for(angle = 180; angle > 0; angle-=4)  {                                 
      servo.write(angle);               
      delay(15);                   
     }
   }
}

After code has been uploaded and run in Arduino IDE, select Tools/Serial Plotter to view EMG trace.

svan

  • Newbie
  • *
  • Posts: 48
  • Karma: +11/-0
Re: Olimex SHIELD-EKG-EMG
« Reply #2 on: June 29, 2018, 10:35:10 PM »