It works pretty good as an heart monitor, but I'm working on another project with this same sensor.
I'm trying to read (via analogRead) the action potential generated on my lower arm during a muscle contraction, on an Arduino Uno.
The problem is that plotting the values I've found that the wave has a strange shape, more like a sinusoidal noise in the background.
This is the wave form:
When the wave is aporoximately flat (less peaks) the muscle is relaxed. And even though I'm trying to stay as still as possible to reduce the noises caused by movement, sometimes the wave raises and then drops.
When I contract the muscle (taller peaks) the wave starts to raise (and so the contraction is detected) but then it slowly drops and starts acting like a sinusoid.
What can I do to stabilize the wave?
Is there any hardware/software filtering I can use?
I've seen some project using the same sensor and code and they are pretty much working. What could be my problem?
I suspect you just need to high-pass filter so you only get the spikes (which I presume are muscle fibres firing).
I guess the DC and low frequencies are dominated by environmental noise - short of sitting in a faraday cage that's probably unavoidable.
External shielding is always a good idea. You could try sitting outdoors, running the sensor with a battery operated laptop.
Note: the sample rate of your program is determined by the Serial Baud rate, which is currently 9600 Baud and very low. Experiment with higher Baud rates to determine if artifacts are not being introduced by aliasing (look up the term, as well as the Sampling Theorem).
Thank you again for your suggestions.
I'll try everything I can and I'll update this post.
Last question: do you think that some noises and artifacts could be caused by the Arduino itself (in terms of malfunctions)? Is there any way to check if Arduino is giving me true Analog outputs?
So, I tried doing some experiments with analog inputs and the Arduino boards actually gives me true analog values.
My next move is to read AD8232 output outdoors, with the sensor powered by a battery and arduino connected to a laptop and with an higher baud rate.
For the filtering part, do you know any Arduino shield you would recommend me?
I was thinking about implementing a simple RC circuit as high-pass filter, but I don't know if it would be better than a filtering shield (if it exists).