Skip to content

Commit

Permalink
Merge pull request upsidedownlabs#38 from bhawnasehgal/main
Browse files Browse the repository at this point in the history
Update content for BioAmp hardware
  • Loading branch information
lorforlinux authored Apr 29, 2024
2 parents 83395f7 + 6997423 commit f218213
Show file tree
Hide file tree
Showing 51 changed files with 788 additions and 382 deletions.
528 changes: 346 additions & 182 deletions hardware/bioamp/bioamp-exg-pill/index.rst

Large diffs are not rendered by default.

Binary file not shown.
Binary file removed hardware/bioamp/bioamp-exg-pill/media/ECG.jpg
Binary file not shown.
Binary file removed hardware/bioamp/bioamp-exg-pill/media/EEG.jpg
Binary file not shown.
Binary file removed hardware/bioamp/bioamp-exg-pill/media/EKG.jpg
Binary file not shown.
Binary file removed hardware/bioamp/bioamp-exg-pill/media/EMG.jpg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hardware/bioamp/bioamp-exg-pill/media/ecg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hardware/bioamp/bioamp-exg-pill/media/eeg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hardware/bioamp/bioamp-exg-pill/media/emg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 26 additions & 20 deletions hardware/bioamp/bioamp-v1.5/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,21 +193,21 @@ You can get your own BioAmp v1.5 bag of parts from our `online stores <https://l
Using the kit
*****************

.. image:: media/bioamp-v1-5-connections.*
The image below shows the possibilities of using BioAmp v1.5. Seems complicated? Don't worry, we'll explain each and every step in detail. So follow along to create your own setup.

The image above shows the possibilities of using BioAmp v1.5. Seems complicated? Don't worry, we'll explain each and every step in detail. So follow along to create your own setup.
.. image:: media/bioamp-v1-5-connections.*

Step 1: Connecting the cables
==================================

.. image:: media/board-with-cables.*
Connect the BioAmp cable, 9V snap cable and BioAmp AUX cable to BioAmp v1.5 by inserting the cable ends in the respective JST PH connectors as shown below.

Connect the BioAmp cable, 9V snap cable and BioAmp AUX cable to BioAmp v1.5 by inserting the cable ends in the respective JST PH connectors as shown above.
.. image:: media/board-with-cables.*

Step 2: 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.
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 an alcohol wipe or a wet wipe.

For more information, please check out detailed step by step :ref:`skin-preparation`.

Expand All @@ -216,15 +216,17 @@ Step 3: Electrode placements

We have 2 options to measure the EMG signals, either using the gel electrodes or using dry electrode based Muscle BioAmp Band. You can try both of them one by one.

- **Using gel electrodes:**
Using gel Electrodes
-----------------------

1. Connect the BioAmp cable to gel electrodes.
2. Peel the plastic backing from the electrodes.
3. 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.

.. image:: media/bioamp-v1-5-emg.*

- **Using Muscle BioAmp Band:**
Using Muscle BioAmp Band
----------------------------

1. 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.
2. Now put a small drop of electrode gel between the skin and metallic part of BioAmp cable to get the best results.
Expand All @@ -240,12 +242,12 @@ Connect any 9V battery to BioAmp v1.5 using the 9V snap cable. Now activate the

.. image:: media/9v-battery.*

Step 5: Listen to Your Muscle Signals
Step 5: Listen to your muscle signals
======================================

You can either listen to the muscle signals (EMG) on a speaker or wired earphones/headphones. Let's try both of them.

Listening EMG on speakers
Using speakers
-----------------------------

1. Connect the BioAmp AUX cable on a bluetooth speaker that have 3.5mm jack support.
Expand All @@ -254,7 +256,7 @@ Listening EMG on speakers

.. image:: media/listening-emg-2.*

Listening EMG on a wired earphones/headphones
Using wired earphones/headphones
----------------------------------------------

1. Plug your wired earphones or headphones on the 3.5mm jack of BioAmp v1.5.
Expand All @@ -263,14 +265,12 @@ Listening EMG on a wired earphones/headphones

.. image:: media/listening-emg-3.*

Step 6: Visualize the EMG signals on mobile phone
Step 6: Visualize EMG signals on mobile phone
===================================================

Connect the BioAmp AUX cable to your mobile phone/tablet that has 3.5mm jack support.

Now there are various options to visualize the EMG signals:
Connect the BioAmp AUX cable to your mobile phone/tablet that has 3.5mm jack support. Now you can use various apps to visualise the signals.

Using Phone Recorder
Using Phone Recorder app
--------------------------

1. Open any audio recorder app on your mobile tablet.
Expand All @@ -279,12 +279,17 @@ Using Phone Recorder

.. image:: media/emg-in-mobile-2.*

Using Backyard Brains' Spike Recorder
--------------------------------------
Using Backyard Brains' Spike Recorder mobile app
------------------------------------------------

1. Download the `Spike Recorder App <https://play.google.com/store/apps/details?id=com.backyardbrains&pli=1>`_ from playstore.
2. Open the app, click the setting icon on the top right corner and set the recording type to EMG.
3. Apply the 50Hz or 60Hz notch filter depending on the country you are living in. For example if you are in India then the AC current oscillates at a frequency of 50Hz but it oscillates at 60Hz frequency in USA. This AC current acts as a noise in the signals so we have to remove it by applying this notch filter.

.. image:: media/spike-recorder-mobile.*
:width: 80%
:align: center

4. Again click on the setting icon to close it and you are ready.
5. Flex your muscles to be able to visualize the muscle signals (EMG).
6. You can record the EMG data as a .wav file by pressing the record button on the top right corner of the app and then convert it in any other format as per your project requirements.
Expand All @@ -294,16 +299,17 @@ Using Backyard Brains' Spike Recorder
Step 7: Visualize the EMG signals on laptop
============================================

Connect the BioAmp AUX cable to your laptop that has 3.5mm jack support.

Now there are various options to visualize the EMG signals:
Connect the BioAmp AUX cable to your laptop that has 3.5mm jack support. Now you can install various softwares on your laptop to visualise the signals.

Using Backyard Brains' Spike Recorder
--------------------------------------------

1. Install the spike recorder software that you downloaded earlier.
2. Open the software, click the setting icon on the top right corner and set the low band pass filter to 72Hz and high band pass filter to 720Hz.
3. Apply the 50Hz or 60Hz notch filter depending on the country you are living in. For example if you are in India then the AC current oscillates at a frequency of 50Hz but it oscillates at 60Hz frequency in USA. This AC current acts as a noise in the signals so we have to remove it by applying this notch filter.

.. image:: media/spike-recorder-laptop.*

4. Again click on the setting icon to close it and you are ready.
5. Flex your muscles to be able to visualize the muscle signals (EMG)
6. You can record the EMG data as a .wav file by pressing the record button on the top right corner of the app and then convert it in any other format as per your project requirements.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 12 additions & 7 deletions hardware/bioamp/muscle-bioamp-biscute/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Step 1: Connect Arduino UNO R3

.. image:: media/arduino-biscute-connection.*

Connect VCC to either 5V or 3.3V, GND to GND, and OUT to Analog pin A0 of your Arduino UNO via jumper cables provided by us. If you are connecting OUT to any other analog pin, then you will have to change the INPUT PIN in the arduino sketch accordingly.
Connect ``VCC`` to either ``5V`` or ``3.3V``, ``GND`` to ``GND``, and ``OUT`` to ``Analog pin A0`` of your Arduino UNO via jumper cables provided by us. If you are connecting ``OUT`` to any other analog pin, then you will have to change the INPUT PIN in the arduino sketch accordingly.

**Note:** For demonstration purposes we are showing connections of the sensor with Arduino UNO R3 but you can use any other development board or a standalone ADC of your choice.

Expand All @@ -223,13 +223,16 @@ Connect the BioAmp cable to Muscle BioAmp Biscute by inserting the cable end in
Step 4: 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.
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 an alcohol wipe or a wet wipe.

For more information, please check out detailed step by step :ref:`skin-preparation`
For more information, please check out detailed step by step :ref:`skin-preparation`.

Step 5: Measuring EMG (ElectroMyoGraphy)
===============================================

Electrodes placement
---------------------

We have 2 options to measure the EMG signals, either using the gel electrodes or using dry electrode based Muscle BioAmp Band. You can try both of them one by one.

- **Using gel electrodes:**
Expand All @@ -253,25 +256,27 @@ We have 2 options to measure the EMG signals, either using the gel electrodes or

.. note:: In this demonstration we are recording EMG signals from the ulnar nerve, but you can record EMG from other areas as well (biceps, triceps, legs, jaw etc) as per your project requirements. Just make sure to place the IN+, IN- electrodes on the targeted muscle and REF on a bony part.

**Uploading the code:**
Uploading the code
---------------------

Connect your Arduino UNO to your laptop using the USB cable (Type A to Type B). Copy paste any one of the arduino sketches given below in Arduino IDE v1.8.19 that you downloaded earlier:

EMG Filter: https://github.com/upsidedownlabs/Muscle-BioAmp-Arduino-Firmware/blob/main/2_EMGFilter/2_EMGFilter.ino

EMG Envelope: https://github.com/upsidedownlabs/Muscle-BioAmp-Arduino-Firmware/blob/main/3_EMGEnvelope/3_EMGEnvelope.ino

Go to **"tools"** from the menu bar, select **"board"** option then select Arduino UNO. In the same menu,
Go to ``tools`` from the menu bar, select ``board`` option then select Arduino UNO. In the same menu,
select the COM port on which your Arduino Uno is connected. To find out the right COM port,
disconnect your board and reopen the menu. The entry that disappears should be the
right COM port. Now upload the code, & open the serial plotter from the tools menu to visualize
right COM port. Now upload the code, & open the serial plotter from the ``tools`` menu to visualize
the EMG signals.

After opening the serial plotter make sure to select the baud rate to 115200.

.. warning:: Make sure your laptop is not connected to a charger and sit 5m away from any AC appliances for best signal acquisition.

**Visualizing the EMG signals**
Visualizing the EMG signals
----------------------------

Now flex your arm to visualize the muscle signals in real time on your laptop.

Expand Down
155 changes: 133 additions & 22 deletions hardware/bioamp/muscle-bioamp-blip/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@
Muscle BioAmp Blip
###################

A mikroBUS™ compatible ElectroMyography (EMG) sensor for precise recording of muscle signals.

Overview
*********

Muscle BioAmp Blip is single channel mikroBUS™ compatible ElectroMyography (EMG) sensor for precise muscle signal recording.
It allows you to add the EMG functionality to your projects at ease. You can either connect it to any mikroBUS port or even
Muscle BioAmp Blip [#]_ is single channel mikroBUS™ [#]_ compatible ElectroMyography (EMG) sensor for precise muscle signal recording.
It allows you to add the EMG functionality to your projects at ease. You can either connect it to any mikroBUS port or even
a breadboard to get started.

.. figure:: media/muscle-bioamp-blip.*
:width: 800
:align: center



Features & Specifications
*****************************

Expand All @@ -29,7 +28,7 @@ Features & Specifications
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Bandpass filter | 72 – 720 Hz |
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Compatible Hardware | Any development board with an ADC (Arduino UNO & Nano, Espressif ESP32, Adafruit QtPy, STM32 Blue Pill, BeagleBone Black, Raspberry Pi Pico, to name just a few) |
| Compatible Hardware | Any development board with an ADC (Arduino UNO & Nano, Adafruit QtPy, STM32 Blue Pill, BeagleBone Black, Raspberry Pi Pico, to name just a few) |
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| BioPotentials | EMG (Electromyography) |
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Expand Down Expand Up @@ -71,28 +70,140 @@ Images below shows a quick overview of the hardware design.
:align: center
:width: 400

Connecting with Arduino
****************************
Assembled PCB

To get started, you can pair Muscle BioAmp Blip with any development board with an ADC (Arduino UNO & Nano, Espressif ESP32,
Adafruit QtPy, STM32 Blue Pill, BeagleBone Black, Raspberry Pi Pico, to name just a few) or any standalone ADC of your choice.
Contents of the kit
********************

To measure the EMG signals, connect BioAmp Cable v3 with your muscle sensor as shown in the image below:
.. image:: media/blip-kit-contents.*

.. figure:: media/arduino-connections.*
Software requirements
**********************

.. Using the sensor
.. ******************
- Before you start using the kit, please download `Arduino IDE v1.8.19 (legacy IDE) <https://www.arduino.cc/en/software>`_. Using this you'll be able to upload the arduino sketches on your development board and visualise the data on your laptop.

.. image:: ../../../kits/diy-neuroscience/basic/media/arduino-ide.png

.. .. youtube:: lPX2TGBcHOA
.. :width: 100%
.. :align: center
Using the kit
****************

Some project ideas
********************
Step 1: Soldering connector & header pins
============================================

Solder the header pins and JST Ph 2.0mm connector on the Muscle BioAmp Blip as shown below. If you ordered assembled kit then you can skip this step and directly move to step 2.

.. image:: media/soldering-blip.*

Step 2: Connections with the sensor
========================================

There can be various ways of connecting the Muscle BioAmp Blip. Some of the options are given below:

Directly connecting jumper cables
-----------------------------------

You can directly connect the male to female jumper cables on the header pins of Muscle BioAmp Blip at ``5V``, ``GND``, ``AN``.

.. image:: media/blip-with-jumper-cables.*

Connecting on breadboard
---------------------------

If you are thinking to connect more components/sensors and want to integrate Muscle BioAmp Blip in the complete circuit then it will be better to use a breadboard. Snap the Muscle BioAmp Blip on the breadboard and connect the jumper cables (male to male) at ``5V``, ``GND``, ``AN``.

.. image:: media/blip-with-breadboard.*

Connecting via mikroBUS port
-----------------------------

You can also connect the Muscle BioAmp Blip to any hardware that has mikroBUS™ port like mikroBUS™ shuttle, mikroBUS™ Arduino UNO Click Shield to name a few.

.. image:: media/blip-with-shuttle.*

Step 3: Connecting with Arduino UNO R3
=======================================

Connect ``5V`` of the sensor to ``5V`` of your Arduino UNO, ``GND`` to ``GND``, and ``AN`` to ``Analog pin A0`` via other end of the jumper cables. If you are connecting ``AN`` to any other analog pin, then you will have to change the `INPUT PIN` in the example arduino sketch accordingly.

.. image:: media/blip-arduino-connections.*

.. note:: For demonstration purposes we are showing connections of the sensor with Arduino UNO R3 but you can use any other development board or a standalone ADC of your choice.

Step 4: Connecting electrode cable
========================================

Connect the BioAmp cable to Muscle BioAmp Blip by inserting the cable end in the JST PH connector as shown.

.. image:: media/blip-bioamp-cable.*

Step 5: 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 an alcohol wipe or a wet wipe.

For more information, please check out detailed step by step :ref:`skin-preparation`.

Step 6: Electrodes placement
===============================================

We have 2 options to measure the EMG signals, either using the gel electrodes or using dry electrode based Muscle BioAmp Band. You can try both of them one by one.

Using gel electrodes
----------------------

1. Connect the BioAmp cable to gel electrodes,
2. Peel the plastic backing from electrodes
3. 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.

.. figure:: media/emg-connections-1.*

Muscle BioAmp Blip with breadboard

.. figure:: media/emg-connections-2.*

Muscle BioAmp Blip directly connected via jumper cables

Using Muscle BioAmp Band
---------------------------

1. 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.
2. Now put a small drop of electrode gel between the skin and metallic part of BioAmp cable to get the best results.

**Tutorial on how to use the band:**

.. youtube:: xYZdw0aesa0
:align: center
:width: 100%

.. note:: In this demonstration we are recording EMG signals from the ulnar nerve, but you can record EMG from other areas as well (biceps, triceps, legs, jaw etc) as per your project requirements. Just make sure to place the IN+, IN- electrodes on the targeted muscle and REF on a bony part.

Step 7: Uploading the code
=============================

Connect your Arduino UNO R3 to your laptop using the USB cable (Type A to Type B). Copy paste any one of the arduino sketches given below in Arduino IDE v1.8.19 that you downloaded earlier:

EMG Filter: https://github.com/upsidedownlabs/Muscle-BioAmp-Arduino-Firmware/blob/main/2_EMGFilter/2_EMGFilter.ino

EMG Envelope: https://github.com/upsidedownlabs/Muscle-BioAmp-Arduino-Firmware/blob/main/3_EMGEnvelope/3_EMGEnvelope.ino

Go to ``tools`` from the menu bar, select ``board`` option then select Arduino UNO. In the same menu,
select the COM port on which your Arduino Uno is connected. To find out the right COM port,
disconnect your board and reopen the menu. The entry that disappears should be the
right COM port. Now upload the code, & open the serial plotter from the ``tools`` menu to visualize
the EMG signals.

After opening the serial plotter make sure to select the baud rate to 115200.

.. warning:: Make sure your laptop is not connected to a charger and sit 5m away from any AC appliances for best signal acquisition.

Step 8: Visualizing the EMG signals
=====================================

Now flex your arm to visualize the muscle signals in real time on your laptop.

.. image:: media/emg-recording.*

.. We have curated a playlist for you which consists some awesome project ideas for you to get started with your next HCI project.
.. rubric:: Footnotes

.. .. youtube:: https://youtube.com/playlist?list=PLtkEloJ7UnkQIoz1HK4IXWujCB8hKdiKU&si=osloTX71TE7AJ3CF
.. :width: 100%
.. :align: center
.. [#] Please not that click board is a registered trademark of MIKROE thus you might see a white mark on the Muscle BioAmp Blip v0.1 pcbs (since the sensor was named as Muscle BioAmp Click earlier).
.. [#] mikroBUS™ is a socket standard developed by MIKROE which enables hundreds of Click boards™ to be connected to the microcontroller or microprocessor.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f218213

Please sign in to comment.