Serial Heart Monitor Bugs- Arduino AD8232

Hello, essentially I'm trying to create an ECG monitor that displays a heart waveform on Serial Plotter.

void setup() {
// initialize the serial communication:
Serial.begin(9600);
pinMode(10, INPUT); // Setup for leads off detection LO +
pinMode(11, INPUT); // Setup for leads off detection LO -
 
}
 
void loop() {
 
if((digitalRead(10) == 1)||(digitalRead(11) == 1)){
Serial.println('!');
}
else{
// send the value of analog input 0:
Serial.println(analogRead(A0));
}
//Wait for a bit to keep serial data from saturating
delay(1);
}

We are currently producing this signal:

We are using Arduino UNO and have tried changing wires, electrode placement and laptops already, yet we cannot produce a signal (not even a noisy signal).

Any ideas on why this is happening would be greatly appreciated!! Thank you :slight_smile:

What is the schematic of your circuit?

Your code seems to use two digital inputs and an analogue input, what is the thinking behind this?

Increase the baud rate to the highest available and remove the delay().

Hey Grumpy Mike, we are trying to replicate the conditions and results of this website:

We are struggling to produce the Serial Plotter results that they do.

Thanks for that link, now we know what you are working towards.

So no we need now to see your setup is like. Can you post a photograph of your circuit please.

Devvydoo,

Do you actually have the same hardware as the link you provided shows?

It appears to be a Sparkfun module.
There is lots of information about it here

Hi, sorry for the delay, here is my circuit


Uploading: image.png(1)...

We have slihglty different hardware, instead we are using this:

Thanks for that. I can't see anything obvious wrong, but solderless bread board is notorious for not making reliable connections so you could try very small pressure backwards and forwards on the pins and connections.

This bit doesn't look right to me:-

For a start is is saying if pin 10 or pin 11 read a logic high then there is something wrong with the reading. Then if it is it prints a "!". That is only going to upset a display being sent to the serial plotter.
I would try things without this test first. Just take the A0 reading and plot it. Also it could be too fast to see, so change that delay(1) to something bigger.

Failing that it is likely to be down to the electrodes and the placement of them. Are you using KY jelly or some other water based lubricant, on the pads to get a better contact. That is what they use in UK hospitals. I was given half a tube by a nurse in the mid 70s when I was doing experiments with picking up brain waves and feeding it into an analogue synthesiser.

It was only later that I learned what other use this was put to. :wink:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.