I used MIT’s 6.2040 Analog Electronics Lab class as an excuse to work on EMG gesture detection (ASL as the gesture set to start) with two friends–Kieran Dunn and Gabriel Guillen (goats). You can find more information about it and the system here, as well as a video of it working.

Here’s our report:

Introduction

Gesture detection and recognition has numerous applications today and is a very popular area of research. For example, human-computer interaction in virtual and augmented reality environments, as well as gesture-based control of smart home and automotive devices are now major areas of technological development. In assistive devices, gesture recognition can be incredibly useful for people with disabilities, allowing them to interact with smart computer systems. Applications for sign language detection also exist, bridging communication gaps in real time.

Currently, implementations of gesture recognition systems vary widely. Some employ 3D models of hands made of collections of vectors, or even skeletal modals, to provide computer algorithms with positional information for gesture inference. Other approaches use “appearance-based algorithms,” which form 2D representations of the input and use large visual datasets of hands to find the closest matches of gestures. Numerous challenges—including variability in image quality, poor lighting, and different camera specs—exist in both of these cases. Furthermore, developing and running a general algorithm to cover such a broad range of scenarios is not only incredibly difficult but also computationally expensive.

Electromyography (EMG) is another method to achieve gesture recognition that avoids many of the aforementioned issues by looking at specific muscles. EMG measures electrical activity in response to nerve stimulation of muscles between electrodes. As muscles contract more strongly, more muscle fibers activate and produce action potentials. Between surface and invasive EMG, we will explore the use of surface EMG to evaluate muscle activity and differentiate between hand gestures based on the individual muscles activated.

The ASL alphabet was chosen as the set of gestures we would pull from due to its high practicality for communication, large amounts of documentation, and the range of motions being generally wrist and above, meaning we could constrain our electrode placement to the elbow and above

Design

At a high level, our circuit consists of 3 EMG detection circuits to measure the electrical activity of distinct muscles. These signals are then fed through a gesture detector circuit, which takes in each signal and activates a certain LED based on the output level of the signal. The combination of LEDs that are activated will allow us to see which gesture was performed, acting as 3 bits of information.

EMG Detection Circuit

The first subset of our system is the EMG detection system, which uses three electrodes to measure a muscle’s electrical activity. The first two electrodes are placed across a muscle while the ground electrode is placed in a part of the body with low muscle density such as the elbow. This allows us to read the difference in electrical action potential at each electrode as it travels down the contracting muscle while removing motion artifact noise or other sources of noise. This is fed into the EMG, which removes low and high frequency noise to isolate the primary energy of the muscles electrical activity and then performs envelope detection to smooth out the signal’s high frequency fluctuations into a general trend of its amplitude over time.

The differential amplifier is the first circuit block that the raw electrical muscle signal is sent through. Thus, the goal of the differential amplifier is to remove excess noise such as movement artifacts, electrical signals from the cables, or any other signal that affects both electrodes. This is done using an op-amp based differential amplifier where the operation amplifiers utilized were LMC6484. These were chosen for their low crossover distortion and ability to amplify very low amplitude, high frequency signals, allowing the raw EMG signal to be sent into the circuit with minimal distortion or artifacts. The next goal of the operational amplifier was to amplify the signal so it could be more easily manipulated and utilized in later stages.

The performance of the operational amplifier can be seen in the picture above. The picture on the right shows the yellow input signal and green output signal, where there is a gain of 26.63. This is less than the gain shown in the simulated performance, but this decrease in performance could be due to the challenges around viewing sub 100mV signals on the oscilloscope as well as the lack of exact resistors available in the lab. The simulated performance shown in the photo on the left displays the input sine wave in blue (the other input to the differential amplifier is sent to ground) and the output in green, and a clear gain of 50 can be seen.

Band Pass Filter

The bandpass filter is used to isolate signals only related to muscle signals. This is another stage that removes low frequency and high frequency noise that might not be common to both electrodes but still unrelated to muscle activity. Most muscle activity is within the 10 to 500 Hz range, so the configuration of the bandpass is a Sallen-Key Low Pass filter removing above 500 Hz and a Sallen-Key High Pass filter to remove sub 10 Hz signals. Both filters utilize equations of 1/sqrt(2π𝑅1𝑅2𝐶1*𝐶2) within the path of the non-inverting input. The gain of the amplifier is in the inverting input using the equation 1+1𝑘/10𝑘 which is approximately 1.

The simulated performance on the left is very similar to the actual performance on the right with both graphs having -3 dB points around 10 Hz and 500 Hz with slight variations in the exact filtered frequencies, which could be due to challenges related to inductance within breadboard rails or capacitance from component leads. Both also have a very low gain, which is to be expected.

Active Twin-T Notch Filter

The purpose of the active twin-t notch filter is to eliminate the 60Hz signal broadcast from the Prudential Tower. Given that the EMG signal input can be on the order of millivolts to microvolts, even a small 60Hz signal from Prudential could have a large impact, especially given the high amounts of gain in later stages. The decision to use an active twin-t notch filter was made due to the fact that, when analyzing the frequency response, other notch filter designs had much lower magnitude slopes around the 60Hz frequency, causing higher attenuation over a much wider range. This would have compromised our project given that EMG signals can range from 1Hz to 500Hz, and attenuating out too much of this range risks weakening our desired EMG signal. Thus, the active twin-t notch filter was selected due to its higher magnitude slopes around 60Hz, making it so that the -3dB points were within 5Hz on either side, isolating the 60Hz signal we wanted to eliminate, and minimizing the impact on our signal

Comparing the simulation of this notch filter (left image) to the physical implementation (right image), we can see a difference in the center frequency, with the physical implementation’s center frequency about 3-4 Hz higher than expected. This is mainly due to the fact that values of components needed to achieve a center frequency of exactly 60 Hz were very specific and required us to combine multiple components in series or parallel to achieve such values. This is most predictably the source of imprecision in the filter. However, this discrepancy did not impact the performance heavily, as an attenuation of -6.26 dB was still achieved for 60 Hz signals. Furthermore, the magnitude of the slopes in the bode plot were unchanged, keeping the -3dB points within 5 Hz of the center frequency, minimizing the risk of attenuating our EMG signal.

Precision Full Wave Rectifier

The purpose of the precision full wave rectifier is to bring the EMG signal to be fully positive. EMG signals are inherently both positive and negative, but both polarities carry important information about the muscle contraction, with voltage magnitude being highly correlated to strength of contraction. Thus bringing the EMG signal to be fully positive allows for easy analysis of the muscle’s contraction strength through voltage peak detection. The decision to use a precision full wave rectifier design over other rectifying designs was due to the fact many non-precision designs have an output 0.6V to 0.7V lower than the input, which was unacceptable in our project due to the low voltage magnitude and high precision of EMG signals. Thus, the precision full wave rectifier was a perfect fit due to the voltage magnitude drop across it being negligibly small, maintaining our EMG signal. As shown below, there is no significant difference between the simulated results (left) and the results from the physical implementation (right).

Low Pass Filter

A low pass filter is required at this stage to capture the lower frequency of the rectified signal and create an envelope of the EMG—these will give the desired information about overall muscle movement, as it extracts overall amplitude changes in the signal over time rather than particular frequencies of a muscle contraction. To effectively remove higher frequencies without introducing distortion, a second order Sallen-Key low pass filter is used, built with a LM324 operational amplifier. Values for the resistors and capacitors were calculated based on a desired filtering above 3.6Hz, a common frequency of muscle EMG amplitude changes over time, with the equation 3.6𝐻𝑧 = 1/sqrt(2π×𝑅1 𝑅2 𝐶1 𝐶2)

Setting C1 and C2 to 1μF and ensuring that R1 and R2 closely fulfilled Butterworth response constraints (R2 = 2R1) for a smooth, uniform response in the passband, values of 20k and 39k were used. (In testing, it was found that 39k better achieved a filter above 3.6Hz as compared to a 40k resistor).

The filter ultimately worked as expected. While the expected behavior cannot be seen on the scope, as it has a minimum frequency of 10Hz, a -3dB point of approximately 3.591Hz was observed on LTSpice.

Gain Amplifier

Finally, a non-inverting amplifier was used to achieve signal voltage values large enough for detection use. For flexibility—and to adjust toward whichever gain value best achieved those values—this gain amplifier was initially designed with a 100kΩ potentiometer resistor in series with the 1kΩ resistor. Ultimately, a gain of 100 was tested and found to be effective for the last stage of the EMG circuit, so the circuit simplified to the schematic below. The values were calculated using the equation 𝑔𝑎𝑖𝑛 = 𝑉𝑜𝑢𝑡 / 𝑉𝑖𝑛 = 𝑅2/𝑅1 + 1.

The amplifier was built with an LM324 operational amplifier and worked as expected in the final version of the circuit. The oscilloscope image below shows the gain amplifier with the potentiometer resistor (adjusted for a smaller gain) still included in the schematic for visual effect and clarity, so that both input and output signals could be clearly seen. In the final version, the gain observed more closely followed the LTSpice image below with a gain of ~40dB, or 100.

Some takeaways from the project: surface EMG, surprise surprise, is really noisy. It’s also super dependent on electrode placement. Hypothesis: signal processing on HDsEMG (high definition surface EMGs) can be really interesting.