Troubleshooting Myoelectric Signal Amplification and Rectification

Thread Starter

Rossosaurus

Joined Aug 23, 2019
24
Hi All,

Here is a link to the circuit diagram and other images that may be useful

I've been looking at creating a circuit that take the signal from a muscle amplifies it using an In-Amp and then rectify it using a precision rectifier. I've been using the circuit diagram in this pdf I got from a chap on reddit as a reference I have the precision rectifier working and I can put + or - 5V in to it and it ouputs +5V both times but I don't seem to be able to get an amplified voltage out of the In-Amp. No matter what it seems to just supply 5V permanently no matter the gain or input. Originally I thought the in amp was busted so I bought a few others to try (CJMCU-29, CJMCU-8221, INA-126P) but they all have the same problem so it must be something I'm doing wrong. The output I'm looking for is a varying voltage depending on how much the muscle if contracted in this case my bicep. The electrodes I am using on my arm are some stainless steel bolt heads on the inside of some bands I 3D printed that way I can use crocodile clips on threaded part of the bolt to connect the electrodes to the circuit. I might be a little bit in over my head with this project but that's where I tend to learn the most. Sorry if I haven't provided any information that is needed but I will do my best to add anything that is needed. Thanks in advance.
 

Attachments

TeeKay6

Joined Apr 20, 2019
573
Hi All,

Here is a link to the circuit diagram and other images that may be useful

I've been looking at creating a circuit that take the signal from a muscle amplifies it using an In-Amp and then rectify it using a precision rectifier. I've been using the circuit diagram in this pdf I got from a chap on reddit as a reference I have the precision rectifier working and I can put + or - 5V in to it and it ouputs +5V both times but I don't seem to be able to get an amplified voltage out of the In-Amp. No matter what it seems to just supply 5V permanently no matter the gain or input. Originally I thought the in amp was busted so I bought a few others to try (CJMCU-29, CJMCU-8221, INA-126P) but they all have the same problem so it must be something I'm doing wrong. The output I'm looking for is a varying voltage depending on how much the muscle if contracted in this case my bicep. The electrodes I am using on my arm are some stainless steel bolt heads on the inside of some bands I 3D printed that way I can use crocodile clips on threaded part of the bolt to connect the electrodes to the circuit. I might be a little bit in over my head with this project but that's where I tend to learn the most. Sorry if I haven't provided any information that is needed but I will do my best to add anything that is needed. Thanks in advance.
Some initial observations that likely do not explain the problem of the output being stuck at +5V, but need to be resolved anyway.
1. The INA126P does need bypass caps from the pos and neg power supply terminals to ground, via very short leads. This info is hidden near the end of the datasheet. (Try searching the datasheet for "bypass".)
2. The LM358 also would usually require bypass caps from pins 8 and 4 to ground.
3. Power for the LM358: You show pin8 = +5V, but it is unclear what power is attached to pin4.
4. I am not familiar with myoelectric signals. What range of voltages do you expect to find at the input terminals of the INA126P? Are these myoelectric signals of rapidly alternating polarity? (Because you use AC coupling into the LM358 rectifier stage.)
5. What test equipment do you have? VOM? Oscilloscope? Power supply?
 

TeeKay6

Joined Apr 20, 2019
573
Hi All,

Here is a link to the circuit diagram and other images that may be useful

I've been looking at creating a circuit that take the signal from a muscle amplifies it using an In-Amp and then rectify it using a precision rectifier. I've been using the circuit diagram in this pdf I got from a chap on reddit as a reference I have the precision rectifier working and I can put + or - 5V in to it and it ouputs +5V both times but I don't seem to be able to get an amplified voltage out of the In-Amp. No matter what it seems to just supply 5V permanently no matter the gain or input. Originally I thought the in amp was busted so I bought a few others to try (CJMCU-29, CJMCU-8221, INA-126P) but they all have the same problem so it must be something I'm doing wrong. The output I'm looking for is a varying voltage depending on how much the muscle if contracted in this case my bicep. The electrodes I am using on my arm are some stainless steel bolt heads on the inside of some bands I 3D printed that way I can use crocodile clips on threaded part of the bolt to connect the electrodes to the circuit. I might be a little bit in over my head with this project but that's where I tend to learn the most. Sorry if I haven't provided any information that is needed but I will do my best to add anything that is needed. Thanks in advance.
@Rossosaurus
The ina126, like all semiconductor amplifiers, has an input bias current at each input, and a difference between the current at each input, known as the input-offset current. It appears to me that your very minimal contact areas (bolt heads) may be insufficiently conductive (through the muscle being examined) so that the ina126 bias currents are far larger than your input signal currents. That is, the circuit may be behaving as though there are no input signals connected. BiasCurrent*OpenCircuitResistance=LargeVoltage.
 

TeeKay6

Joined Apr 20, 2019
573
@Rossosaurus
The ina126, like all semiconductor amplifiers, has an input bias current at each input, and a difference between the current at each input, known as the input-offset current. It appears to me that your very minimal contact areas (bolt heads) may be insufficiently conductive (through the muscle being examined) so that the ina126 bias currents are far larger than your input signal currents. That is, the circuit may be behaving as though there are no input signals connected. BiasCurrent*OpenCircuitResistance=LargeVoltage.
@Rossosaurus
Testing the INA126: If you connect the two input terminals together and then connect them to ground of your circuit, the output of the INA126 should not be at + or -5V; it should be much closer to 0V (relative to circuit ground). Note that the INA126 has higher bias currents than the AD8221 used in the Muscle Sensor V3 (the brochure to which you gave a link). What value are you using for Rg to set gain of the INA126?
 

TeeKay6

Joined Apr 20, 2019
573
@Rossosaurus
Testing the INA126: If you connect the two input terminals together and then connect them to ground of your circuit, the output of the INA126 should not be at + or -5V; it should be much closer to 0V (relative to circuit ground). Note that the INA126 has higher bias currents than the AD8221 used in the Muscle Sensor V3 (the brochure to which you gave a link). What value are you using for Rg to set gain of the INA126?
@Rossosaurus
If the schematic sketch you provide is actually what you have built, then there will be problems. In addition to my previous notes, I find that the LM2662 requires two capacitors for operation; such capacitors are not shown in your schematic. Can you provide a schematic that exactly matches what you have built--showing pin numbers and component values?

As I previously noted, I have no experience with myoelectric projects. However, I have to question whether the minuscule contact area of the screw heads will be sufficient contact area. Is no conductive coating of the skin (e.g. salt water) suggested prior to placing the screw heads against the skin?
 

Thread Starter

Rossosaurus

Joined Aug 23, 2019
24
@TeeKay6 , @danadak

Thanks for all the information. I'm out today as it's currently a bank holiday (nationwide day off) here in the UK but I'll read everything and get back tomorrow. Just typing this in case it was seeming like i'm one of those pillocks that asks a question and never replies.

Tah
Ross
 

TeeKay6

Joined Apr 20, 2019
573
@TeeKay6 , @danadak

Thanks for all the information. I'm out today as it's currently a bank holiday (nationwide day off) here in the UK but I'll read everything and get back tomorrow. Just typing this in case it was seeming like i'm one of those pillocks that asks a question and never replies.

Tah
Ross
Thank you. Everyone will wait with bated breath... :)
 

Thread Starter

Rossosaurus

Joined Aug 23, 2019
24
@TeeKay6

Hi there, busy day again today so I haven't got round to actually testing stuff with circuits. To answer some of your questions though:
1. pin4 of the LM358 is attached to the same -5 volts as the INA126P. I have no idea why I drew the IC for one of the and the op amp symbol for the other I drew this schematic a while ago now.
2. Myoelectric signals range from about 10uV to 1mV at anywhere from ~3Hz to 300Hz so about that I would guess.
3. As for test equipment. I have a standard digital multimeter for measuring voltage and the like. I'm using an Arduino Uno as a power supply as I plan on passing the rectified signal to some form of micro controller to manipulate things based on the myoelectric signal.
4. For gain I've tried various values. Now that I have all this information I plan on rebuilding the circuit as this project has been on the shelf for a few months now so rebuilding the circuit with the new information I have seems a good idea. What value for gain would you recommend? 5000ish?
5. As a quick reference to what I'm planning on using this for I'm planning on making my own prosthesis, though as I am not actually an amputee the amount of information I have bout the contacts used on electronic prosthetics is somehat limited. I asked a subreddit for people using prosthetics and the answer I got was that most brands where stainless steel sometimes gold plated. Though it is entirely possible they use some form of coupling fluid to pass the signal.

If you are interested in myoelectrics here is a pdf that same chap on reddit linked me about myoelectrics generally.

Thanks again for this information. I'll do my best to work on the project tonight or tomorrow.
 

TeeKay6

Joined Apr 20, 2019
573
@TeeKay6

Hi there, busy day again today so I haven't got round to actually testing stuff with circuits. To answer some of your questions though:
1. pin4 of the LM358 is attached to the same -5 volts as the INA126P. I have no idea why I drew the IC for one of the and the op amp symbol for the other I drew this schematic a while ago now.
2. Myoelectric signals range from about 10uV to 1mV at anywhere from ~3Hz to 300Hz so about that I would guess.
3. As for test equipment. I have a standard digital multimeter for measuring voltage and the like. I'm using an Arduino Uno as a power supply as I plan on passing the rectified signal to some form of micro controller to manipulate things based on the myoelectric signal.
4. For gain I've tried various values. Now that I have all this information I plan on rebuilding the circuit as this project has been on the shelf for a few months now so rebuilding the circuit with the new information I have seems a good idea. What value for gain would you recommend? 5000ish?
5. As a quick reference to what I'm planning on using this for I'm planning on making my own prosthesis, though as I am not actually an amputee the amount of information I have bout the contacts used on electronic prosthetics is somehat limited. I asked a subreddit for people using prosthetics and the answer I got was that most brands where stainless steel sometimes gold plated. Though it is entirely possible they use some form of coupling fluid to pass the signal.

If you are interested in myoelectrics here is a pdf that same chap on reddit linked me about myoelectrics generally.

Thanks again for this information. I'll do my best to work on the project tonight or tomorrow.
@Rossosaurus
Thanks for additional info and link.
I notice that your schematic shows no connection of Ref to circuit ground; I suggest you add that connection if it is not already in place.
I suggest that, after confirming that your breadboard still works as before your break, you connect the INA126 in+, in-, and Ref terminals together (via leads/wires/probes is okay), with some reasonable value for Rg in place (e.g.gain in 100-1000 range). Is the INA126 output still at +5V? If yes, then we need to fix that before proceeding.
 

Vinnie90

Joined Jul 7, 2016
86
Hi All,

Here is a link to the circuit diagram and other images that may be useful

I've been looking at creating a circuit that take the signal from a muscle amplifies it using an In-Amp and then rectify it using a precision rectifier. I've been using the circuit diagram in this pdf I got from a chap on reddit as a reference I have the precision rectifier working and I can put + or - 5V in to it and it ouputs +5V both times but I don't seem to be able to get an amplified voltage out of the In-Amp. No matter what it seems to just supply 5V permanently no matter the gain or input. Originally I thought the in amp was busted so I bought a few others to try (CJMCU-29, CJMCU-8221, INA-126P) but they all have the same problem so it must be something I'm doing wrong. The output I'm looking for is a varying voltage depending on how much the muscle if contracted in this case my bicep. The electrodes I am using on my arm are some stainless steel bolt heads on the inside of some bands I 3D printed that way I can use crocodile clips on threaded part of the bolt to connect the electrodes to the circuit. I might be a little bit in over my head with this project but that's where I tend to learn the most. Sorry if I haven't provided any information that is needed but I will do my best to add anything that is needed. Thanks in advance.
Cool project! I've done something similar in college...couple of suggestions. It might be worthy DC couple the input of the instrumentation amplifier. There might be some DC voltage coming from muscles that you don't want to amplify (maybe that's why your output is stuck to +5V. Also it might be useful look at the spectrum of the signal with an oscilloscope. When I did it I had some noise coming from the electrodes that I was screwing the muscles signals (in that case I added a low pass with cut off at around 1kHz).
Last suggestion that can probably improve a bit your SNR is to use instead of metal bars some ECG electrodes (they are not very expensive and your signal will greatly improve with those) like these:
https://shop.openbci.com/products/e...MIu4CGiIWk5AIVCavsCh3huQo5EAYYASABEgLKFfD_BwE

Good Luck ;)
 

TeeKay6

Joined Apr 20, 2019
573
Cool project! I've done something similar in college...couple of suggestions. It might be worthy DC couple the input of the instrumentation amplifier. There might be some DC voltage coming from muscles that you don't want to amplify (maybe that's why your output is stuck to +5V. Also it might be useful look at the spectrum of the signal with an oscilloscope. When I did it I had some noise coming from the electrodes that I was screwing the muscles signals (in that case I added a low pass with cut off at around 1kHz).
Last suggestion that can probably improve a bit your SNR is to use instead of metal bars some ECG electrodes (they are not very expensive and your signal will greatly improve with those) like these:
https://shop.openbci.com/products/e...MIu4CGiIWk5AIVCavsCh3huQo5EAYYASABEgLKFfD_BwE

Good Luck ;)
@Vinnie90
I think this is a typo:"It might be worth DC coupling the input of the instrumentation amplifier. There might be some DC voltage coming from muscles that you don't want to amplify (maybe that's why your output is stuck to +5V." I think you meant "It might be worth AC coupling..."

I think the best solution would be to allow the user to choose AC or DC coupling for a particular experiment. Likewise, a choice of gains should be available via switch selection.

However, our first task is to understand why the amp output is sitting at +5V. :)
 

Thread Starter

Rossosaurus

Joined Aug 23, 2019
24
@TeeKay6 @Vinnie90

Afternoon Chaps,

So finally got around to wiring stuff today. Good news is when I hooked up VIN+, VIN- and Ref together and then to ground I got ~40mV with a gain of 150-200 Ohms (I used a variable resistor so I didn't have to spend half the day looking through the pack of ~500 resistors, one day I'll get round to sorting them). Anyway I did that and seeing as it worked I thought I would try using the electrode band things I rigged up. However using those still only outputs 5V(It's actually 4.3V but I think thats probably because there's a little bit of a drop off on the -V power supply) so I'm guessing it must be something to do with my janky electrodes. I bought some clip on electrodes and cables like @Vinnie90 recommended so when they have arrived I will try those. On a sort of seperate note could someone explain the purpose of the bypass capacitors? I'm not really sure what the purpose of them is.

I've attached an image of the circuit diagram I used for the INA126 sorry if it's a bit confusing I'm still getting used to EAGLE.

Thanks again
 

Attachments

Vinnie90

Joined Jul 7, 2016
86
@Vinnie90
I think this is a typo:"It might be worth DC coupling the input of the instrumentation amplifier. There might be some DC voltage coming from muscles that you don't want to amplify (maybe that's why your output is stuck to +5V." I think you meant "It might be worth AC coupling..."

I think the best solution would be to allow the user to choose AC or DC coupling for a particular experiment. Likewise, a choice of gains should be available via switch selection.

However, our first task is to understand why the amp output is sitting at +5V. :)
Correct AC coupling :p The main problem is that depending how you position the electrodes and even without any muscle activity you might have some tens of millivolts. I believe that's why the output is always at 5V. So probably you want them always AC coupled. For gain selection since the system is already with an arduino, you could use a 10k digital potentiometer that you can control software.

@TeeKay6 @Vinnie90

Afternoon Chaps,

So finally got around to wiring stuff today. Good news is when I hooked up VIN+, VIN- and Ref together and then to ground I got ~40mV with a gain of 150-200 Ohms (I used a variable resistor so I didn't have to spend half the day looking through the pack of ~500 resistors, one day I'll get round to sorting them). Anyway I did that and seeing as it worked I thought I would try using the electrode band things I rigged up. However using those still only outputs 5V(It's actually 4.3V but I think thats probably because there's a little bit of a drop off on the -V power supply) so I'm guessing it must be something to do with my janky electrodes. I bought some clip on electrodes and cables like @Vinnie90 recommended so when they have arrived I will try those. On a sort of seperate note could someone explain the purpose of the bypass capacitors? I'm not really sure what the purpose of them is.

I've attached an image of the circuit diagram I used for the INA126 sorry if it's a bit confusing I'm still getting used to EAGLE.

Thanks again
Can you try to measure with the multimeter the voltage at the inputs of the INA? That maybe will give us a hint whether on not you need decoupling. What happens is that if you have a DC voltage at the input of your INA that will be amplified too. Now say you have 50mV of DC voltage and your amplification factor is 100, at the output you will have 5V only of DC voltage and thus the saturation of the op amp. The way to avoid it, is to place a bypass capacitor to eliminate the the DC voltage at the inputs of the INA (I'm attaching the schematic of the circuit I used) and since you are already there you can buffer your signal.
Screen Shot 2019-08-28 at 10.53.09 AM.png
Another important point is that you need three electrodes for the ECG where one is the reference, and then you can convert it to a single end output with your instrumentation amplifier.
 

TeeKay6

Joined Apr 20, 2019
573
Correct AC coupling :p The main problem is that depending how you position the electrodes and even without any muscle activity you might have some tens of millivolts. I believe that's why the output is always at 5V. So probably you want them always AC coupled. For gain selection since the system is already with an arduino, you could use a 10k digital potentiometer that you can control software.



Can you try to measure with the multimeter the voltage at the inputs of the INA? That maybe will give us a hint whether on not you need decoupling. What happens is that if you have a DC voltage at the input of your INA that will be amplified too. Now say you have 50mV of DC voltage and your amplification factor is 100, at the output you will have 5V only of DC voltage and thus the saturation of the op amp. The way to avoid it, is to place a bypass capacitor to eliminate the the DC voltage at the inputs of the INA (I'm attaching the schematic of the circuit I used) and since you are already there you can buffer your signal.
View attachment 184947
Another important point is that you need three electrodes for the ECG where one is the reference, and then you can convert it to a single end output with your instrumentation amplifier.
@Vinnie90
Good advice. However, C1 & C2 in your schematic are not bypass caps, they are coupling caps or DC-blocking caps.
 

Vinnie90

Joined Jul 7, 2016
86
@Vinnie90
Good advice. However, C1 & C2 in your schematic are not bypass caps, they are coupling caps or DC-blocking caps.
Man today I really have trouble in explaining things :p when I said bypass capacitor I meant AC coupling capacitors. With that said I won't say anything more with the risk of any other mistake :D
 

TeeKay6

Joined Apr 20, 2019
573
@TeeKay6 @Vinnie90

Afternoon Chaps,

So finally got around to wiring stuff today. Good news is when I hooked up VIN+, VIN- and Ref together and then to ground I got ~40mV with a gain of 150-200 Ohms (I used a variable resistor so I didn't have to spend half the day looking through the pack of ~500 resistors, one day I'll get round to sorting them). Anyway I did that and seeing as it worked I thought I would try using the electrode band things I rigged up. However using those still only outputs 5V(It's actually 4.3V but I think thats probably because there's a little bit of a drop off on the -V power supply) so I'm guessing it must be something to do with my janky electrodes. I bought some clip on electrodes and cables like @Vinnie90 recommended so when they have arrived I will try those. On a sort of seperate note could someone explain the purpose of the bypass capacitors? I'm not really sure what the purpose of them is.

I've attached an image of the circuit diagram I used for the INA126 sorry if it's a bit confusing I'm still getting used to EAGLE.

Thanks again
@Rossosaurus
How and why to bypass:
https://forum.allaboutcircuits.com/threads/decoupling-or-bypass-capacitors-why.45583/
https://www.allaboutcircuits.com/te...ry-ic-part-1-understanding-bypass-capacitors/
https://www.allaboutcircuits.com/te...-2-choosing-and-using-your-bypass-capacitors/
https://forum.allaboutcircuits.com/...or-when-there-is-no-ac-voltage-source.143818/
 

TeeKay6

Joined Apr 20, 2019
573
Man today I really have trouble in explaining things :p when I said bypass capacitor I meant AC coupling capacitors. With that said I won't say anything more with the risk of any other mistake :D
@Vinnie90
Indeed, it is so sad that you cannot be perfetc likt th resst of us! :D:D:D A few typos here and there do not invalidate the message.
 

TeeKay6

Joined Apr 20, 2019
573
@Vinnie90
Indeed, it is so sad that you cannot be perfetc likt th resst of us! :D:D:D A few typos here and there do not invalidate the message.
@Rossosaurus
As @Vinnie90 has recommended, consider DC-blocking caps at the + and - inputs, but not at the Ref input. In Vinnie90's schematic, also note R1 and R2. The input bias currents of the INA126 still need a path to ground. Thus R1 and R2 provide that path and unfortunately, at the same time, provide additional load on the myoelectric source and, also unfortunately at the same time, create interfering voltages (Ibias*R). Thus there will be some best compromise values for C1,C2,R1,R2. An INA with low input bias currents is therefore an advantage. The INA126 is not among the low input bias current INA's but it is among the low cost INA's. I have not kept current on what the market offers for INA's so I don't have a recommendation.

Perhaps other commenters (including typo-prone @Vinnie90 :)) can offer INA suggestions?
 
Top