BioAmp EXG Pill#

v1.0

Overview#

BioAmp EXG Pill is a small, powerful analog-front-end (AFE) biopotential signal-acquisition board that can be paired with any microcontroller unit (MCU) or single-board computer (SBC) with an analog-to-digital converter (ADC) such as Arduino UNO & Nano, Adafruit QtPy, STM32 Blue Pill, BeagleBone Black, and Raspberry Pi Pico, to name just a few. It also works with any dedicated ADC, like the Texas Instruments ADS1115 and ADS131M0x, among others.

Note

It is recommended to use Arduino UNO R4 while recording biopotential signals since it has 14-bit ADC and can record the signals much accurately.

../../../_images/bioamp-exg-pill.png

What makes it different?#

  1. Record publication-quality biopotential signals like ECG, EMG, EOG, or EEG.

  2. Small size (25.4 x 10.0mm) allows easy integration into mobile and space-constrained projects.

  3. Powerful noise rejection makes it usable even when the device is close to the AC mains supply.

  4. Any 1.5 mm diameter wire can be used as a strain-relieving electrode cable, making it very cost-effective.

  5. Pair it with any MCU with an ADC. It is by default compatible with 5V but you can make it compatible with 3.3V as well using a voltage divider.

  6. Configure the gain, band pass filter and electrode count according to your requirements.

Features & Specifications#

Operating Voltage

5 V

Input Impedance

10^12 ohm

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) or any standalone ADC of your choice

BioPotentials

EMG, ECG, EOG, EEG (configurable band-pass, by default configured for EEG & EOG)

No. of channels

1

Electrodes

2 or 3 (By default configured for 3 electrodes)

Dimensions

25.4 x 10 mm

Open Source

Hardware + Software

Board layout#

BioAmp EXG Pill’s elegant design allows it to be used in 3 ways:

  1. Pin-header holes allow you to solder (berg strip) pin headers for easy use with a breadboard.

  2. Castellated holes allow you to solder BioAmp EXG Pill directly onto a custom PCB that requires biopotential-amplification capabilities.

  3. Electrode holes allow you to use any 1.5 mm diameter wire as an electrode cable with minimal strain.

../../../_images/Front_Specifications.jpg
../../../_images/Back_Specifications.jpg

BioAmp EXG Pill is fully configurable#

  1. Increase the gain of the instrumentation amplifier by using a 0603 resistor at R6. Decrease gain and configure the bandpass filter by using 0603 parts at R12 and C5. Band limiting is very useful for EOG and EEG recording. Also, the signal sometimes clips while recording an ECG with electrodes very close to the heart. Creating a solder jumper for a band-pass filter helps with that. By default, BioAmp EXG Pill is configured to record EEG and EOG but you can bridge the pads (below bandpass) with solder to make it configurable for EMG and ECG.

  2. The normal method of operation for best-quality signal amplification is to use 3 electrodes by default but you can bridge the pads (below electrodes) to make it configurable for 2 electrodes. The 2-electrode mode is specifically included for projects like heart (ECG) patches for HRV. It’s only supposed to be used with a battery-operated setup and is quite prone to high interference noise due to a lack of proper reference on the body (This option is not recommended for most operations)

Software requirements#

  • Before you start using the kit, please download Arduino IDE v1.8.19 (legacy IDE). Using this you’ll be able to upload the arduino sketches in your development board and visualise the data on your laptop.

../../../_images/arduino-ide.png
  • Download Backyard Brains’ Spike Recorder according to the operating system you are using (Windows, OSX, Linux).

../../../_images/byb.png

Using the Hardware#

If you have received the assembled BioAmp EXG Pill then you can skip the step 1 and move on to step 2.

Step 1: Solder Connectors#

Insert the provided BioAmp cable’s JST PH connector and header pins from top as shown in the image and solder them from below.

../../../_images/assembly-step1.png

Soldering the connector & header pins on BioAmp EXG Pill#

../../../_images/bioamp-exg-pill-soldered.png

After soldering, BioAmp EXG Pill should look like this#

Step 2 (optional): Configure for ECG/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.

../../../_images/assembly-step2.png

Note

Even without making the solder joint the BioAmp EXG Pill is capable of recording ECG or EMG but the signals would be more accurate if you configure it.

Step 3: Connect MCU/ADC#

Connect your BioAmp EXG Pill to your MCU/ADC as per the connection table shown below:

BioAmp to MCU/ADC connection#

BioAmp

MCU/ADC

VCC

5V

GND

GND

OUT

ADC Input

For all the examples provided, we are using the A0 pin of Arduino UNO R3. Connect your BioAmp to your MCU/ADC via jumper cables provided in the kit. If you are connecting OUT pin of BioAmp to any other analog pin (A0-A5) of Arduino UNO board, then you will have to change the INPUT PIN in the Arduino sketch accordingly.

../../../_images/connections-with-arduino.png

Connections with Arduino UNO R3#

Warning

Take precautions while connecting to power, if power pins are to be swapped, your BioAmp EXG Pill will be fried and it’ll become unusable (DIE).

Step 4: Connecting electrode cable#

Connect the BioAmp cable to BioAmp EXG Pill by inserting the cable end in the JST PH connector as shown in the graphic below.

../../../_images/connection-with-cable.png

Connections with BioAmp Cable v3#

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 Skin Preparation Guide.

Step 6: Measuring ElectroMyoGraphy (EMG)#

Note

Electromyography (EMG) is a technique for evaluating and recording the electrical activity produced by skeletal muscles. EMG is also used as a diagnostic procedure to assess the health of muscles and the nerve cells that control them (motor neurons). EMG results can reveal nerve dysfunction, muscle dysfunction, or problems with nerve-to-muscle signal transmission.

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.

../../../_images/emg.png
  • 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.

Tip

Visit the complete documentation on how to assemble and use the BioAmp Bands or follow the youtube video given below.

Tutorial on how to use the band:

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#

Connect the 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

EMG Envelope

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.

Important

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#

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

../../../_images/EMGEnvelop.jpg

Step 6: Measuring ElectroCardioGraphy (ECG)#

Note

Electrocardiography (ECG) is the process of producing an electrocardiogram (ECG or EKG). It is a graph of voltage versus time of the electrical activity of the heart using electrodes placed on the skin. These electrodes detect the small electrical changes that are a consequence of cardiac muscle depolarization followed by repolarization during each cardiac cycle (heartbeat).

Electrodes placement#

We have 2 options to measure the ECG signals, either using the gel electrodes or using dry electrode based Heart 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- cable on the left side, IN+ in the middle and REF (reference) on the far right side as shown in the diagram.

../../../_images/ecg.png
  • Using Heart BioAmp Band:

  1. Wear the band as depicted in the video tutorial given below

  2. Place the IN- cable on the left side, IN+ in the middle and REF (reference) on the far right side.

  3. Now put a small drop of electrode gel between the skin and metallic part of BioAmp cable to get the best results.

Tip

Visit the complete documentation on how to assemble and use the BioAmp Bands or follow the youtube video given below.

Tutorial on how to use the band:

Uploading the code#

Connect Arduino Uno to your laptop using the USB cable (Type A to Type B). Copy paste the Arduino Sketch given below in Arduino IDE v1.8.19 that you downloaded earlier:

ECG Filter

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 signals.

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

Important

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

Visualizing the ECG signals#

Sit back, relax and see your ECG signals in real time on your laptop.

../../../_images/bioamp-Exg-Pill-ECG.jpg

Step 7: Measuring Electrooculography (EOG)#

Note

Electrooculography (EOG) is a technique for measuring the corneo-retinal standing potential that exists between the front and the back of the human eye. The resulting signal is called EOG. To measure eye movement, pairs of electrodes are typically placed either above and below the eye or to the left and right of the eye. If the eye moves from the center position toward one of the two electrodes, this electrode “sees” the positive side of the retina, and the opposite electrode “sees” the negative side of the retina. Consequently, a potential difference occurs between the electrodes. Assuming the resting potential is constant, the recorded potential is a measure of the eye’s position.

Electrodes placement#

We have 2 ways to measure the EOG signals, either record the horizontal eye movement or the vertical eye movement. You can one by one record both the signals.

  • Horizontal EOG recording:

../../../_images/eog-horizontal.png
  1. Connect the BioAmp cable to gel electrodes.

  2. Peel the plastic backing from electrodes.

  3. Place the IN- cable on the right side of the eye, IN+ on the left side of the eye and REF (reference) at the bony part, on the back side of your earlobe as shown in the diagram above.

  • Vertical EOG recording:

../../../_images/eog-vertical.png
  1. Connect the BioAmp cable to gel electrodes.

  2. Peel the plastic backing from electrodes.

  3. Place the IN- & IN+ cables above and below the eye respectively and REF (reference) at the bony part, on the back side of your earlobe as shown in the diagram above.

Uploading the code#

Connect Arduino Uno to your laptop using the USB cable (Type A to Type B). Copy paste the Arduino Sketch given below in Arduino IDE v1.8.19 that you downloaded earlier:

EOG Filter

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 signals.

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

Important

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

Visualizing the EOG signals#

Move your eyes up-down or left-right to see your EOG signals in real time on your laptop.

../../../_images/bioamp-exg-pill-eog.jpg

Step 8: Measuring Electroencephalography (EEG)#

Note

Electroencephalography (EEG) is an electrophysiological monitoring method to record electrical activity on the scalp. During the procedure, electrodes consisting of small metal discs with thin wires are pasted onto your scalp. The electrodes detect tiny electrical charges that result from the activity of your brain cells which are then amplified to appear on the computer screen. It is typically non-invasive, with the electrodes placed along the scalp.

For recording EEG from different parts of the brain, you have to place the electrodes according to the International 10-20 system for recording EEG.

../../../_images/10-20-system.png

Electrodes placement#

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

  • Using gel electrodes to record from prefrontal cortex part of brain:

../../../_images/eeg.png
  1. Connect the BioAmp cable to gel electrodes.

  2. Peel the plastic backing from electrodes.

  3. Place the IN+ and IN- cables on Fp1 and Fp2 as per the International 10-20 system & REF (reference) at the bony part, on the back side of your earlobe as shown above.

  • Using Brain BioAmp Band to record from prefrontal cortex part of brain:

  1. Connect the BioAmp cable to Brain BioAmp Band in a way such that IN+ and IN- are placed on Fp1 and Fp2 as per the International 10-20 system.

  2. In this case, the REF (reference) should be connected using gel electrode. So connect the reference of BioAmp cable to the gel electrode, peel the plastic backing and place it at the bony part, on the back side of your earlobe.

  3. Now put a small drop of electrode gel on the dry electrodes (IN+ and IN-) between the skin and metallic part of BioAmp cable to get the best results.

Tip

Visit the complete documentation on how to assemble and use the BioAmp Bands or follow the youtube video given below.

Tutorial on how to use the band:

Note

Similarly you can use the band to record EEG signals from the visual cortex part of brain by placing the dry electrodes on O1 and O2 instead of Fp1 and Fp2. Everything else will remain the same.

Uploading the code#

Connect Arduino Uno to your laptop using the USB cable (Type A to Type B). Copy paste the Arduino Sketch given below in Arduino IDE v1.8.19 that you downloaded earlier:

Spike recorder arduino code

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 development board is connected. To find out the right COM port, screen disconnect your board and reopen the menu. The entry that disappears should be the right COM port. Now upload the code.

Important

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

Visualizing the EEG signals#

Open the Spike Recorder software. When the Spike Recorder starts, it will start recording from your microphone. To change that, go to the settings by clicking the first icon on the top left corner of the screen, select the COM port on which your Arduino UNO is connected and click on connect.

../../../_images/spike-recorder-configurations.jpg

Spike Recorder settings#

Mute the speakers and apply the 50Hz notch filter by clicking on the checkbox as shown in the screenshot above. You should set the low band pass filter to 1Hz and high bandpass filter to 40Hz as we are only recording the EEG signals which range between these frequencies.

Now everything is configured and connected. So close the settings window and start recording EEG signals.

../../../_images/bioamp-exg-pill-eeg.png

EEG signals being visualised in Spike Recorder#

The signals that you can see on the screen right now are originating from prefrontal cortex part of your brain and propagating through all the layers to the surface of your skin.

To record these EEG signals, you have placed the electrodes on the forehead (Fp1 & Fp2), then BioAmp EXG Pill is amplifying those signals so that we can detect it and finally sending it to the ADC (Analog to Digital Convertor) of your Arduino Uno. Ultimately the signals are being visualized in Spike Recorder software.

We hope everything is clear now and you understand how the signals are propagating from your brain to the screen of the laptop.

Features of Spike Recorder that you can explore:

  • Increase or decrease the scale of the Y axis by clicking on the + and - icons respecitively that is present on the left side of the graph.

  • Increase or decrease the X axis timescale by sliding up and down on the scroll wheel of the mouse.

  • Visualize the FFT graph by clicking on the FFT icon on top left size of the screen.

  • Record the data in .wav format by clicking the record icon on the top right corner. You can convert this data in any other format according to your project requirements.

  • Listen to the signals by clicking the volume icon on the top right corner. No don’t smile right now, that’s how your brain sounds like :P

Glimpses of previous versions#

The BioAmp EXG Pill can be used in a variety of ways, the YouTube video below shows a potential way of using v0.7 of BioAmp EXG Pill.

A lot has improved in terms of interference rejection and flexibility from v0.7 to v1.0 of the BioAmp EXG Pill. The YouTube video below shows the ECG, EMG, EOG, and EEG recording using v1.0b of device.

Real-world Applications#

BioAmp EXG Pill is perfect for researchers, makers, and hobbyists looking for novel ways to sample biopotential data. It can be used for a wide variety of interesting biosensing projects, including:

  • AI-assisted detection of congestive heart failure using CNN (ECG)

  • Heart-rate variability calculation to detect heart ailments (ECG)

  • Prosthetic arm (servo) control (EMG)

  • Controlling a 3DOF robotic arm (EMG)

  • Real-time game controllers (EOG)

  • Blink detection (EOG)

  • Capturing photos with a blink of an eye (EOG) and many more examples.

Project ideas & tutorials#

Projects on Instructables

Below are some projects made by students using the BioAmp EXG Pill.

Controlling video game using brainwaves (EEG)
Visualising electrical impulses from eyes (EOG)
Recording EEG from visual cortex
Recording EEG from prefrontal cortex
Eye blink detection
Creating a drowsiness detector
Record publication-grade ECG
Measuring heart rate
Detecting heart beats
Record publication-grade EMG
Detecting up and down movement of eyes

These are some of the project ideas but the possibilities are endless. So create your own Human Computer Interface (HCI) and Brain Computer Interface (BCI) projects and share them with us at contact@upsidedownlabs.tech.

Software tutorials#

1. Getting started with Backyard Brains’ Spike Recorder

2. Getting started with Brainbay