OpenEMG Arduino Sensor


Électronique - 18-06-2019

Major update (18/06/2019): added the new SMD version of OpenEMG.

Context

Electromyography (EMG) is an electrodiagnostic medicine technique for evaluating and recording the electrical activity produced by skeletal muscles. An electromyograph detects the electric potential generated by muscle cells when these cells are electrically or neurologically activated.

It can be a useful and intriguing sensor technology to use with Arduino or any other micro-controller. Therefore, I designed the openEMG project, an open-hardware, easy to use and very reliable EMG sensor.

OpenEMG PCB (SMD version) OpenEMG PCB (SMD version), fully populated.

With its compact form factor, this sensor board outputs an analog voltage (0 to 5V), depending of the muscular signal.

This video showcases the project:


Features & usage

This table gives the electrical caracteristics of the board.

Description Value
Input Voltage 5V
Output Voltage 0 to 5V (proportional to muscle contraction)
Maximum input current < 10 mA

OpenEMG should be wired like this:

OpenEMG wiring diagram Both muscle electrodes must be placed on the same muscle, about 2cm apart; the ground electrode should be place on a neutral zone (bone) about 5cm from the other electrodes.

On the board, there is a potentiometer to tune the gain of the output amplifier. This gain is strongly dependent on the muscle that is measured and the position of the electrodes. If it is set too high, OpenEMG will be very sensitive and output either 0 or 5V. If it is set too low, muscle contractions may not be properly picked up.

This graph shows the analog output value of OpenEMG for a series of muscle contractions (the biceps in this case):

Open EMG measurements Biceps activity measurements with OpenEMG, viewed in the Arduino serial plotter

For instance, this video shows a basic sketch that turns a servomotor based on the strength of the contraction (old THT version of the board).


The graph in the top right corner displays the output waveform of the board as it is read from the Arduino nano.

The corresponding Arduino code is the following:

#include <Servo.h>
Servo myServo = Servo(2);
void setup(){
    myServo.attach();
}
void loop(){
    myServo.write(map(analogRead(A0),0,1023,0,180));
    delay(50);
}

The circuit

OpenEMG's circuit is designed to be as simple to make as possible. This is the complete circuit diagram (click on image to view in full-screen):

Full OpenEMG circuit diagram

There are 5 parts to this circuit:

  1. The ICL7660 generates a -5V rail for the operationnal amplifiers;
  2. The first OP-amp (U1B) is a classic differential amplifier configuration;
  3. The next two OP-amps (U1A and U1D) are a second order bandpass filter with a gain of 2.5 and a frequency range of 20 Hz to 500 Hz;
  4. The last OP-amp (U1C) is an amplifier with a tunable gain from 50 to 150;
  5. Finally, D1 rectifies and C9 smoothes the signal to make it readable by a micro-controller.

The LM324 chip can be replaced with any pin-compatible quad OP-amp, such as the TL084.

Note: the C9 capacitor makes the output more micro-controller friendly. It can be removed to obtain the raw signal.

The PCB files

In these archives, you will find:

  • The KiCad circuit design files;
  • The bill of material (BOM);
  • The Gerber files for manufacturing.

I designed two versions of the PCB:

  • A standard through-hole version;
  • A more compact surface mount version.

Both version are functionnally identical.

Surface-mount (SMD) version

The surface mount (SMD) version is compact and suitable for professionnal PCB manufacturing.

PCB (SMD version)

It is 32mm×26mm, using 0805 components (fairly easy to hand-solder). I ordered panels of it on JLCPCB.

Interactive view

Download SMD version

Through-hole (THT) version

As an alternative, the through-hole (THT) version is designed to be very easy to make with DIY tools: it is a single layer board with large clearances and wide tracks.

PCB (THT version)

It is 47mm×35mm. See my article on homemade PCB manufacturing.

Interactive view

Download THT version

Safety warning: It is recommanded that the power supply of the Arduino is not connected to the wall outlet. Although it is extremely unlikely, a faulty power adapter could technically have its output connected to the live wire!

Bonus - ECG with OpenEMG

Although OpenEMG is designed for electromyography, I tried placing the electrodes near the heart (positions V3 and V4). I removed the C9 smoothing cap to get the raw capture. This graph is the result:

PCB (THT version)

We can clearly see 3 pulses per cycle, separated by 850ms (70 BPM).

Auteur : Charles Grassin


What is on your mind?

  • #1 student

    you did a really great.
    this is exactly what i was looking for.
    thank you

    on March 16 2019, 18:04

  • #2 Magansomaa

    Amazing low cost and best for choosing lm324 its very famous and easly available

    on August 5 2019, 19:24

  • #3 Magansoma

    Amazing low cost and best for choosing lm324 its very famous and easly available we have also done some cool work here and wiling to do emg also

    on August 5 2019, 19:27

  • #4 Magansoma

    Thanks a lot for sharing your precious work ! Love it !

    on August 5 2019, 19:30

  • #5 fanton

    Doesnt work, whats problems can be?

    on October 5 2019, 18:10

  • #6 Paul

    Une amélioration serait les électrodes actives (séches) qui nécessitent 2 amplis op suiveurs adaptateurs d'impédance.
    Pour l'alimentation , un étage avec le lm324 serait suffisant.
    Les filtres ne sont pas utiles. Un seul tnotchfilter a ampli op serait suffisant. Le reste serait fait par soft.Ce qui fait 4 ampli op . Pour l'amplification principale un ampli instrumentation style INXXX est suffisant et mieux car plus précis et demandant moins de composants annexes. On reste à 2 CIs, un quadri ampli Op et un ampli d'instrumentation.

    on October 21 2019, 14:09

  • #7 Chris

    great project! But why are C6, C8 and C9 so big? What do they do in this case?

    on June 15 2020, 21:38

  • #8 O.o.o.

    Thank you for your contribution. How can I cite your work?

    on June 17 2020, 10:12

  • #9 Charles

    Hi Chris,
    C6 and C8 should be electrolytic according to the datasheet of the ICL7660. Ceramic or tantalum may be fine, I have not tried.
    C9 is completely optional, and could actually be ceramic. I think I used this specific cap because it was already on the BOM.
    I am working on a OpenEMG MK2 that does not have these parts, and is much better overall.

    on June 18 2020, 19:35

  • #10 Charles

    Hi O.o.o.,
    Thank you! You can cite this work by mentioning my name, and maybe a link to this page. This is greatly appreciated!

    on June 18 2020, 19:36

  • #11 Heat_Sink

    can i make a pcb way arder using your files

    on July 2 2020, 20:40

  • #12 arduini

    pcb way is not able to read the bom files properly and same with jlcpcb, do you have cpl files

    on July 2 2020, 20:42

  • #13 Ganesh

    @Charles Nice and simple design. How did you deal with the 50Hz power line interference problem? Small cables and signal path length?

    on July 10 2020, 14:31

  • #14 Charles

    Hi Ganesh,
    Getting rid of the 50Hz interference is the main challenge for biopotentials measurements. The circuit deals with this with a differential amplifier input. This removes the common mode part of the signal, i.e. the signal that is on both electrodes . Combined with short cables to the electrodes, this cancels this interference.

    on July 11 2020, 7:59

  • #15 Josh

    Sir why in smd version have no ICL7660? Can it powered only using +5v?

    on July 25 2020, 17:51

  • #16 Charles

    Hi Josh,
    The SMD version does have a ICL7660 chip to generate a -5V rail: reference U2. For some reason, it appears unpopulated on the 3D render, but it must be present.

    on July 27 2020, 11:27

  • #17 B

    Did anybody work on such a circuit for dry electrodes?

    on November 10 2020, 15:14

  • #18 Charles

    Hi! I have been working on an "OpenEMG V2" based on an instrumentation amplifier (INA128) that could also work with dry electrodes and get better performance. However, it has some major issues that I have not been able to fix yet. Pauls' comment (in French) has some tips to achieve this. The analog circuitery is tricky...

    on November 10 2020, 17:28

  • #19 Vladimir

    Good day! I wanted to use your OpenEMG.sch circuit, but it seems to be damaged. Is there a revised version?

    on March 16 2021, 11:43

  • #20 Vladimir

    Good day! I wanted to use your OpenEMG.sch circuit, but it seems to be damaged. Is there a revised version?

    on March 16 2021, 11:44

  • #21 Bart

    Hi Charles! truly amazing project! I have a question for you ... How can I print your pcb with all the assembled components? I've never done that.

    on March 20 2021, 16:24

  • #22 Charles

    Hi Bart,
    Unfortunately, getting a PCB is quite a bit of work: getting PCBs from JLCPCB (for instance), parts from LCSC (for instance) and soldering. I think that JLCPCB or PCBWay offer an assembly service but I have never tried it. I might be able to provide PCBs in the future but I wish to make a major revision first to improve the sensitivity and reliability of the data.

    on March 26 2021, 21:28

  • #23 Konstantin

    Do you have a CLV file?

    on April 15 2021, 9:21

  Retour aux projets

Projets connexes