# A doubt on interfacing EMG circuit to Arduino?

So I have done an EMG detection circuit using TI's instrumentation amplifier chip INA128 as below (sorry if the schematic looks bad):

And the circuit is working OK for my requirements (although slight hum and background noise is there). I was trying to interface the V_out to the ADC of Arduino. Which interfacing circuit would be better for this purpose? I was trying the instructions given here using op-amp summing amplifier solution. I used LM741 op-amp in my circuit. But it was a failure. My output signal V_out varies between -100mV to 100mV.

• What did you sum with your signal? Commented Jun 2, 2016 at 20:04
• @MathieuL : Sorry for late reply. I summed with 5V DC supply. Thought it would clamp the signal. Commented Jun 2, 2016 at 21:04
• What did you use for the supply of the LM Commented Jun 2, 2016 at 21:52
• @MathieuL : I used +9V and -9V dual supply. Commented Jun 3, 2016 at 7:09
• Consider using a better amp than the ancient LM741. There are many posts on this site and the internet explaining its short comings, so I won't go into them here.
– JRE
Commented Jun 3, 2016 at 12:45

Because you seem to have an LM741, the most simple solution is just to use 2 inverter configuration:

simulate this circuit – Schematic created using CircuitLab

For the ADC of your arduino, you should check but the maximum input could be 5V, if it is the case you can raise R2 to 20K and you will get a 2.5 V offset.

• +1 Because I think at least part of the problem is that the Arduino ADC accepts from 0 to +5V. The posed question mentions a range of -100mV to +100mV, so the negative voltage is a problem. Simply using an Op-Amp with a dual supply won't fix that, so the offset you mention is needed.
– JRE
Commented Jun 3, 2016 at 12:44
• If I'm not mistaken your solution results in a signal of +-100mV + 5V. So the signal at the ADC has a range of 4.9V-5.1V. Not the full 5V range. Also the datasheet of LM741 state a minimum operation Voltage of +-10V. Commented Jun 3, 2016 at 14:29
• @Warloxx you are right, the datasheet stipulate a minimum of 10 V for the supply but if OP only got 9 V under hand, he could try it, the biggest impact I think is that 9 V could introduce non-linearity in the amplification. Commented Jun 3, 2016 at 15:00
• @Warloxx I think that the LM358 would be more suitable for this design. Commented Jun 3, 2016 at 15:02
• @MathieuL Okay with 20k for R2 then technically you have the value in the range of the ADC. Yet with a 10bit ADC and a Vref of 5V and a difference in the signal of 200mV you only get 2^10 bit / 5V * 0.2V = 40.96 bit of resolution. If that is enough for this signal then this works. Commented Jun 3, 2016 at 20:19

The circuit suggested by you should work in principle. The OP you used (LM741) needs at least $\pm10V$ so if you used the same $\pm9V$ supply as for the INA128 that may be the error.

WARNING: MATH For just the solution see circuit below.

If not, here is a circuit I would use to convert the +-100mV to 0-5V using the formula from you link

$$V_0 = \left(V1\frac{R2}{R1+R2} + V2\frac{R1}{R1+R2}\right) \left(1 + \frac{R4}{R3}\right)$$

Lets say $V1$ is our input signal and $V2$ the Offset Voltage. As you can see in the Formula above we first add then multiply with this circuit just like in math. So to get a positive signal we add $100mV$ to the signal. To achieve this we can create a voltage divider with the 5V supply of the Arduino.

$$V2 = 5V \cdot \frac{R5}{R5+R6} = 100mV$$

Using a resistor calculator like this one we get the values for R5 and R6 as:

$$R5 = 1k\Omega$$ $$R6 = 22k\Omega + 27k\Omega$$

As you can see R6 is actually created from two resistors in series to match the ratio. Lets call the second Resistor R7 $$R6 = 22k\Omega$$ $$R7 = 27k\Omega$$ $$V2 = 5V \cdot \frac{R5}{R5+R6+R7} = 100mV$$

Now to add V1 and V2 without any weighting of the values $\frac{R1}{R1+R2}$ and $\frac{R2}{R1+R2}$ have to be equal. So in fact R1 has to be equal to R2

Lets chose a value for R1 and R2, say $$R1=R2=10k\Omega$$

Lets see what we have now:

$$V_0 = \left(V1\frac{10k\Omega}{10k\Omega+10k\Omega} + V2\frac{10k\Omega}{10k\Omega+10k\Omega}\right) \left(1 + \frac{R4}{R3}\right) = \left(V1\frac{1}{2} + V2\frac{1}{2}\right) \left(1 + \frac{R4}{R3}\right) = \left(V1 + V2\right) \frac{1}{2} \left(1 + \frac{R4}{R3}\right)$$

So now that the $\pm100mV$ Signal is offset by $100mV$ to a range of $0-200mV$ we need to boost it to $0-5V$

$$\frac{1}{2} \left(1 + \frac{R4}{R3}\right) = \frac{5V}{200mV} = 25$$ $$\frac{R4}{R3} = 49$$

By using the calculator above we get $$R4 = 330k\Omega$$ $$R3 = 6.3k\Omega$$

This is actually not a perfect fit (3% off) but as resistors can have large margin of error (5%) is is close enough. (You can go better with three resistors: R4=290k R3=10k||39k)

Now we have finally all we need. Final circuit:

simulate this circuit – Schematic created using CircuitLab

• seem pretty complex, I think it is simplier to just use 2 stage inverter amplifier with both unity gain. Commented Jun 2, 2016 at 22:04
• or perhaps a BJT voltage follower with the proper off-set Commented Jun 2, 2016 at 22:04
• @MathieuL : Can you please write bjt voltage follower as your answer? Commented Jun 3, 2016 at 8:51
• @dexterdev The problem with BJT after I look-it up is that it isn't a so great of a buffer. Commented Jun 3, 2016 at 12:23