by WallySci

An affordable, open source all-in-one bio-sensing platform

View all updates Nov 10, 2020

Human-Robot Interface using EMG Sensor

by Varan Gupta

WallySci’s EMG sensor is used to capture the electrical activity of skeletal muscles via three electrodes. The captured signals are filtered and amplified which is then presented in the form of Analog Output. An EMG sensor can be used for prototyping devices which function on muscle signal, e.g, prosthetic arm or leg, and physiotherapy devices.

Disclaimer: Not for clinical use. Only for educational purposes.

What is Electromyography (EMG)?

Movement of various body parts is caused by contraction of “Skeletal muscles” that are connected to the bones. The skeletal muscles come under the voluntary control of the somatic nervous system. When you decide to move a muscle, your brain (or spinal cord) activates a motor neuron that is connected to that group of skeletal muscle fibers via a neuromuscular junction (synapse). Once a motor neuron is activated, electrical impulses (also known as action potentials) travel along the motor neurons to each neuromuscular junction (synapse). This action potential stimulates the muscle cell causing the contraction of the muscle, thereby moving the bone attached to it. Electromyography (EMG) is a technique to capture and analyze these electrical signals of the muscle by using electrodes. The following figure shows the basic anatomy of skeletal muscle.

Basic anatomy of skeletal muscle.

When you want to measure the electrical activity of a muscle group with an EMG sensor, two electrodes (separated by an approx 2" distance) are placed on the surface of the skin near the muscle group. A third electrode (referred to as a reference electrode) is placed on the surface of the skin close to a bone, E.g., elbow. The sensor measures the difference in potential between two electrodes w.r.t. the reference electrode. This signal is amplified and filtered at multiple stages before it is sent to the DCPU module. These signals can further be analyzed for interpreting muscle activity. Many interesting applications can be built utilizing this signal.

Project Aim

One of the applications of EMG signals is in controlling prosthetics. Accurately measuring these signals at the right position on the body can enable an amputee to control a prosthetic limb [1]. In this experiment, we will learn how to capture the muscle activation signals corresponding to the movement of the wrist, process it, and actuate an Origami based griper.

Connections between DCPU, EMG Sensor and Servo motor

See the EMG sensors in action below:


  • Connect all the components according to the connection diagram and attach the servo motor to the Kirigami based gripper as shown in the figure.

EMG gripper setup.

  • First, we need to capture the signals from the EMG sensor connected to one of the 6 Analog input channels of the DCPU. The reference electrode will be placed at the back of the palm (or somewhere close to the bone with least muscle activity). The other two electrodes will be placed just above the flexor carpi radialis muscle in order to capture the wrist movements.

Flexor carpi radialis muscle on left forearm (credit: Wikipedia.com)

  • To visualize the signal in the GUI, select the channel to which EMG is connected. Sample EMG data corresponding to wrist movements is shown in the image below.

EMG sample data.

  • The next step is to send the data from the DCPU to the Python program running on a computer and filter the data. The following images show the various stages of filtering done in Python.

    1. Raw EMG data corresponding to 4 wrist movements as visualized in Python:

2. Rectified data (only 1 burst shown):

3. Applied moving average filter with 25 window size:

4. Binarization of the signal based on a threshold value:

5. Complete waveform:

  • Once binarization is complete, send the data back to DCPU in order to actuate the gripper.
  • Then DCPU will command the servo motor to rotate thereby moving the gripper.

About the Author

Varan Gupta


$13,386 raised

of $4,000 goal

334% Funded! Order Below

Product Choices


E3K Combo

The E3K Combo is the full set of modules: One Wi-Fi and BLE-enabled Data Communication and Processing Unit (DCPU) with ESP32-DevKitC-32E, one EMG sensor, two ECG/EEG sensors, and one IMU sensor. The Combo also comes with one electrode cable and five electrode pads.



WallySci is committed to fostering an environment for hands-on exploration at the interface of computer science, robotics, and bioengineering. E3K is especially designed for students and researchers, the robust, high-performance sensors provide an opportunity for rapid prototyping of hacker devices and unconstrained scientific quest. "Seriously Quirky Bio-sensing"

Varan Gupta

Sanjeev Thukral

See Also

Subscribe to the Crowd Supply newsletter, highlighting the latest creators and projects: