Flex Your Muscles and Coding Skills with the FANTM EMG Shield

The FANTM EMG shield allows you to easily control games and devices with your muscle movements via a simple API.

Human-computer interfaces and EMG

Almost since the beginning of computers, humans have been trying to figure out ways in which they can interact with their creations. These have ranged from the ubiquitous keyboard/mouse combos all the way to having chips directly implanted onto their brains. One team based in Madison, Wisconsin wanted to create a human-computer interface (HCI) that was far less invasive yet allowed a microcontroller to directly read electrical signals. They came up with the FANTM, an Arduino Uno shield that uses electromyography (EMG for short) to sense when a muscle is contracting by reading the motor neurons' electrical impulses.

Designing the shield

The FANTM's design looks like most other Arduino Uno shields at first with its two rows of pin headers and assorted components on top. However, this shield has three differentiating parts. First, the PCB has a prominently placed potentiometer that can be turned to adjust the gain of the AC couple instrumentation amplifier that's connected to the 3mm jack. Additionally, there's a low pass filter onboard that removes any unwanted higher frequencies and cleans up the signal. And finally, a series of 6 jumpers on the PCB allow the user to select which analog in port they wish to use for reading in EMG values.

How the API works

For now, the FANTM's Arduino library is quite simple. After users install the Libdevlpr package from the Arduino library manager, they are greeted with a simple interface for reading, filtering, and using the FANTM DEVLPR board. It primarily uses callbacks for performing various tasks, which means the library will call whichever function was passed to it at a specific interval or when an event happens such as flexing a muscle. The API also features the ability to use various filters through the use of a lookup table that allows the user to achieve sharp cut-off values for a more accurate reading. Several windowing function exist to compute and retrieve averages, min/max values, and the latest value in the buffered data.

Recognizing muscle movements

When vertebrates want to move, their brains send signals down the spinal cord to the desired extremity, and by placing a conductive pad over that muscle, signals can be read and interpreted from it. From here, a user could theoretically register a callback that gets called whenever the shield sense a muscle flex and sends a value via USB to a host computer. In fact, there is a demonstration in the works that uses the EMG device to sense when a muscle contracts which causes the bird in a PyGame Flappy Bird clone to fly higher.

Future plans for improvement

The FANTM team plans on adding far more methods to this API in the future, including additional filtering methods and statistical analyses. They might also find a way to integrate machine learning that can recognize when certain gestures are performed for much smarter control. You can see more about the FANTM shield here on their website.

Arduino “having11” Guy
19 year-old IoT and embedded systems enthusiast. Also produce content for Hackster.io and love working on projects and sharing knowledge.
Related articles
Sponsored articles
Related articles