Muscles have electricity!
This is a continuation of Part 1 of the robotic arm competition. The first part was just a basic introduction into what the competition was all about. This part will talk about the electromyograph (EMG) sensor.
First off, what is EMG? An EMG is very similar to an electrocardiograph (ECG). An ECG is a print out of the electrical activity of your heart. The muscle contractions of your heart are controlled by the electrical impulses generated by the sinoatrial node (which is in your heart). These electrical impulses can be measured similar to any other electricity.
Electrocardiograph (ECG) showing a normal sinus rhythm
All the muscles in your body operate in much the same way. When you flex a muscle, an electrical impulse is send through a nerve. This impulse can be measured and recorded in a process called electromyography. See Wikipedia for more details.
Electrical impulses can be measured from your body in a very simple way. You take a piece of metal (called an electrode), attach a wire to it and tape it on somewhere close to a nerve. There's nothing special about an electrode, they can be made from any piece of metal and a wire.
Home made electrodes made by soldering wire to a penny and attached with scotch tape. Probably not a good idea in terms of safety, but the concept is sound. We have proper medical grade electrodes so no need to worry. The bottom line is this, if you want to take an EMG reading of your bicep, you take two electrodes, put them on your bicep and flex. In practice you will need a third electrode which is connected to a part of your body with few nerves (elbow). This is needed because everyone's body has some voltage (potential). If you measure your body with respect to a battery's negative terminal (GND) you would see some voltage. This third electrode is called a body ground and it allows us to cancel out the body's voltage with respect to the power supply of the EMG. This is shown in the schematic below.
Electrode placement on bicep for EMG
As you may imagine, the electrical impulses in your muscles are very small (you can't shock someone by flexing) which means they need to be amplified several hundred times to be measured properly. Therefore the first step in building an EMG is to build an amplifier.
Instrumentation Amplifier
Meet the instrumentation amplifier. Every biomedical engineer will have seen this by the time they graduate. Guaranteed. This circuit is used in every type of bioelectrical signal acquisition (EMG, ECG, EEG, etc...). It works like a differential amplifier:
1) Plug your input into V1 and V2.
2) Any voltage that the two inputs have in common is rejected. This means that if the V1 = 1.50034V and V2 = 1.50068V, the two voltages share a common 0.00034V (1.50068 - 1.50034).
3) The common voltage is then amplified several hundred (or thousand) times. The exact amount of amplification can be set by changing the value of Rg (Rgain).
4) The output is then some voltage which is large enough to easily measure.
The AD620 IC made by Analog Devices
One problem with this is that the op-amps on the left need to be exactly identical, also the resistors all need to be identical. If they are not, then the voltage from one of the inputs could be just a little bit higher than it should be (0.01V) and then when it gets amplified a thousand times, that offset makes any readings useless (0.01V x 1000 = 10V). Since this is almost impossible to do in practice, all three op-amps and resistors are usually found in a single chip such as the AD620 (except Rg which you connect yourself). This has the advantage of having perfectly identical op-amps and laser trimmed resistors but costs about $6. See wikipedia for more details.
The EMG circuit for use with the Arduino
Now that the EMG signals can be amplified, we need to construct a circuit to power the amplifier and connect the output to the Arduino.
The first step is the power supply. All power is supplied by a 9V battery. This battery is connected to the Vin pin on the Arduino. The Arduino has a 5V voltage regulator, so that takes the 9V from the battery and converts that into 5V. All the electronics on the Adruino use 5V. The Arduino conveniently has a 5V pin which allows us to access this 5V, so we will use it to power the amplifier circuit. The 5V shown on the schematic is the 5V regulated output from the Arduino.
Arduino Duemilanove
Op-amps require a split power supply which means that they need a positive and negative voltage. This is because op-amps amplify voltage. Op-amps can be configured to have a gain of 100 000 or more, but the maximum output voltage is limited to the voltage you put into the op-amp. In this case we will supply the op-amps with +2.5V and -2.5V. This means the output from the op-amp will always be between -2.5V and +2.5V for a total range (swing) of 5V. To create the split power supply, we used a buffered voltage source and a voltage divider. The voltage divider is simply two equal resistors. If you put 5V across both resistors, there will be 2.5V in the middle. The problem is that if you connect something to the 2.5V, it will add to the resistance (technically reduce resistance since it is in parallel). Changing the value of one of the resistors will mean the divider does not split voltage evenly, so you will no longer get 2.5V.
To fix this problem we buffered the voltage source by connecting it to a standard 741 op-amp. If you connect a voltage to one input of an op-amp, the device will create a voltage at the other input to match it. So 2.5V at the positive terminal means the op-amp creates 2.5V at the negative terminal. The negative terminal is then connected to the output to create a feedback loop. So now the output of the op-amp is also 2.5V. The result is that if you connect something to the output, the op-amp will simply draw more power from its own power supply to make sure the negative terminal is still 2.5V (since the positive terminal is still 2.5V). In this way, you have a constant 2.5V source, known as a buffered voltage source. The reason we need this is because now we can use the 2.5V as a reference. If you measure between 2.5V and 5V you will get +2.5V. If you measure between 2.5V and 0V you get -2.5V. Therefore, using 2.5V as a reference, you have a split ±2.5V power supply.
The rest of the circuit is for the AD620 (AR1) instrumentation amplifier. It takes two inputs from a muscle, and also takes one input from a body ground (usually elbow). The circuit attached to AR2 is called a ground driver. It is used to reduce noise and help reject common signals between the two muscle inputs (recall that any voltage in common between the inputs should be removed so that only the difference is amplified, hence creating a differential amplifier).
Two diodes are also added across the inputs to improve safety. The idea is that the voltage across a muscle is usually in the mV range. A diode will "turn on" at 0.7V. So if there is ever more that 0.7V across the inputs (say from a short circuit), the diodes will provide a current path with much less resistance than your body. When a diode is on, it will have very little resistance but your body will have between 300Ω and 1500Ω, so current will go through the circuit rather then your body. It should be noted that each of these op-amps have short circuit protection and the Arduino power supply has a fuse of 500mA. On top of that all the current here is all DC, so you can do more harm to yourself by licking a 9V battery.
To fully understand how the circuit work requires some knowledge of op-amps as well as amplifiers, but beyond that it's nothing special. The purpose of this article is to show that making an EMG is really not that hard. Furthermore, this circuit can be used to capture ECG signals. The only difference is that an ECG requires at least 4 electrodes to be useful so you will have to make two amplifier circuits (both with a common ground driver). Also you will need to adjust the gain resistor Rg to make sure the signal does not hit the rail (when the output tries to go higher than the supply voltage). Finally the analog input on the Arduino is not very accurate, so you will need to use a better ADC. Other that these difficulties the concept is the same. See Einthoven's triangle for more details.
Stay tuned for part 3 & 4 when we go over the actual building of the circuit and the new arm prototype (it launches ping-pong balls)!
3 comments
This is nice article and love to know about electrical activity of our heart. i came to know that all the muscles in your body operate same to same way . When we move our a muscle, an electrical impulse is send through a nerve. This impulse can be measured and recorded in a process called electromyography. And all these can be measured by EMG method and these are the things which Lifealert.
pass4sure 642-481This is nice article and love to know about electrical activity of our heart. i came to know that all the muscles in your body operate same to same waypass4sure EC0-350This is nice article and love to know about electrical activity of our heart. i came to know that all the muscles in your body operate same to same waypass4sure E20-593This is nice article and love to know about electrical activity of our heart. i came to know that all the muscles in your body operate same to same waypass4sure 000-330
Wow this is an amazing article about the human mechanism measurement electrically. I didn't have much knowledge about it previously just seen in the hospitals to measure the pulse of the patients or for the Medical Alert. Now, after going through this post i have got the concept of how it works. This is all about what i learned in physics in my school. It's total implementation just thrilled me out. Looking forward to learn more from this blog.