Hacking Touch Screens to Count Pulses

Heart rate sensors available for DIY use employ photoplethysmography which illuminates the skin and measures changes in light absorption. These sensors are cheap, however, the circuitry required to interface them to other devices is not. [Petteri Hyvärinen] is successfully investigating the use of capacitive touchscreens for heart rate sensing among other applications.

The capacitive sensor layer on modern-day devices has a grid of elements to detect touch. Typically there is an interfacing IC that translates the detected touches into filtered digital numbers that can be used by higher level applications. [optisimon] first figured out a way to obtain the raw data from a touch screen. [Petteri Hyvärinen] takes the next step by using a Python script to detect time variations in the data obtained. The refresh rate of the FT5x06 interface is adequate and the data is sent via an Arduino in 35-second chunks to the PC over a UART. The variations in the signal are very small, however, by averaging and then using the autocorrelation function, the signal was positively identified as a pulse.

A number of applications could benefit from this technique if the result can be replicated on other devices. Older devices could possibly be recycled to become low-cost medical equipment at a fraction of the cost. There is also the IoT side of things where the heart-rate response to media such as news, social media and videos could be used to classify content.

Check out our take on the original hack for capacitive touch imaging as well as using a piezoelectric sensor for the same application.

Easy-Peasy Heart Monitor

If you’re at all into medical hacks, you’ve doubtless noticed that the medical industry provides us with all manner of shiny toys to play with. Case in point is a heart-monitoring IC that’s so brand new, it’s not even available in all of the usual distributors yet. [Ashwin], who runs a small prototyping-supplies company, ProtoCentral, has been playing around with the new MAX30003 ECG chip, and the results look great.

The punchline is that the four-to-five dollar chip does everything for you, including analog filtering, wander removal, and even detecting the pulse rate. Using the chip is simple: you plug in two electrodes on one end, and you get the waveform data out over SPI on the other, with little or no work to do on the microprocessor side. The Arduino in the examples is just passing the SPI data straight to the laptop, with no processing going on at all.

[Ashwin] is selling these as breakout boards, but everything is open source, from the hardware to the GUI, so check it out if you’re interested in building your own. In particular, the circuit is just a voltage regulator and five volt level shifter.

Everything we know about electrocardiography projects, we learned from this presentation, and it looks like the devil is in the (many) details, so it’s nice to offload them to custom silicon whenever possible. We just think it’s awesome that we can scoop up some of the giant medical industry’s crumbs to play around with.

Measuring Heart Rate With A Piezo

Look around for heart rate sensors that interface easily to microcontrollers, and you’ll come up with a few projects that use LEDs and other microcontrollers to do the dirty work of filtering out pulses in a wash of light.

[Thomas] was working on a project that detects if water is flowing through a pipe with a few piezoelectric sensors. Out of curiosity, he taped the sensor to his finger, and to everyone’s surprise, the values his microcontroller were spitting out were an extremely noise-free version of his heart rate.

The piezo in question is a standard, off the shelf module, and adding this to a microcontroller is as easy as putting the piezo on an analog pin. From there, it’s just averaging measurements and extracting a heartbeat from the data.

It’s a much simpler solution to measuring a heart rate, and since two people haven’t heard of this technique, it’s likely a lot more people haven’t heard of this technique either. If you’re looking for an entry to The Hackaday Prize, this would be a great jumping off point for anything in either the fitness or medical domains.

Measuring meditation with a heart rate


We’ve seen our fair share of builds over the years that attempt to peer inside a user’s head and divine their state of mind. Whether the goal is to induce lucid dreaming or just reduce anxiety, we’re always impressed with how many ways you can detect moods with physiological measurements.  [Kirk] has been measuring his own physiology for months, and found the biggest change during meditation is the variability in his heart rate. Using that algorithm, he made an orb that changes colors when he’s meditating.

The hardware for the build uses a Bluetooth LE heart rate monitor connected to a smart phone communicating with an Electric Imp. After processing the heart rate data, the Imp triggers an RGB LED strip controlled with an Arduino.  The result is a plastic orb that glows whenever the user is displaying some sort of mindfulness, cross referenced with algorithm generated from mindlessly browsing the Internet.

Fitting a cold, metal heart in an Altoids tin


[James] has been building a heart rate monitor using a very cool TI chip. He needed a way to test his device, and commercial ECG simulators, like all biotech devices, are absurdly expensive. [James] decided to build his own heart rate simulator, and in the process made a great tool and one of the most well documented projects we’ve ever seen.

Of course, if you’re building an ECG simulator, you’re going to need a good sample of a heart’s electrical pattern. To get this sample, [James] found an old army manual with a diagram of an ideal ECG pattern. [James] took this PDF manual, screen capped the diagram, and used a Python script to generate an array in C the Arduino could repeat over and over.

The rest of the build consisted of a D/A converter, a pot to change the heart rate, a very nice seven-segment display, and a few banana jacks to connect to [James]’ heart monitor. Everything is up in a git, including an amazingly well documented (87 pages!) tutorial for building your own Arduino heart simulator.

Measuring a pulse with infrared light

The next time you’re unfortunate enough to make your way to a hospital, emergency room, or urgent care clinic, you’ll be asked to attach a small pulse monitor to your finger. The device the nurses clip on to one of your remaining digits is called a photoplethysmographic sensor, and basically it is able to read your pulse through reflected light. In the search to find out how these devices actually work, [Raj] sent in a great tutorial covering the theory behind photoplethysmographicy, and also built a simple device to detect a pulse without using a microcontroller.

These photoplethysmographic sensors operate by shining light into someone’s flesh – usually a finger or ear lobe – and recording the light reflected back to the source. The volume of blood in the finger will have an effect on the amount of light reflected back, and makes for a perfect way to automatically measure someone’s heart rate.

To build his device, [Raj] used a TCRT1000 reflective optical sensor. Inside this sensor is an infrared LED and a phototransistor. Of course with a finger over the sensor there is a ton of noise both from ambient light and the base rate of reflected light from a piece of flesh. [Raj] filtered this out, leaving only the small variations in the amount of reflected light, thus creating a very simple – and very inexpensive – electronic pulse meter.

Monitor your heartbeat with a webcam and a flashlight

After seeing some heart rate monitor apps for Android which use the camera and flashlight features of the phones, [Tyson] took on the challenge of coding this for himself. But he’s not using a smart phone, instead he grabbed a headlamp and webcam for his heat rate monitor.

To start out he recorded a test video with his smart phone to see what it looks like to cover both the flash LED and camera module with his thumb. The picture is mainly pink, but there’s quite obviously a color gradient that pulses with each gush of blood through his skin. The next task was to write some filtering software that could make use of this type of image coming from a webcam. He used C# to write a GUI which shows the live feed, as well as a scrolling graph of the processed data. He took several tries at it, we’ve embedded one of the earlier efforts after the break.

Continue reading “Monitor your heartbeat with a webcam and a flashlight”