Making a ECG on a Breadboard in 4 Easy Steps

by regina11895 in Circuits > Arduino

489 Views, 1 Favorites, 0 Comments

Making a ECG on a Breadboard in 4 Easy Steps

Screenshot 2022-04-27 151142.jpg

Our goal was to design an ECG composed of an amplifying circuit, a notch filter, and a low pass filter and automate the plotting of this signal and BPM readout using an Arduino microcontroller. These steps will help you get an amplification of 1000, remove 60 Hz noise, and only pass frequencies under 1 kHz to get the best ECG reading from the arduino plot.

Supplies

Breadboard

Resistor values similar to the following: 1Kohm, 5Kohm, 10kohm, 909 Kohm, 1.10524 Kohm, 1.100942 Kohm, 282.942 Kohm,14.23698 Kohms, 53.9688 Kohms

Note* If you do not have these exact resistors like us, you can put resistors in series to add up to t

Capacitors: 15 microF (four of these), .066 microF, 22 nanoF

Make an Instrumentation Amplifier

Screenshot 2022-04-27 150351.jpg
Screenshot 2022-04-27 150455.jpg
Screenshot 2022-04-27 150809.jpg

We wanted Vout / (Vin2 - Vin1) to be 1000 to amplify the small signal voltage of human input to a larger quantity. We set R1 to 1000 ohms, R3 to 10000 ohms, R2 to 5000 ohms, and then we solved for R4 using the above equation in order to reach our desired gain. We found R4 to equal 909000 ohms. Find like components of resistors and supply the amps with 9-15 Volts to create a function breadboard circuit like the photo above.

Notch Filter

Screenshot 2022-04-27 152031.jpg
Screenshot 2022-04-27 152232.jpg
Screenshot 2022-04-27 152346.jpg

You want to cut out the 60 Hz noise from power lines from our ECG so you need to create a notch filter to cut out this noise. The above equations were used to calculate and verify component values. To calculate R1, R2, and R3 we used a quality factor of 8 because this gave us a band width of 7.5 Hz. We want the band width to be small because we really only want the 60 Hz frequency to be cut out to reduce noise. Our 0 value was 60Hz * 2 since our center frequency was 60 Hz. We chose a capacitance of .15F for our C value.

Low Pass Filter

Screenshot 2022-04-27 152734.jpg
Screenshot 2022-04-27 153448.jpg
Screenshot 2022-04-27 153534.jpg

You need to construct a low pass filter since we do not want high frequencies passing through the ECG because it will just add noise. We calculated C2 by dividing 10 by our cutoff frequency of 150 Hz and multiplying by 10^-6. Plugging in a = 1.414214, b = 1, K = 1, and C2 = .066 microF into the given equation we got that C1 had to be less than 3.33* 10 ^-8F and we chose 22*10^-9F because that was the value closest to the maximum C1 where it was possible to calculate R1. R1 and R2 were calculated using the above equations. Where the cutoff frequency is 150 Hz * 2pi. There is no need to calculate R3 or R4 because the gain was one and R4 was replaced by a short circuit. The LTSpice schematic shows our theoretical values and we put resistors in series to get as close to these values as possible.

Put It All Together!

Connect the output of the amplifying section to the input of the notch filter and the output of the notch filter to the input of the low pass filter. This will combine all three aspects of the ECG so that the signal is amplified and 60 Hz and high frequency noise is filtered out of the ECG.

Use an Arduino to Measure Results

The next goal was to integrate and test the user interface using Arduino software. To do this, connect an arduino microcontroller to a laptop. From there connect the A0 port (input) to the output of the integrated circuit. The ground port on the microcontroller needs to connect to the ground on the integrated circuit. The Agilent DMM can be used to initially test the input on the microcontroller. Note that we changed the given code parameters to an upper threshold of 125 mV and a lower threshold of 100 mV. Use the code linked above to get a BPM readout plot. You may need to adjust the lower and upper thrshold to get a clear result.

Downloads