ECG Filter With Blinking LED

by AlyssaHudgins123 in Circuits > Wearables

441 Views, 1 Favorites, 0 Comments

ECG Filter With Blinking LED

263362831_300949598586364_1831165643467549869_n.jpg

This project seeks to filter and amplify a real-life ECG signal using circuit components.

Supplies

Function Generator

Oscilloscope

Bread Board

Resistors

Capacitors

Arduino

Decide on Filters and Calculate the Necessary Resistor and Capacitor Values

lt_notch.png
lt_low.png
lt_amp.png

For this step, it is important to select filters (with corresponding resistors and capacitors) that allow you to get a clean ECG signal. For this instructable, we will be using an instrumentation amplifier, notch filter, and low pass filter. The instrumentation amplifier will amplify our signal 1000 times and then our notch filter will remove signals with frequencies of 60 Hz. Our low pass will pass signals below 150 Hz. So based on these necessities, you will have to calculate the resistors and capacitors to make this happen.

Simulate Your Circuits in LTSpice

lt_notch.png
lt_low.png
lt_amp.png

For this step, you take your calculated resistor and capacitors from step 1 and apply them to LTSpice. This will allow us to see how your circuit would theoretically perform and would help check calculations before actually building the circuit. When running your circuits in LTSpice you should use an AC analysis with a sweep to see how the circuit reacts at different frequencies. Based on what you see, you can either tweak your resistor or capacitor values or continue on to build your actual circuit.

Build Your Circuits

263362831_300949598586364_1831165643467549869_n.jpg
cir_ina.png
cir_low.png
cir_not.png

In this step, you are actually building your circuit components. It is recommended that you test each filter/amplifier separately to ensure that it is working properly. To test your circuits, hook up a function generator to your circuit and oscilloscope as well as the output voltage to the oscilloscope. This will allow you to compare your output signal to the input to ensure it is working. To test your notch filter and low pass filter, you will have to vary the frequency of your function generator and record the resulting magnitudes of both input and output signals and the phase shifts.

Construct Your Magnitude Plots

Screenshot 2021-12-08 091335.png
plot_low.png

From your lab data, construct the magnitude and phase plots for each part of your circuit. If your result is what is desired, you can continue to hook all your circuits together.

To create your magnitude plots, you take the data from the amplitude of the input and output signals at different input frequencies and calculate voltage output over the input voltage to get your magnitude. Then, you plot this magnitude versus the associated frequency.

Connect and Test Your Total ECG

Screenshot 2021-12-08 091432.png

Now you can connect all of your filters together and test the ECG! For this, you should also set the function generator to a cardiac signal. Compare the results from the oscilloscope to what you should expect and act accordingly.

To test the ECG on yourself, disconnect the function generator and the op-amp power supply. Connect the op-amp power supply to a 9 V battery and ECG leads/electrodes to yourself and the circuit. Then continue to observe your results.

Arduino BPM Calculator and Signal Graph

Screenshot 2021-12-08 091537.png
Screenshot 2021-12-08 091617.png

Congratulations, you have finished building the ECG filter component! Now you can start coding for Arduino. With the Arduino, you will need to graph the signal and also code for a BPM calculator. To start with this, you will need Arduino downloaded on your laptop. When opening a script, make sure that you are connected to the correct COM port with your Arduino. After that, you can start your coding!

If you want to do extra, you can attach a LED to the digital output and code according to see the QRS complex of the ECG.