Categories

Newsletter

EMG Muscle Sensor

Detect muscle activity with this EMG Muscle Sensor. Attach an electrode cable and it will tell when a muscle is contracted!

More details

Availability: SHIPS TODAY

Last Updated: 10/02/2022

Tinkersphere

TS2517

$38.90

Features:

  • EMG Muscle Sensor
  • Detects when a muscle is contracted or relaxed
  • The more muscle activity the greater the voltage
  • Voltage varies from GND to Vss
  • Just one pin Analog Output
  • Attach electrodes to the skin above the muscle and plug the cable into this sensor
  • Electromyogram (EMG)
  • Filters & Rectifies the signal onboard
  • Breadboard compatible
  • Power voltage (Vss): 3.5 to 9V dual +/- power supply

 

Arduino Sample Code for controlling a servo motor by measuring muscle activity when opening and closing your hand:

#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 250

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

//Pin number where the servo motor is connected. (Digital PWM 3)
#define SERVO_PIN 3

//Define Servo motor
Servo SERVO_1;

/*-------------------------------- 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);
 
  //Set servo motor to digital pin 3
  SERVO_1.attach(SERVO_PIN);
}

/*--------------------------------  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(value > THRESHOLD){
    SERVO_1.write(170);
  }

  //If the sensor is LESS than the THRESHOLD, the servo motor will turn to 10 degrees.
  else{
    SERVO_1.write(10);
  }

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

Are there any guides to use/setup this device with an arduino?
Wire it up according to the image https://tinkersphere.com/sensors/2517-emg-muscle-sensor.html and use the sample code at the bottom of the product page. It works well for controlling a servo motor when you detect muscle activity in your forearm. I got it to display a bar graph depending on the intensity of muscle activity by modifying the code a bit. I used this one https://tinkersphere.com/segmented-number-leds/2434-led-bar-graph-red-yellow-cyan-blue.html
Default User Icon Dano · 02/05/2022
Was this answer helpful? (0) (0)