Skip to content

JHUBCIS/EMG-Workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EMG-Workshop

by JHUBCIS 2023.9

Dependencies

  • Visual Studio Code (VS Code)
    • One of the best IDEs out there, incredibly versatile. Definitely beats ArduinoIDE.
    • Works across Windows, Mac and Linux.
  • PlatformIO IDE
    • A VS Code extension that will practically allow you to work with any microcontroller (up to 1490 different kinds, definitely including many variants of Arduino, Adafruit, Attiny and Raspberry Pi). This is another major reason why we do not use ArduinoIDE.
  • Teleplot
    • “A ridiculously simple tool to plot telemetry data from a running program and trigger function calls.”
    • This is another VS Code extension that can practically plot any kind of serial input data. Works great with PlatformIO IDE.

Documentations

These documentations should help you better understand the hardware and software used in this workshop.

Hardware and Accompanying Libraries

  • Seeeduino v4.2
    • This is the microcontroller unit (MCU) developing board that we are using for the workshop, which is very similar to Arduino UNO R3. They are both based on the Atmega328 microcontroller family.
  • Base Shield V2
    • This conveniently remaps the pins of the Seeeduino (or Arduino UNO R3) to sockets for Grove modular components, no more jumper wires!
  • Grove - EMG Detector
    • The EMG sensor used in this workshop.

Arduino Libraries

  • Servo
    • Allows Arduino boards to control a variety of servo motors.
  • RunningAverage
    • The library stores the last N individual values in a circular buffer to calculate the running average.
  • NoDelay
    • Arduino library to make use of the Millis function for non blocking delays.
    • In this case, we use this so that the servo does not get updated too often so that its interference to the analog input significantly affects performance.

Private Library

Overview

  • Here is a flowchart of how this demo works

    image-20230930001155737

Tutorial

Getting Started

  1. First of all, please install VS Code and the relevant extensions in the Dependencies section.
  2. See this tutorial on getting started with PlatformIO IDE. It goes quite in depth on how to work with PlarformIO, and contains details in the context of VS Code.

Working with Grove EMG

  • The Grove EMG is a bipolar EMG, meaning that it acquires an EMG signal by measuring voltages between each of the two EMG surface detection electrodes (red, white) and the reference electrode (black).

  • Specifically, the surface EMG electrodes should be placed only 1– 2 cm apart between the motor unit and the tendinous insertion of the muscle, along the longitudinal midline of the muscle.

    • For this project, we recommend placing the electrodes on the bicep.
      • Red electrode: at the bulk of the muscle
      • White electrode: at the tendinous insertion
      • Black electrode: at the bottom of the elbow for reference

Setting up the EMG-Workshop project

  1. Then download this EMG-Workshop repo as a zip file to your computer. See this link for how to do so. Then unzip the folder to a location of your liking.

  2. See this official tutorial for VS Code on how to open the folder in VS Code as a Workspace.

  3. If all is installed properly, you should be able to see a window similar to this:

    image-20230926020744439
  4. Plug in your Arduino Uno (or Seeeduino) to your computer. PlatformIO should automatically identify the COM port that connects to the microcontroller.

  5. First click on “Build”, then click on “Upload” to run the code on your Arduino (Seeeduino).

  6. Now the Arduino (Seeeduino) should be running the code!

Visualizing with Teleplot

  1. On the bottom left corner, of the window, click on “Teleplot”.

  2. The settings for serial plotting are at the upper left corner of the Teleplot page.

    image-20230926022050216
  3. Make sure the baud rate is 115200. Also select the COM port that your Arduino (Seeeduino) is connected to. Then click “Open”,

    image-20230926022338356

  4. A collapsed serial monitor should show at the right of the Teleplot page.

    image-20230926022542832
    • Click on it to expand, and you should see a countdown for calibration. Click on “Reduce” to collapse it again.

      image-20230926023034014

  5. Once Calibration is complete, serial plots for the bandpass filtered EMG signal and the envelope of this signal should be displayed. Play around with the settings as you like.

    • We recommend using “light mode”, which can be set at the top right corner of the Teleplot page.
    • If you want to re-calibrate, go to the settings for serial plotting, “Close” then “Open”. Please fully relax your muscle during the calibration.
    image-20230926023522869

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages