Recording Publication Grade Muscle Signals Using BioAmp EXG Pill
by Upside Down Labs in Circuits > Sensors
947 Views, 0 Favorites, 0 Comments
Recording Publication Grade Muscle Signals Using BioAmp EXG Pill
In this tutorial, we will be recording and visualizing muscle signals using BioAmp EXG Pill and Maker Uno.
Note: We have used Arduino Legacy IDE 1.8.X as it plots more data points on screen in a given time frame so it is better for visualization as compared to Arduino IDE version 2. Also the baud rate is set at 115200 in the serial plotter.
Now let's understand a brief about Electromyography (EMG).
What is Electromyography (EMG)?
Electromyography is a technique that measures muscle response or electrical activity in response to a nerve’s stimulation of the muscle. We can use this electrical activity to detect neuromuscular abnormalities or create solutions for some crazy real-world problems like making artificial limbs for amputees.
About BioAmp EXG Pill:
BioAmp EXG Pill is one of a kind pill-size chip that can record publication-grade biopotential signals from your body be it from the heart (ECG), brain (EEG), eyes (EOG), and muscles (EMG).
The entire BioAmp series of sensors from Upside Down Labs is designed in a way to teach you the basics of the instrumentation amplifier, active bandpass filtering, soldering, programming, neuroscience, HCI, and BCI just to name a few concepts.
Supplies
HARDWARE:
1 x BioAmp EXG Pill (with JST PH 2.0 connector and a header pin)
1 x BioAmp Cable
3 x Gel Electrodes
3 x Jumper Cables
1 x Arduino Uno / Maker Uno with USB Cable (You can also use any other microcontroller board with an ADC)
1 x Nuprep Skin Preparation Gel
1 x Wet wipe
1 x Muscle BioAmp Band (optional)
1 x Electrode Gel (only if using Muscle BioAmp Band)
SOFTWARE:
Arduino IDE
Note: You can either get DIY Neuroscience Kit Basic or BioAmp EXG Pill Packs by clicking the links below:
DIY Neuroscience Kit Basic (Upside Down Labs Store | Tindie Store | Amazon India)
BioAmp EXG Pill Pack (Upside Down Labs Store | Tindie Store)
BioAmp EXG Pill - EXG Explorer Pack (Upside Down Labs Store | Tindie Store | Amazon India)
Assembly
The BioAmp EXG Pill comes presoldered with DIY Neuroscience Kit Basic but in case you are getting BioAmp EXG Pill seperately then you will have to assemble it for this project by soldering the header pins and JST PH 2.0 connector as shown in the diagram.
Configurations for EMG
BioAmp EXG Pill is by default configured for recording EEG or EOG but if you want to record good quality ECG or EMG, then it is recommended to configure it by making a solder joint as shown in the image above.
Note: Even without making the solder joint the BioAmp EXG Pill is capable of recording ECG or EMG as well but the signals would be more accurate if you configure it.
Connecting Electrode Cable
Connect the BioAmp Cable to BioAmp EXG Pill. We have different variants of the BioAmp Cable so don't go with the color coding and focus on the REF, IN+ and IN- written on the BioAmp EXG Pill.
Skin Preparation
Apply Nuprep Skin Preparation Gel on the skin surface where electrodes would be placed to remove dead skin cells and clean the skin from dirt. After rubbing the skin surface thoroughly, clean it with a wet wipe.
About Nuprep Gel:
Nuprep skin preparation gel is a mildly abrasive, highly conductive gel that should be applied before placing the electrodes on the skin to improve measurements. When applied gently, it strips away the top layer of skin and moistens the underlying skin layer which reduces the skin impedance with minimal skin irritation and discomfort.
Electrode Placements
We have 2 options to measure the EMG signals, either using the gel electrodes or using dry electrode based EMG band. You can try both of them one by one.
Measuring EMG using Gel electrodes:
- Connect the BioAmp Cable to gel electrodes,
- Peel the plastic backing from electrodes
- Place the IN+ and IN- cables on the arm near the ulnar nerve & REF (reference) at the back of your hand as shown in the connection diagram.
Measuring EMG using Muscle BioAmp Band, a dry electrode based EMG band:
- Connect the BioAmp Cable to Muscle BioAmp Band in a way such that IN+ and IN- are placed on the arm near the ulnar nerve & REF (reference) on the far side of the band.
- Now put a small drop of electrode gel between the skin and metallic part of BioAmp Cable to get the best results.
Connections
Connect BioAmp EXG Pill to Maker Uno using the jumper cables as directed below:
- VCC to 5V
- GND to GND
- OUT to A0
Note: BE VERY CAREFUL and follow the above diagram while making the connections between your BioAmp EXG Pill & Maker Uno, especially the GND and VCC else it may damage the sensor.
Download Arduino IDE
Download the Arduino IDE from the link given below:
https://www.arduino.cc/en/software
(We have used Arduino IDE version 1.8.19 for this project)
After downloading, connect the Maker Uno to your laptop using the USB Cable (Type A to Type B)
Note: Make sure your laptop is not connected to a charger and sit 5m away from any AC appliances for best signal acquisition.
Coding Time!
Copy paste any one of the Arduino Sketches given below in Arduino IDE:
- EMG Envelop: https://github.com/upsidedownlabs/BioAmp-EXG-Pill/blob/main/software/EMGEnvelop/EMGEnvelop.ino
- EMG Filter: https://github.com/upsidedownlabs/BioAmp-EXG-Pill/blob/main/software/EMGFilter/EMGFilter.ino
After flashing the code, open the serial plotter to visualize the EMG signals.
Enjoy and Flex Your Arm
Enjoy, finally you have completed the project. Now flex your arm to visualize the muscle signals in real time on your laptop. Similarly you can try to record EMG from other parts of your body like biceps, triceps, cheeks, thighs, etc.
You are all set to explore on your own and make amazing HCI projects at the comfort zone of your home.