Mari mentioned the other day she was looking at portable electrocardiograms (she’s a medic). I remembered I’d impulse-bought an ECG module from Banggood a while back, about €10, epidemic paranoia presumably. Hadn’t got around to playing with it.
I’m thinking, add whatever’s necessary to hook it up to a phone, use an oscilloscope app (plenty available, I’ve used one called Oscope for music stuff – is handy, has spectrogram).
Useless documentation from China, but googling yielded a SparkFun article, AD8232 Heart Rate Monitor Hookup Guide. How to wire such a module up to an Arduino, monitor the signal on computer over serial.
Attach electrodes to connect electrically with your heart, connect these to typically mains voltage powered equipment. Hmmm. But hobby electronics did lose it’s edge a bit when high voltage tubes went out of fashion. Bring on the Tesla coil, Herr Doktor!
[That reminded me of a punk song that had ‘electroencephalograph’ in it’s bridge, took me a while to find – Radio Stars – Nervous Wreck 1978 – more glam rock than punk, but still a brilliant line]
Anyway, the article gave good hints, and a bit more googling proved fruitful. The module is open source hardware (yay!). The schematic & gerbers are up on Github. Where is the module specification though? Someone must have decided on requirements to come up with the component values.
Whatever, the AD8232 (datasheet) from Analog Devices is designed for this purpose, looks fairly sophisticated, that bodes well. Essentially an instrumentation amplifier, a spare op amp or two for filters. I’ve not checked, but presumably the module is pretty close to the circuits in the datasheet.
Key information from Sparkfun, the pinout:
|Board Label||Pin Function||Arduino Connection|
|3.3v||3.3v Power Supply||3.3v|
|LO-||Leads-off Detect –||11|
|LO+||Leads-off Detect +||10|
3.3v is a bit of a pain, but according to the datasheet the AD8232 will work down to 2v, so 2xAA batteries would be an option. I’d got a PP3 battery and a breadboard 3.3v regulator at hand, so went with those for now.
From the schematic, the output on the module comes straight from one of the AD8232’s op amp outputs. From the datasheet the voltage swing is 0.1 -> Vs-0.1 v. Given that the Sparkfun article has it hooked up to an Arduino analog in I think it’s fair to assume there’s going to be a good 1v peak-to-peak at least.
I’m not sure what the mic in of phones is usually spec’d at, probably a fair bit lower than that, so a little bit of attenuation likely needed. (Hmm, bandwidth? From an external signal, can a phone read something that’s pretty low frequency?).
One step at a time.
I popped the PSU and ECG module on a breadboard, hooked it up to a mini-oscilloscope, plugged in the electrodes.
I am quite risk-averse (when sober) so was aware of the USB-powered ‘scope, especially where the electrodes were attached :
This was an issue. The electrodes are colour-coded, red, green, yellow. But I couldn’t find indication anywhere of which went where. So trial & errored it. Then looked again, there are pads on the module marked RL, LA, RA. Multimeter revealed :
Yellow : Right Leg
Green : Left Arm
Red : Right Arm
It was definitely amplifying something, sometimes. There’s an LED on the module that it suggests somewhere should pulse. I didn’t see that, only saw full-on, off, wavering noisiness. On the scope I very briefly saw pulses in time with my heart, but with an awful lot of noise, maybe 1v peak to peak.
After the trial and error I don’t think the electrodes were making good skin contact.
So I’m leaving it there until I get some more electrodes (€11 for 100! on Amazon.it – maybe).
Also the module exposes two pins of the chip : “…leads off detection. It features ac and dc
detection modes optimized for either two- or three-electrode configurations, respectively”.
So I think it’ll probably be worth reading the datasheet a little more, hooking those up to LEDs.
To be continued…