Building an EKG analog front end circuit - Page 1
Forum section: electronics / projects

author: omair4ahmad
author_rank: Newbie
timestamp: October 24, 2016, 09:29:56 am
content: I am trying to reproduce an EKG analog front end circuit. I have attached the schematics of the circuit.In my design I have used instrumentation amplifier IC - INA128P and forquad op-amp IC - TL084CN.The problem I am facing is that, when I am trying to acquire the EKG signal on the oscilloscope i am getting pretty distorted signal and it is no way near ideal ekg signal. please help me out with your suggestions.

author: kxenos
author_rank: Frequent Contributor
timestamp: October 24, 2016, 09:40:48 am
content: What kind of distortion is there? Clipping? noise? Can you post a screenshot of the oscilloscope?

author: tszaboo
author_rank: Super Contributor
timestamp: October 24, 2016, 09:51:30 am
content: When they took my ECG, they used 7 leads to to it. I reckon, one of them is intentionally GND (on my leg?), the other 6 are inputs.But this time, the issue is much simpler:INA12x Precision, Low Power Instrumentation AmplifiersWide Supply Range: ±2.25 V to ±18 V

author: omair4ahmad
author_rank: Newbie
timestamp: October 24, 2016, 10:49:10 am
content: thanks kxenos and nandblog for your replies.i have taken 2 snapshots, one with no contact of any on the arm and another with both the arms in contact with the circuit.

author: kxenos
author_rank: Frequent Contributor
timestamp: October 24, 2016, 11:36:48 am
content: It seems like the normal EKG signal is modulated on a sinusoidal signal. The common mode noise is not filtered.Could this sine be 50Hz? If so, that means that your virtual ground subcircuit is not working properly and you need a 3rd wire to ground the patient (Right leg ground).For testing you can just ground the patient to the circuit ground via a third wire and see if there is any change. Also, have in mind that your oscilloscope's probe is connected to earth ground.

author: omair4ahmad
author_rank: Newbie
timestamp: November 03, 2016, 05:51:31 am
content: thanks kxenos for your advice. yes i agree with you it could be 50 hz sine as my line supply is 240V and 50Hz. pardon me if i sound stupid but i am provide a dc current of 8V to the circuit. When I connect my oscilloscope to the supply line it shows a smooth 8V DC, no sign of any sine wave there but i this circuit why am i getting a sine wave even when no limb is connected.One more thing that I have observed here is that my quad op-amp IC TL084 might be drawing more than mcp6004 but due to the unavailability of mcp6004 i used TL084.I am just a beginner and I desperately needs your expert advice. Please keep me posted,

author: trophosphere
author_rank: Frequent Contributor
timestamp: November 03, 2016, 06:08:39 am
content: 1) What are your time/div settings in your initial two images showing your waveforms without and with the leads attached?2) Can you please attach pictures showing the output waveforms for the outputs of your instrumentation amplifier (pin 6 of IC1) and secondary gain stage (pin 8 of IC2)?3) Try shorting your two inputs together and scoping the output of your circuit. Is the interference still present?

author: JPortici
author_rank: Super Contributor
timestamp: November 03, 2016, 07:29:29 am
content: Quote from: NANDBlog on October 24, 2016, 09:51:30 amand this is still ignored..

author: trophosphere
author_rank: Frequent Contributor
timestamp: November 03, 2016, 08:04:59 am
content: Quote from: JPortici on November 03, 2016, 07:29:29 amI don't quite understand what you are hinting at. The OP seems to be feeding his instrumentation amplifier with VDD=8v, VSS=0v, and VGND=4v (from the buffered voltage divider so no problems sourcing/sinking reasonable amount of current). From the instrumentation amplifier's perspective it is being biased at ±4v which is within the acceptable range. In addition, he is biasing his instrumentation amplifier at VGND so no problems there.

author: nali
author_rank: Frequent Contributor
timestamp: November 03, 2016, 08:54:46 am
content: Although it's just some lecture notes this may give you some general pointershttp://www.realworldengineering.org/index.php?page=project&project=591(click on the background lecture, for some reason the direct pdf link doesn't work)Remember ECG signals are pretty tiny! Apart from power noise you'll also see plenty of interference from muscle movements so unless the person being monitored is lying still there will be plenty of noise artifacts, even after the differential measurement.

author: danadak
author_rank: Super Contributor
timestamp: November 06, 2016, 12:15:35 am
content: Page 30 shows a design -http://www.ti.com/lit/ds/symlink/ina826.pdfRegards, Dana.

author: trophosphere
author_rank: Frequent Contributor
timestamp: November 06, 2016, 01:51:53 am
content: Quote from: evb149 on November 06, 2016, 12:36:21 amThat's what I initially thought first after seeing the schematic but in a subsequent post by the OP, the OP states:Quote from: omair4ahmadUnless the OP decided to randomly change voltages on us without telling us his/her reason is I assumed the voltage in the schematic was a mistake. OP needs to clarify then if the rail voltage is 3.3v or 8v because his/her schematic says one thing and they say another which is quite confusing and not helpful at all.

author: trophosphere
author_rank: Frequent Contributor
timestamp: November 06, 2016, 02:28:30 am
content: @evb149 You are certainly right about that. The right leg drive can be implemented by an amplifier that inverts the common-mode signal being fed into the instrumentation amplifier to increase the CMRR.Another possible cause, if the voltage he is providing to his circuit is not the issue, would be if the negative voltage rail of the power supply is earth grounded as well in addition to the grounded oscilloscope probe: that could create a rather large ground loop.

author: Seekonk
author_rank: Super Contributor
timestamp: November 06, 2016, 06:10:42 am
content: I need to build one of these myself since I have serious heart issues. The internet is full of plans and few are this complicated or expensive. Just marking this for future reference.

author: omair4ahmad
author_rank: Newbie
timestamp: November 07, 2016, 02:27:01 pm
content: thank you everyone for such in depth analysis. what i've drawn from above discussion is that i should add a right leg drive circuit.I am thinking of using a 9V battery for supplying the dc supply voltage in this circuit to overcome the sine modulation from the 50hz mains. please assist me if i can do that.

author: ian.rees
author_rank: Contributor
timestamp: November 07, 2016, 09:00:25 pm
content: Quote from: omair4ahmad on November 07, 2016, 02:27:01 pmMy understanding is that the 50Hz (or 60Hz) that you're rejecting isn't from the power supply of your device, but instead is picked up from all the mains wires, equipment, etc. in the area. In other words, even before your EKG is connected to the patient, the patient's electrical potential is modulating at the power line frequency to some degree. So, using a 9V battery won't change the picture very much.

author: Audioguru
author_rank: Super Contributor
timestamp: November 08, 2016, 12:14:37 am
content: Feeding the patient with the out-of-phase interference signal to his right leg cancels most interference. Using shielded audio cables feeding each probe also cancels most interference.

author: kxenos
author_rank: Frequent Contributor
timestamp: November 08, 2016, 06:01:23 am
content: You can try the following:Split R3 in your schematic into 2 resistors. Then from the center tap a wire. In this wire you will have the common mode voltage. Feed this signal into an inverting amplifier with gain more than one and then to the patient as ground.

author: omair4ahmad
author_rank: Newbie
timestamp: November 28, 2016, 05:54:41 am
content: Thank you trophosphere.1. The time div is 5 ms.2. the pics of the output from inst amp as well as quad amp is the same and it is attached with this reply.3. When I short both the inputs i got a linear dc line.I gave it a swing of +8V to -8V and some how got rid of the line interference but still i didn't got the output as EKG signal. I haven't included any right leg drive circuit because i want to make this model handy. Please help me what should i do next.

author: skrap
author_rank: Contributor
timestamp: November 29, 2016, 03:52:15 am
content: You might find this one interesting:http://www.analog.com/en/analog-dialogue/raqs/raq-issue-110.htmlAn isolation amplifier between the oscilloscope and your ECG circuit might be a good idea for more than noise reasons.

author: trophosphere
author_rank: Frequent Contributor
timestamp: November 29, 2016, 06:37:31 am
content: Hook up a function generator to the inputs of your EKG analog front-end and set the waveform to something like a sine-wave with the amplitude set at 100mVpp. The positive output of the function generator can go to the +IN and the ground of the function generator can go into -IN. Hook up your oscilloscope such that your probe is connected directly to the output of the instrumentation amplifier and connect the ground lead of your oscilloscope to your virtual ground.NOTEMake sure that your power supply's ground is not earth referenced. You will want to avoid shorting your circuit's virtual ground to your power supply's ground through your oscilloscope. In addition, make sure the function generator's ground is not earth referenced as well as it will result in clipping.You should see, if the instrumentation amplifier is operating correctly, an amplified sine-wave of about 1.16Vpp on your oscilloscope.