I am making a project of Real-time ECG monitoring device using Raspberry Pi 3B+, Heart monitor AD8232 sensor by Keyes, MCP3008 ADC and 7″ HDMI LCD. I am giving supply to RPi using 5V DC charger connected to power supply of 220V AC. The code and circuitry I’m using are working and I have tested all the analogue sensors. But when I use AD8232 Heart monitor sensor, it doesn’t give the right ECG data but only the noise. When I used the same sensor on Arduino UNO and Nano, the sensor was behaving the same. Just noisy data on the serial plotter of Arduino IDE. Unintentionally, I placed my hand on my laptop’s body and the ECG started coming on the serial plotter. Exact ECG peaks were detected. Then I again lifted my hand from the laptop and the real ECG went away and noise started coming. I tried this process many times and also tried 3 different heart monitor sensors but the response was the same.
In Above figure: Arduino Serial plotter – ECG SENSOR VALUES – (when I put the hand on my laptop’s body.)
After observing this, I realized that it’s the electrostatic charge of my body which get mixed with ECG and the noisy signal comes. When I put the hand on the laptop body, my body gets discharged through the laptop body and the laptop body is always connected to Earth and the Arduino is also connected to USB port of the same laptop.
Now the question is, How can I discharge my body when the sensor is directly connected to Raspberry Pi?I have also tried power supply of RPi from power bank giving output of 5V DC, 2100mA
1. How can I discharge my body? 2. I have also tried power bank, ...
- Ah, you cannot “discharge” your body. You use the Einthoven Triangle connection of your single lead to cancel out the mains noise pickuped by your body. It is similar to the use of differential input or twisted pair wires to cancel out the noise. I recommend to read the two references below.
- Yes, using power bank is good idea, because it is almost any noise free. I just use batteries, keeping it very near the AD8232, and decoupled anything with Rpi. (For MCP3008, you might also like to use batteries very near by.)
I don’t use the 3.5mm plug and long wire. I keep the wires out to the AD8232 very short by directly connecting to the duPont male header.
You might like to look at the AD8232 ECG of my own faint heart. 🙂
Yes, noise is the most common ADC newbie sorrow.
The most trouble making noise comes from the 220/110 50/60Hz mains noise, which is picked up by the PSU, through EMI and through connecting and grounding wires.
In your ECG case, your little body is picking up huge mains noise, so you are in the biggest trouble.
On the other hand, the ADCs themselves also generate noise, though somewhat smaller, inside the chip, when they are doing high frequency chopping in analog to digital operation, and switching between analog and digital channels.
Before I move on, you might like to skim the posts referred at the bottom, where I discussed the noise problem using the very old SPI 10/12 bit MCP3x0y, ACS712/723, INA219/221, and how I have been trying to solve the problem using new type of low noise I2C/SPI 16/24 ADCs using HX711, ADS1025/1115, ADS1256, …
You might notice that the new generation of ADCs almost always say their chip is very low noise, mains noise rejection, and selectable gain (to adjust the full scale for low resolution loss).
And if you are using MCP300x or MCP3204, do not use Vcc or resistor divided Vcc as the Vref, because Vcc is noisy. Use a good Vref chip such as KA431.
And it is a good idea to use a dedicated PSU, with adequate by pass caps, placed near the ADC. This way you can use this rather stable PSU as voltage reference, in case you do not want to use a zener or volt ref chip.
/ to continue, …
Datasheets and Application Notes
SparkFun AD8232 Single Lead Heart Rate Monitor Module Features
The AD8232 SparkFun Single Lead Heart Rate Monitor Board is used to measure the electrical activity of the heart. This electrical activity can be charted as ECG or output as an analog reading. ECGs can be extremely noisy, the AD8232 Single Lead Heart Rate Monitor acts as an op amp to help obtain a clear signal from the PR and QT Intervals easily. The AD8232 is an integrated signal conditioning block for ECG and other biopotential measurement applications. It is designed to extract, amplify, and filter small biopotential signals in the presence of noisy conditions, such as those created by motion or remote electrode placement. The AD8232 Heart Rate Monitor breaks out nine connections from the IC that you can solder pins, wires, or other connectors to. SDN, LO+, LO-, OUTPUT, 3.3V, GND provide essential pins for operating this monitor with an Arduino or other development board. Also provided on this board are RA (Right Arm), LA (Left Arm), and RL (Right Leg) pins to attach and use your own custom sensors. Additionally, there is an LED indicator light that will pulsate to the rhythm of a heart beat, ...
ECG Signal Interpretation Learning Notes