Troubleshooting Myoelectric Signal Amplification and Rectification

Vinnie90

Joined Jul 7, 2016
86
@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?
A couple of comments on what @TeeKay6 just posted:
- In addition to the noise consideration you should also consider where you place the pole for the RC section (in principle you want it as low as possible to cut only the DC component and not useful frequency content, however this usually requires a pretty big value for R from which the Ibias consideration)
- I think a good way to avoid that is to use a dual op amp so that the Ibias are kind of matched and therefore they can be rejected by the Differential amplifier (which remember has a very high CMRR)
But yes in general better to use JFET buffer input because I think that the vast majority of cheap Instrumentation amplifiers have bipolar inputs (not sure on that tho)
 

TeeKay6

Joined Apr 20, 2019
573
A couple of comments on what @TeeKay6 just posted:
- In addition to the noise consideration you should also consider where you place the pole for the RC section (in principle you want it as low as possible to cut only the DC component and not useful frequency content, however this usually requires a pretty big value for R from which the Ibias consideration)
- I think a good way to avoid that is to use a dual op amp so that the Ibias are kind of matched and therefore they can be rejected by the Differential amplifier (which remember has a very high CMRR)
But yes in general better to use JFET buffer input because I think that the vast majority of cheap Instrumentation amplifiers have bipolar inputs (not sure on that tho)
@Vinnie90
I agree except: Unless a dual device specifically specifies matched bias currents, you can very safely assume that each bias current can take on whatever spec applies, independent of the other inputs. Since matched bias currents would be a plus in the marketplace, you can be sure that a manufacturer would proclaim such if it were true (for example, see the datasheet for the LM158 where an input offset current spec is given). Otherwise, the only guaranteed matching is that indicated by the "input offset voltage" spec, and that is solely for voltage, not current.
 

TeeKay6

Joined Apr 20, 2019
573
@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?
@Rossosaurus
Although there are several mfrs of INA's, here are some low input bias current models from Analog Devices:
AD8220, AD8221, AD8228. I have not reviewed other specs than bias current and prices; they are likely higher than INA126, but for small quantity projects such as yours, a few dollars more may be worth it.
 

Thread Starter

Rossosaurus

Joined Aug 23, 2019
24
Afternoon again chaps,
Gonna try and answer stuff from each comment in order to try and make it less confusing at least for me when I no doubt go back and read this six million times to try and wrap my head around this stuff.

First off @Vinnie90 :
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.

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.
I feel like this is probably the cause after reading this comment. Anyway I went ahead and measured the DC (I assummed it was DC voltage you wanted as you were talking about DC intereference amplifying and masking the output) voltage of each of these while they were hooked up to some even more janky electrodes on my arm. If these results are weird the proper electrodes and cables should arrive tomorrow or the day after. I got somewhat mixed result and it took a while but in the end the results that were the most consistent were these while my arm was relaxed: VIN+(Middle)=~-10mV, VIN-(End)=~-55mV, Ref(Non-muscle skin)= 0. Hope this helps.

Next @TeeKay6
As @Vinnie90 has recommended, consider DC-blocking caps at the + and - inputs, but not at the Ref input.
Will do this for when I get the proper electrodes. I assume these caps just causes the DC to build up on one side or the cap which prevents it from going over to the other side because of the dielectric? Forgive my ignorance but wouldn't this block one of the polarities of the AC current as well. As I said in my initial post I'm a bit in over my head and my only circuit knowledge is one chapter at A-Level physics.

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.
Also noted

In addition to the noise consideration you should also consider where you place the pole for the RC section (in principle you want it as low as possible to cut only the DC component and not useful frequency content, however this usually requires a pretty big value for R from which the Ibias consideration)
I'm not sure I fully understand this bit. An RC circuit is like a low pass/high pass filter right to get rid of the DC interference? But what is the pole? Is there a good article on this site about it I could read for a better understanding?

- I think a good way to avoid that is to use a dual op amp so that the Ibias are kind of matched and therefore they can be rejected by the Differential amplifier (which remember has a very high CMRR)
But yes in general better to use JFET buffer input because I think that the vast majority of cheap Instrumentation amplifiers have bipolar inputs (not sure on that tho)
Think I might need an explanation on this aswell, sorry :/

@Vinnie90
I agree except: Unless a dual device specifically specifies matched bias currents, you can very safely assume that each bias current can take on whatever spec applies, independent of the other inputs. Since matched bias currents would be a plus in the marketplace, you can be sure that a manufacturer would proclaim such if it were true (for example, see the datasheet for the LM158 where an input offset current spec is given). Otherwise, the only guaranteed matching is that indicated by the "input offset voltage" spec, and that is solely for voltage, not current.
@Rossosaurus
Although there are several mfrs of INA's, here are some low input bias current models from Analog Devices:
AD8220, AD8221, AD8228. I have not reviewed other specs than bias current and prices; they are likely higher than INA126, but for small quantity projects such as yours, a few dollars more may be worth it.
I'm guessing choosing a different In-Amp would be a good idea then? I have a breakout board for an AD8221 but it doesn't have any pins to manipulate the gain. Am I better off just buying a couple of SMD to DIP boards and buying the SMD variant? I also have an INA129 (Board is an CJMCU-29) which has a mini pot for gain but that one doesn't have a pin out for the reference pin.

Thanks again for this you two, it is much appreciated

Ross
 

Vinnie90

Joined Jul 7, 2016
86
I feel like this is probably the cause after reading this comment. Anyway I went ahead and measured the DC (I assummed it was DC voltage you wanted as you were talking about DC intereference amplifying and masking the output) voltage of each of these while they were hooked up to some even more janky electrodes on my arm. If these results are weird the proper electrodes and cables should arrive tomorrow or the day after. I got somewhat mixed result and it took a while but in the end the results that were the most consistent were these while my arm was relaxed: VIN+(Middle)=~-10mV, VIN-(End)=~-55mV, Ref(Non-muscle skin)= 0. Hope this helps.
How much do you amplify your signal (what is the value of your Rg)? The INA amplifies the voltage difference between the inverting and non inverting input. In your case it's already 45mV....with a gain of 100 you already get 4.5V.

Will do this for when I get the proper electrodes. I assume these caps just causes the DC to build up on one side or the cap which prevents it from going over to the other side because of the dielectric? Forgive my ignorance but wouldn't this block one of the polarities of the AC current as well. As I said in my initial post I'm a bit in over my head and my only circuit knowledge is one chapter at A-Level physics
That will depend on the frequency of the AC signal. I don't want to be super lengthy but there are two ways to look at it. Electrical engineers think about impedance (which is the equivalent of resistance but in the complex number domain) . Capacitors' impedance is 1/iwC (where i is the imaginary unit, w is the radial frequency); for low frequencies capacitor's impedance is high (current will not flow very easily), high frequencies impedance is low (current will flow easily). In the extreme case of w->0, Impedance is infinite and therefore no current flows (this is the DC case).
The other way it's more a physics approach. You can calculate how fast your capacitor charges and discharges, if the dis/charging time constant is bigger than the period of your AC signal, then it will pass. It might be worth it for you looking on the internet...plenty of stuff on the subject.
I'm not sure I fully understand this bit. An RC circuit is like a low pass/high pass filter right to get rid of the DC interference? But what is the pole? Is there a good article on this site about it I could read for a better understanding?
yes the pole in this case corresponds to the cut off frequency of the low pass filter. If you google transfer function low pass filter you'll find all the information you need.
Think I might need an explanation on this aswell, sorry :/
The INA126 is an instrumentation amplifier (again google it to understand what that is). This topology is used in instruments to amplify very weak signals (that's also the reason why you are using it!). One of the benefits of these amplifiers is that the CMRR is very high. The CMRR is an indication of how much of the signal common both to the inverting and non inverting inputs of the amplifiers will be rejected. For example usually noise affects equally the two inputs but the amplifier is built so that this common noise is reject (attenuated). It might be useful for you to read also about instrumentation amplifiers and CMRR.

I'm guessing choosing a different In-Amp would be a good idea then? I have a breakout board for an AD8221 but it doesn't have any pins to manipulate the gain. Am I better off just buying a couple of SMD to DIP boards and buying the SMD variant? I also have an INA129 (Board is an CJMCU-29) which has a mini pot for gain but that one doesn't have a pin out for the reference pin.
I believe that the best way would be to buffer your signal with JFET op amp...that should do.

Cheers ;)
 

TeeKay6

Joined Apr 20, 2019
573
How much do you amplify your signal (what is the value of your Rg)? The INA amplifies the voltage difference between the inverting and non inverting input. In your case it's already 45mV....with a gain of 100 you already get 4.5V.


That will depend on the frequency of the AC signal. I don't want to be super lengthy but there are two ways to look at it. Electrical engineers think about impedance (which is the equivalent of resistance but in the complex number domain) . Capacitors' impedance is 1/iwC (where i is the imaginary unit, w is the radial frequency); for low frequencies capacitor's impedance is high (current will not flow very easily), high frequencies impedance is low (current will flow easily). In the extreme case of w->0, Impedance is infinite and therefore no current flows (this is the DC case).
The other way it's more a physics approach. You can calculate how fast your capacitor charges and discharges, if the dis/charging time constant is bigger than the period of your AC signal, then it will pass. It might be worth it for you looking on the internet...plenty of stuff on the subject.

yes the pole in this case corresponds to the cut off frequency of the low pass filter. If you google transfer function low pass filter you'll find all the information you need.

The INA126 is an instrumentation amplifier (again google it to understand what that is). This topology is used in instruments to amplify very weak signals (that's also the reason why you are using it!). One of the benefits of these amplifiers is that the CMRR is very high. The CMRR is an indication of how much of the signal common both to the inverting and non inverting inputs of the amplifiers will be rejected. For example usually noise affects equally the two inputs but the amplifier is built so that this common noise is reject (attenuated). It might be useful for you to read also about instrumentation amplifiers and CMRR.



I believe that the best way would be to buffer your signal with JFET op amp...that should do.

Cheers ;)
@Rossosaurus
I offer herewith a few comments on @Vinnie90 comments in post#25.

1/iwC = 1/jωC is the most common terminology. j=√-1, ω=freq in radians/sec, C=cap in Farads. Unless you are willing to learn a significant amount of theory, this formula will simply remain gibberish to you. For most simple questions about RC circuits, there are simple-to-use formulae that will give results with no requirement that you understand the theory.

For more info on the general topic of capacitors, search for "how capacitors work". The dielectric (insulator) of a capacitor does indeed block any current flow through it. However, when an AC voltage is impressed (connected) on one side of a capacitor, it "seems" that current passes through the capacitor; in reality it does not. To explain that clearly would require more words than I can write here. When a DC voltage is impressed on one side of a capacitor, that side of the cap becomes charged to that voltage. The other side of the cap (depending on what else is connected to this other side) experiences a momentary change in its charge (and voltage) but this dies out (the charge is dissipated/lost in the "what else is connected") in a (generally) short time. So, in effect, an AC current seems to pass through the cap while a DC current does not. The ease with which AC current appears to pass through the cap is called its "impedance", just as the ease with which DC current flows through a resistor is called the "resistance."

Voltage is always measured between two points; there is no meaning to having a voltage at one point. When the second point is not specified, it is generally construed to be "ground" or "earth" (purely for historical reasons, having little to do with earth or ground). Thus, the polarity of any voltage depends on what second point is considered as a reference; if you change which point is considered the reference, you change the voltage and that can include changing the sign from + to -. As a limited analogy, consider that a book is lying on a table before you. The table is 24" high (relative to the floor). We might say the voltage of the book is therefore "24" relative to the floor. But what if you move the book from the table to the floor? The voltage of the book is then "0" (relative to the floor). And if you move the book to a hole in the floor? The voltage of the book becomes negative (relative to the floor). In all cases, the table and book are unchanged--what is changed is the relationship between the book and the reference that we arbitrarily used: the floor.

Placing dual buffer amps at the inputs of an INA is acceptable. There is some risk that the buffer amps will add noise but that depends on the specific devices and circuitry used. Such a dual buffer will cost you something in dollars. Alternatively you could buy an INA that effectively already has buffers built in. That will cost you more than an INA that does not have the buffers. There are plenty of low-noise, low input bias current, and low input voltage offset drift opamps in the market to choose from, many at relatively low cost. However, as I have noted (with only a couple of the many alternatives) there are also many better INA's than the INA126 available for a reasonable cost.

I suggest that you try to find more DIY info relating to myoelectrics before you proceed. For electronics in general, there are unlimited info sources online and many at this site (AAC). Look at the top of the AAC home page for "Education." There is a lot available!
 

Thread Starter

Rossosaurus

Joined Aug 23, 2019
24
@TeeKay6 @Vinnie90

Afternoon all,

I'll do my best to cut to the chase as my last post went on a bit.

How much do you amplify your signal (what is the value of your Rg)
The gain was ~200 ohms which according to the formula in the datasheet is about 385x. So it's probably blocking the useful AC signal. The proper electrodes came today so hopefully everything will be a bit more accurate from now on. I'm looking up all this stuff and making notes (I have just the worst memory, so I have to make notes or I'll have forgotten everything a couple of days later). Everything is starting to make a lot more sense and I remember doing some of this stuff when I did physics at A Level a few years back. I certainly remember capacitance and time constants, the angular frequency stuff and my hatred for radians XD. Anyway I'll take a look at all this stuff and hopefully come back with some more progress tomorrow or in a couple of days. I've got some repairs to do on my grandparents car tomorrow I think.

Tah all

Ross
 

Thread Starter

Rossosaurus

Joined Aug 23, 2019
24
@TeeKay6 , @Vinnie90
Hi all,
Sorry this took a while I was hoping to work on this project more, but then I got ill and some other things got in the way. Things are coming along nicely and I definitely know what I'm doing more than I did thanks to you lot. Just a couple of questions about calculating some of the values for the capacitors:
@Vinnie90 what did you use as your cut off frequency for the low pass filter? The I could only find a single article that said the frequency range is ~3-300Hz is this what you used for yours? Also what were the expected voltages before amplifying for you and what sort of gain should I be expecting to use?

Thanks
 

Vinnie90

Joined Jul 7, 2016
86
@Vinnie90 what did you use as your cut off frequency for the low pass filter? The I could only find a single article that said the frequency range is ~3-300Hz is this what you used for yours? Also what were the expected voltages before amplifying for you and what sort of gain should I be expecting to use?
Sounds about right. It also depends on the way you want to use it. With that bandwidth you might have troubles in picking some low frequency muscular contraction. You can try that and then adjust it. For the gain it depends on a million factors, like the contact with your skin, the distance of the electrodes from the reference. I would expect though nothing less than a gain of 100.
 

Thread Starter

Rossosaurus

Joined Aug 23, 2019
24
@Vinnie90 @TeeKay6

Afternoon all,
I've redesigned the circuit I am using for the In-Amp with the adjustments I needed to make. I am now using a low pass filter on the VIN+ & VIN- with the cut off at ~475Hz. However I'm still not getting consistent readings when I contract and relax my bicep. With my voltmeter set to AC I'm getting 1.4V - 1.7V and it doesn't seem to change with muscle contraction. Below is the circuit is there anything that still needs adding or changing?
 

TeeKay6

Joined Apr 20, 2019
573
@Vinnie90 @TeeKay6

Afternoon all,
I've redesigned the circuit I am using for the In-Amp with the adjustments I needed to make. I am now using a low pass filter on the VIN+ & VIN- with the cut off at ~475Hz. However I'm still not getting consistent readings when I contract and relax my bicep. With my voltmeter set to AC I'm getting 1.4V - 1.7V and it doesn't seem to change with muscle contraction. Below is the circuit is there anything that still needs adding or changing?
@Rossosaurus
1. You should get an oscilloscope as soon as it is financially feasible. Your ability to know what is "going on" within a circuit is severely limited by your having only a multimeter. You will almost never discover a spurious oscillation, noise source, or waveform distortion using a meter. For this project specifically, only a low bandwidth scope is needed
2. To solve problems, some steps/actions are almost always useful.
*State the problem succinctly and clearly--including what is likely relevant and omitting what is likely irrelevant. Focus on the most basic, "lowest level" statement of the problem; you can expand the statement later as necessary. A high level judgment such as "it doesn't work", does not lead forward. Your thinking and that of those you involve is to be guided by the statement of the problem.
*Break the problem into smaller pieces that you will likely have a better chance to resolve; you can expand your search later.
*Don't overlook the obvious. That is, first do all the basic checks such as agreement between circuit and schematic, integrity of power sources and grounding, correctness of component values, etc.
*Don't jump to immediate and fanciful conclusions without having data to support them. Searching for non-existent conditions can be a huge waste of time and energy. If you have a hunch, then try to find data that supports it--but discontinue that search as soon as you find data that contradicts your hunch.
*Electronics always makes sense. There are no supernatural forces at play. The laws of physics are the same in every instance. Hope has no force; only data and reason are useful. If a circuit is not working--and you have good reason to believe it should work--the solution will always be a rational deduction from knowledge you gain as you make measurements and as you analyze what is actually occurring in the circuit vs what your understanding says should be occurring.
*When you have no idea what to do next, collect more data! Any data that adds to your knowledge increases the chance that you will find relevant data. When a solution is not immediately apparent, keep sufficient records that you can exactly duplicate tests later. It's very easy to become confused after performing a dozen measurements as to what was the result and meaning of each measurement.

3. Review of schematic: Your previous schematic indicated that both +5V and -5V would be available to power the INA126, circuitry. Is this still true? Where is the connection from the Arduino ground/common to the many "GND" points of your circuit? (Why does the ArduinoPower connector have only two pins, not three?)

4. At this time it seems that you say "when connected to my arm for normal use, the output of the circuit remains fixed at 1.4-1.7VAC independent of my arm movement." For me, the first question is whether you have correct connections; check. Next, what is the predicted output of the circuit under test conditions that you create? For example, if you connect all three arm contacts together, what is the predicted output and what is the actual output? Depending on that result, are there other test conditions that you can set up and measure to reveal whether specific features of the circuit are operating correctly? For example: Is circuit gain as expected? Is current drawn by the circuit as expected? Do the two INAs in the INA126 behave identically? Are the low-pass filters working as expected? If you connect the reference probe to the EndElectrode and apply an AC voltage test signal between the End and Mid electrodes, is the circuit output appropriate?
 

Vinnie90

Joined Jul 7, 2016
86
In addition to all the super useful points that @TeeKay6 has stated in the previous topic (especially about getting a scope and on how to debug a circuit), I would also like to point out that again you need to high pass your signal, otherwise the DC component will still be there.

Another point that I am not sure we went through is: are you sure that the difference at the inputs of the INA is positive (voltage difference between pin 3 and pin 2). I would check that because you have a single supply op amp and maybe that difference is negative and you might need to invert the inputs.
 

TeeKay6

Joined Apr 20, 2019
573
In addition to all the super useful points that @TeeKay6 has stated in the previous topic (especially about getting a scope and on how to debug a circuit), I would also like to point out that again you need to high pass your signal, otherwise the DC component will still be there.

Another point that I am not sure we went through is: are you sure that the difference at the inputs of the INA is positive (voltage difference between pin 3 and pin 2). I would check that because you have a single supply op amp and maybe that difference is negative and you might need to invert the inputs.
@Vinnie90
I suspect that the circuit is still supposed to be using ±5V power, but at present the "GND" signals connect to nothing; they should connect to the missing ground between +5V and -5V. If otherwise, the presence of C2 makes no sense; it would connect ground to ground. The circuit output could potentially be bipolar if using ±5V power.
 

TeeKay6

Joined Apr 20, 2019
573
@Vinnie90
I suspect that the circuit is still supposed to be using ±5V power, but at present the "GND" signals connect to nothing; they should connect to the missing ground between +5V and -5V. If otherwise, the presence of C2 makes no sense; it would connect ground to ground. The circuit output could potentially be bipolar if using ±5V power.
@Rossosaurus
You say that your voltmeter reads 1.4-1.7VAC. However, using only the voltmeter we have no idea whether that voltage is due to pickup of stray AC signals (nearby power cords, fluorescent lamps, etc) or due to an oscillation. If oscillation, what frequency, waveform, amplitude? Here is an immediate case where a scope could help considerably.

After rereading some earlier comments, I suggest that our first task is identify the weaknesses, if any, of the INA126 in this application. If we succeed in getting acceptable operation, even if poor, from the INA126 we will be in a better position to judge whether to change to another INA (and to which) or to add a preamp stage. (My preference is for the simpler approach: a different INA...if we decide change is necessary.)
 

Thread Starter

Rossosaurus

Joined Aug 23, 2019
24
@TeeKay6 @Vinnie90

Afternoon all,

It's been a while hasn't it but I have actually made some progress today. First things first one of the things that undoubtfully screwed with my progress is that the breadboard I was using in the original post has a break in the rails half-way down which meant any part of the power rails I used on the lower half went nowhere. More importantly, I looked into getting an oscilloscope and, £60 later I know have a wave generator and one of those handheld open-source DSO150 oscilloscopes which work wonders for me. I have also come to the conclusion that my multimeter is no longer very accurate after some testing so must endeavour to get another one of those.

On to news of progress being made in the circuit, I think I have finally got a working in-amp design although it still needs some work which I'm hoping you chaps can help with. Here is the design I am using except the gain I have is about 80:
upload_2019-10-11_15-53-14.png

The output I am getting is about 0.9V relaxed and 1V-1.1V when I tense my bicep. The low pass filters cut off is about 475Hz. The reference electrode is on the back of my hand. Is there anything I can do to make the signal that is output a larger range? Ideally, I'd like this to be 0-5V. Also what changes/improvements should I make to this circuit before I move on to the precision rectifier? I have a feeling there's still a fair amount to improve on.

Thanks
 

Attachments

TeeKay6

Joined Apr 20, 2019
573
@TeeKay6 @Vinnie90

Afternoon all,

It's been a while hasn't it but I have actually made some progress today. First things first one of the things that undoubtfully screwed with my progress is that the breadboard I was using in the original post has a break in the rails half-way down which meant any part of the power rails I used on the lower half went nowhere. More importantly, I looked into getting an oscilloscope and, £60 later I know have a wave generator and one of those handheld open-source DSO150 oscilloscopes which work wonders for me. I have also come to the conclusion that my multimeter is no longer very accurate after some testing so must endeavour to get another one of those.

On to news of progress being made in the circuit, I think I have finally got a working in-amp design although it still needs some work which I'm hoping you chaps can help with. Here is the design I am using except the gain I have is about 80:
View attachment 187819

The output I am getting is about 0.9V relaxed and 1V-1.1V when I tense my bicep. The low pass filters cut off is about 475Hz. The reference electrode is on the back of my hand. Is there anything I can do to make the signal that is output a larger range? Ideally, I'd like this to be 0-5V. Also what changes/improvements should I make to this circuit before I move on to the precision rectifier? I have a feeling there's still a fair amount to improve on.

Thanks
@Rossosaurus
Two initial comments:
1. You show GND2 symbols, but nowhere do they connect to anything resembling ground. The INA126 Ref input (pin5) does not establish a ground; it simply sets a reference voltage for the amplifier. At present, GND2 can be at almost any voltage between INA126 pin7 and pin4 voltages.
2. Look at the INA126 datasheet, specifically the section Electrical Characteristics (Section 6.6 in my version of the datasheet) and find the area of the table labeled OUTPUT. Note that the output cannot swing rail-to-rail; it cannot come closer to either + or - power supply voltage than approximately 0.9V. That should ring a bell for your output being "0.9V relaxed". The INA126 is simply in saturation against its "-" power supply rail. The signal might be attempting to swing over a range of 10V, but only the tiny bit from 0.9V to 1.1V can be outputted.

See my next post for UPDATE to the following paragraph:
The INA126 is intended to operate between a + and - power supply voltage of ±1.35V minimum. You seem to be operating between 0V and 5V, with nothing setting a reference between those values. I suggest that you add two resistors (e.g. 470Ω each) from the 0V and +5V power supply inputs. Tie the other ends of the resistors together and tie that to GND2. This will set GND2 reference to +2.5V (relative to the - power supply), i.e. the INA126 will operate with ±2.5V.

The output when "at rest" must not come closer than 1V to either the + or - power supply rail.
 
Last edited:

Thread Starter

Rossosaurus

Joined Aug 23, 2019
24
@TeeKay6 thanks for the quick reply. Im out of the house now until Sunday so I'll take a look at all the practical stuff then. Just wanted to say about the GND2 problem. The ground I'm using is the one on the Arduino I should've have put an extra input down labeled GND2. As for the reference I was aware of it's purpose however I was unsure whether I also needed to attach it to a ground or not. I was leaning towards not needing too as surely the signal from my arm would follow the path of least resistance which would be towards ground but decided otherwise for some reason.
 

TeeKay6

Joined Apr 20, 2019
573
@TeeKay6 thanks for the quick reply. Im out of the house now until Sunday so I'll take a look at all the practical stuff then. Just wanted to say about the GND2 problem. The ground I'm using is the one on the Arduino I should've have put an extra input down labeled GND2. As for the reference I was aware of it's purpose however I was unsure whether I also needed to attach it to a ground or not. I was leaning towards not needing too as surely the signal from my arm would follow the path of least resistance which would be towards ground but decided otherwise for some reason.
The Arduino "ground" becomes the "-V" power for the INA126. There is no connection from GND2 to the Arduino ground except as described through an added resistor (and multiple bypass caps). After reviewing the datasheet again, specifically the Section 8.2 Typical Application (also Section 9.1), I have come to the conclusion that the simple voltage divider I advised will not be sufficient to create the "missing" GND2. Instead, the new voltage divider (the 2 added R's) would have to be buffered by an opamp voltage-follower OR (better) replaced by a low voltage regulator (dropping the input 5V to 2.5V output). The INA126 "Ref" input should be connected to the newly created "2.5V" GND2 and to the arm electrode. When not connected, the Ref input could be at any voltage from the Arduino's 0V to its +5V. There is no path of least resistance (at least not a path that can be guaranteed); your body potential floats like any other conductive item.
 
Last edited:

Thread Starter

Rossosaurus

Joined Aug 23, 2019
24
@TeeKay6

Just a quick one to say that I am using a voltage inverter breakout board so that I can have +5V and -5V from the Arduino. I think the board is an LM2662. I'll do my best to look at the other stuff tomorrow.

 

TeeKay6

Joined Apr 20, 2019
573
@TeeKay6

Just a quick one to say that I am using a voltage inverter breakout board so that I can have +5V and -5V from the Arduino. I think the board is an LM2662. I'll do my best to look at the other stuff tomorrow.

OK, that should resolve the PS issue. Note that you must also carry the GND from the Arduino to the INA126 circuitry.
 
Last edited:
Top