IOT

Electromyography(EMG) with MyoWare Muscle Sensor & Arduino

In this blog, We’ll connect the MyoWare Muscle Sensor to an Arduino and create our own electromyography device. Electromyography (EMG) is an electrodiagnostic medical technique for assessing and recording skeletal muscle electrical activity. EMG is done with the help of an electromyograph, which creates a record called an electromyogram.

The majority of typical EMG measurement equipment is too expensive for personal use. The MyoWare Muscle Sensor is a fantastic place to start learning about Muscular Movement and Electromyography for personal enthusiasts like me. Aside from the core sensor board, there is also a comprehensive development kit for academics and beginners that costs roughly $80 and includes other components.

Apart from Electromyography, we already learned how to use the AD8232 ECG Sensor and Arduino to create an Electrocardiogram. The electrical activity of the heart was investigated. The electrical activity of the muscles will be investigated in this section. So, using a MyoWare Muscle Sensor and an Arduino, we’ll build our own Electromyograph.

Hardware Required

  • Arduino Nano
  • EMG Sensor
  • 0.96″ I2C OLED Display
  • Power Supply
  • Connecting wire
  • Breadboard

Electromyography(EMG)

Electromyography (EMG) is a diagnostic technique for assessing the health of muscles and the nerve cells that govern them. Motor neurons are the name for these nerve cells. They send electrical signals to muscles, causing them to contract and relax. These impulses are translated into graphs or data by an EMG, which aids doctors in making a diagnosis.

An oscilloscope shows the electrical activity picked up by the electrodes. To make the activity audible, an audio amplifier is utilized. The electrical activity of the muscle is measured using EMG during rest, modest contraction, and intense contraction. During rest, muscle tissue does not ordinarily produce electrical signals. On the oscilloscope, a brief period of activity may be seen when an electrode is put.

How EMG is measured?

Surface EMG is a method of assessing muscle function by recording muscle activity from the skin’s surface above the muscle. Surface electrodes can only provide you a limited picture of muscle activation. A pair of electrodes or a more complicated array of several electrodes can be used to record surface EMG. Because EMG recordings show the potential difference between two electrodes, more than one electrode is required.

Medical Uses of EMG

EMG testing can be used in a range of clinical and biological settings.

1. Electromyography (EMG) is used to diagnose neuromuscular disorders.

2. EMG is employed in the study of kinesiology as a research instrument.

3. To determine whether or not there are any motor control issues.

4. Botulinum toxin or phenol injections into muscles are occasionally guided by EMG data.

5. EMG is used in conjunction with another electrodiagnostic medical test that assesses nerve conductivity.

6. Prosthetic devices such as prosthetic hands, arms, and lower limbs utilize EMG signals as a control signal.

MyoWare Muscle Sensor

Myoware Muscle Sensor

Advancer Technologies’ MyoWare Muscle Sensor is an all-in-one electromyography (EMG) sensor. The MyoWare board works by detecting a muscle’s filtered and corrected electrical activity. Depending on the level of activity in the particular muscle, the output ranges from 0 to Vin Volts. The sensor is simple to operate. When muscles are flexed, you must attach a few electrodes and read the voltage.

The sensor is designed to be worn, allowing biomedical sensor pads to be attached directly to the board. This board has a single-supply voltage range of +3.1V to +5V, a RAW EMG output, polarity-protected power pins, indication LEDs, and an On/Off switch. It also features a few shields that can be attached to the Myoware Muscle Sensor, such as Cable, Power, and Proto, to further expand its adaptability and functionality!

The MyoWare Muscle Sensor is readily interfaced with Arduino or other microcontrollers. The result of bending the muscle can be seen as a numerical value in Serial Monitor or as a graphical format on Serial Plotter.

MyoWare Muscle Sensor Kit

Myoware Muscle sensor Shields

1. Embedded Electrode Connectors:

Embedded electrode connectors allow you to apply the board to the target muscle without having to worry about cables.

2. Cable Shield:

You may still want to put the sensor pads separate from the other gear in some circumstances. The MyoWare Cable Shield is utilized in these situations.

3. Electrode Cable:

The sensor pads can be connected to the shield’s 3.5mm TRS jack connector instead of directly to the MyoWare Muscle Sensor. Because both sets of contacts will be linked, only utilise one pad for each of the reference [R], end [E], and middle [M] pins.

4. Power Shield:

The MyoWare Power Shield is designed to work with two coin cell batteries, such as CR2032s. At a nominal 3.0V, they are connected in parallel for increased capacity.

5. Proto Shield:

All signals are sent through the MyoWare Proto Shield to a piece of protoboard. This is where you’ll solder on whatever custom electronics you can think of.

6. LED Shield:

The MyoWare LED Shield is for those who want a huge display of the signal level.

Interfacing MyoWare Muscle Sensor with Arduino

Now let us interface the Myoware Muscle Sensor with the Arduino. The connection diagram is given below.

Connect the sensor’s VCC and GND to the Arduino’s 5V and GND, respectively. Since we’re sensing analog voltage, connect the analog pin to A0 on the Arduino.

Source Code/Program

The Arduino program for interfacing the Myoware EMG muscle sensor is quite straightforward. All we need is an Analog Voltage measurement.

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

void loop()
{
float sensorValue = analogRead(A1);
float millivolt = (sensorValue/1023)*5;

Serial.print(“Sensor Value: “);
Serial.println(sensorValue);

Serial.print(“Voltage: “);
Serial.print(millivolt*1000);
Serial.println(” mV”);
Serial.println(“”);
delay(1);
}

Steps to be followed to use Myoware Muscle Sensor

1. Clean the intended region well with soap to eliminate debris and oil.

2. Connect the electrodes to the sensor’s snap connectors with snap connectors.

3. Peel the electrodes’ backs off to reveal the adhesive, then stick them to the skin.

4. Place the sensor on the muscle you want to test. One of the sensor’s attached electrodes should be in the middle of the muscle body. The other electrode should be positioned parallel to the muscle length.

5. Place the reference electrode near the targeted muscle on a bony or nonadjacent muscular region of your body.

6. Follow the circuit diagram to connect the sensor to the Arduino Board.

Myoware Muscle Sensor Arduino

The Embedded Electrode Connectors can be connected directly to the muscles, as seen above. Alternatively, you can utilize the cable shield in conjunction with the cable connections as indicated below.

The extension shield has a long cable which helps in placing the sensor far away from the computer.

Testing & Results: Electromyography

EMG Muscle Sensor Arduino

You can begin testing the sensor and watching the value after uploading the code. Stretch your arm to see if the sensor is working. The muscle can then be contracted or relaxed. This will produce an analog voltage, that can be observed on Serial Monitor.

The waveform can also be seen on Serial Plotter. To do so, go to the serial plotter screen and look at the waveform while the arm moves.

Myoware Muscle Sensor Waveform

Reading EMG Data of OLED Display

Apart from the above findings, the following code can be used to read sensor data or analogue voltage on an OLED Display. But first, there was the OLED Display and the Arduino Board. Connect the OLED Display’s I2C pins (SDA & SCL) to Arduino’s A4 & A5.

EMG Sensor Project

Source Code/Program

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);


void setup()
{
Serial.begin(9600);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //initialize with the I2C addr 0x3C (128×64)
delay(500);
display.clearDisplay();
display.setCursor(30, 15);
display.setTextSize(1);
display.setTextColor(WHITE);
display.println(“Sensor”);
display.setCursor(25, 35);
display.setTextSize(1);
display.print(“Initializing”);
display.display();
delay(3000);
}

void loop()
{
float sensorValue = analogRead(A1);
float millivolt = (sensorValue/1023)*5;

Serial.print(“Sensor Value: “);
Serial.println(sensorValue);

Serial.print(“Voltage: “);
Serial.print(millivolt*1000);
Serial.println(” mV”);
Serial.println(“”);

display.clearDisplay();
display.setTextSize(1);
display.setCursor(0, 0);
display.print(“Sensor Value: “);
display.setTextSize(2);
display.setCursor(0, 10);
display.println(sensorValue,0);

display.setTextSize(1);
display.setCursor(0, 35);
display.print(“Voltage: “);
display.setTextSize(2);
display.setCursor(0, 45);
display.print(millivolt*1000);
display.println(” mv”);

display.display();

delay(1);
}

When you finish uploading the code, the OLED Display will begin displaying the value of the EMG Analog Signal as well as the voltage.

Leave a Reply

Your email address will not be published.