Webcam Heart Rate Monitor Brings Photoplethysmography To Your PC

It seems like within the last ten years, every other gadget to be released has some sort of heart rate monitoring capability. Most modern smartwatches can report your BPMs, and we’ve even seen some headphones with the same ability hitting the market. Most of these devices use an optical measurement method in which skin is illuminated (usually by an LED) and a sensor records changes in skin color and light absorption. This method is called Photoplethysmography (PPG), and has even been implemented (in a simple form) in smartphone apps in which the data is generated by video of your finger covering the phone camera.

The basic theory of operation here has its roots in an experiment you probably undertook as a child. Did you ever hold a flashlight up to your hand to see the light, filtered red by your blood, shine through? That’s exactly what’s happening here. One key detail that is hard to perceive when a flashlight is illuminating your entire hand, however, is that deoxygenated blood is darker in color than oxygenated blood. By observing the frequency of the light-dark color change, we can back out the heart rate.

This is exactly how [Andy Kong] approached two methods of measuring heart rate from a webcam.

Method 1: The Cover-Up

The first detection scheme [Andy] tried is what he refers to as the “phone flashlight trick”. Essentially, you cover the webcam lens entirely with your finger. Ambient light shines through your skin and produces a video stream that looks like a dark red rectangle. Though it may be imperceptible to us, the color changes ever-so-slightly as your heart beats. An FFT of the raw data gives us a heart rate that’s surprisingly accurate. [Andy] even has a live demo up that you can try for yourself (just remember to clean the smudges off your webcam afterwards).

Method 2: Remote Sensing

Now things are getting a bit more advanced. What if you don’t want to clean your webcam after each time you measure your heart rate? Well thankfully there’s a remote sensing option as well.

For this method, [Andy] is actually using OpenCV to measure the cyclical swelling and shrinking of blood vessels in your skin by measuring the color change in your face. It’s absolutely mind-blowing that this works, considering the resolution of a standard webcam. He found the most success by focusing on fleshy patches of skin right below the eyes, though he says others recommend taking a look at the forehead.

Every now and then we see something that works even though it really seems like it shouldn’t. How is a webcam sensitive enough to measure these minute changes in facial color? Why isn’t the signal uselessly noisy? This project is in good company with other neat heart rate measurement tricks we’ve seen. It’s amazing that this works at all, and even more incredible that it works so well.

USB Webcams Out Of Stock? Make One With A Raspberry Pi And HQ Camera Module

More people working from home has had an impact on the cost and availability of USB webcams, so [Jeff Geerling] got around the issue with a DIY solution that rang in around $100. It consists of a Raspberry Pi and HQ camera module acting as a USB webcam, and there is no messy streaming of ffmpeg over the network masquerading as a camera device or anything. It works just as a USB camera should.

[Jeff] chose a Raspberry Pi Zero and HQ camera module for his unit, making a tidy package that might not be quite as small as commercial webcams, but is certainly perfectly respectable as a USB camera. That being said, there are a few drawbacks, namely the lack of a microphone or autofocus, latency issues at higher resolutions, and the need to shut down the Pi cleanly.

Check out the GitHub repository for everything needed to set up your own, including a complete hardware list and some options for mounting. [Jeff] also tested whether the camera would work with the new keyboard-embedded Raspberry Pi 400, and it absolutely does. Embedded below is a video walkthrough and demonstration of the whole project, so check it out.

Continue reading “USB Webcams Out Of Stock? Make One With A Raspberry Pi And HQ Camera Module”

A Teleprompter For The Rest Of Us

Sometimes it’s so easy to become tied up in a world of microcontrollers and complex mechanical linkages that we forget the simplest of hacks can be the most elegant. [Lex Kravitz]’s teleprompter is a good example, delivering the measured style of a professional addressing the studio camera to the laptop owner with a built-in camera nestled above their screen.

Just because this teleprompter is simply a mirror and a piece of clear plastic doesn’t mean that it’s a poor quality implementation though. It’s housed in a smart two-piece 3D-printed frame that hooks over the top of the monitor and locates with an area of screen into which you can place your teleprompter software. This is a world into which we haven’t previously delved, so aside from the array of Windows freeware that pops up in a Google search we found there are a few opensource offerings. There is TeleKast which appears to be no longer updated, and Imaginary Teleprompter, which even has an online version you can try in a web browser.

[Lex] is no stranger to these pages, having most recently appeared as part of our PPE testing Hack Chat.

Mirror, Mirror, On Your Cam, Show Us What You’ve Drawn By Hand

Working and learning from home may be the new norm, and if IKEA shelves are any indication, folks are tricking out their home office with furniture, gadgets, and squishy chairs. While teleconferencing has proven to be an invaluable tool, paper documents aren’t going down with out a fight.

Unfortunately dedicated document cameras require significant space and monies, so they’re impractical if you only share once in a while. [John Umekubo] didn’t want students and teachers hobbled by the same costs and inconveniences, so he modeled a mirror holder that slides over a laptop’s webcam and directs the view downward.

[John]’s adventures started with a Twitter post, as seen below, but the responses were so encouraging that he published his design on Thingiverse for everyone. There’s also a version that can be laser cut out of cardboard, though we imagine a pair of scissors would work in a pinch. He admits there’s already a consumer model, but wasn’t planning to sell them anyway. Like us, he wants to get people to share their work.

We recently covered a simpler version of the same idea in use at Northwestern University, and we’ve seen a similar hack that gives a split-screen effect to sketch and maintain eye contact. If you want to share the view in your room, we have a Raspberry Pi streaming option that’s worth checking out.

Continue reading “Mirror, Mirror, On Your Cam, Show Us What You’ve Drawn By Hand”

Hackaday Links Column Banner

Hackaday Links: August 9, 2020

We regret to admit this, but we completely missed the fact that Windows 10 turned five years old back in March. Granted, things were a little weird back then — at least it seemed weird at the time; from the current perspective, things were downright normal then. Regardless, our belated congratulations to Microsoft, who, like anyone looking after a five-year-old, spends most of their time trying to keep their charge from accidentally killing itself. Microsoft has done such a good job at keeping Windows 10 alive that it has been installed on “one billion monthly active devices”. Of course, back in April of 2015 they predicted that the gigainstall mark would be reached in 2018. But what’s a couple of years between friends?

Of all the things that proved to be in short supply during the pandemic lockdowns, what surprised us most was not the toilet paper crunch. No, what really surprised us was the ongoing webcam supply pinch. Sure, it makes sense, with everyone suddenly working from home and in need of a decent camera for video conferencing. But we had no idea that the market was so dominated by one manufacturer — Logitech — that their cameras could suddenly become unobtainium. Whatever it is that’s driving the shortage, we’d take Logitech’s statement that “demand will be met in the next 4-6 weeks” with a huge grain of salt. After all, back-to-school shopping is likely to look vastly different this year than in previous years.

Speaking of education, check out the CrowPi2 STEM laptop. On the one hand, it looks like just another Raspberry Pi-based laptop, albeit one with a better level of fit and finish than most homebrew Pi-tops. With a Raspberry Pi 4b on board, it can do all the usual stuff — email, browse the web, watch videos. The secret sauce is under the removable wireless keyboard, though: a pretty comprehensive electronics learning lab. It reminds us of the Radio Shack “150-in-One” kits that so many of us cut our teeth on, but on steroids. Having a complete suite of modules and a breadboarding area built right into the laptop needed to program it is brilliant, and we look forward to seeing how the Kickstarter for this does.

Exciting news from Hackaday Superfriend Chris Gammell — he has launched a new podcast to go along with his Contextual Electronics training courses. Unsurprisingly dubbed the Contextual Electronics Podcast, he already has three episodes in the can. They’re available as both video and straight audio, and from the few minutes we’ve had to spend on them so far, Chris has done a great job in terms of production values and guests with Sophy Wong, Stephen Hawes, and Erik Larson leading off the series. We wish him luck with this new venture, and we’re looking forward to future episodes.

One of the best things about GoPro and similar sports cameras is their ability to go just about anywhere and show things we normally don’t get to see. We’re thinking of those gorgeous slo-mo selfies of surfers inside a curling wave, or those cool shots of a skier powder blasting down a mountain slope. But this is the first time we’ve seen a GoPro mounted inside a car’s tire. The video by the aptly named YouTuber [Warped Perception] shows how he removed the tire from the wheel and mounted the camera, a battery pack, and an LED light in the rim, then remounted the tire. The footage of the tire deforming as it contacts the ground is fascinating but oddly creepy. It sort of reminds us a little of the footage from cameras inside the Saturn V fuel tanks — valuable engineering information to be sure, but forbidden in some way.

DIY Personal Assistant Robot Hears And Sees All

Who wouldn’t want a robot that can fetch them a glass of water? [Saral Tayal] didn’t just think that, he jumped right in and built his own personal assistant robot. This isn’t just some remote-controlled rover though. The robot actually listens to his voice and recognizes his face.

The body of the robot is the common “Rover 5” platform, to which [Saral] added a number of 3D printed parts. A forklift like sled gives the robot the ability to pick things up. Some of the parts are more about form than function – [Saral] loves NASA’s Spirit and Opportunity Mars rovers, so he added some simulated solar cells and other greebles.

The Logitech webcam up front is very functional — images are fed to machine learning models, while audio is processed to listen for commands. This robot can find and pick up 90 unique objects.

The robot’s brains are a Raspberry Pi. It uses TensorFlow for object recognition. Some of the models [Saral] is using are pretty large – so big that the Pi could only manage a couple of frames per second at 100% CPU utilization. A Google Coral coprocessor sped things up quite a bit, while only using about 30% of the Pi’s processor.

It takes several motors to control to robot’s tracks and sled. This is handled by two Roboclaw motor controllers which themselves are commanded by the Pi.

We’ve seen quite a few mobile robot rovers over the years, but [Saral’s] ‘bot is one of the most functional designs out there. Even better is the fact that it is completely open source. You can find the code and 3D models on his GitHub repo.

Check out a video of the personal assistant rover in action after the break.

Continue reading “DIY Personal Assistant Robot Hears And Sees All”

Be On Twitter Without Being On Twitter

Social media can connect us to a vibrant worldwide community, but it is also a huge time sink as it preys on both our need for attention and our insatiable curiosity. Kept on a leash by those constant notification sounds, we can easily look up from our phones to find half a day has gone and we’re behind with our work. [Laura Lytle] has a plan to tackle this problem, her OutBox project involves a single button press machine that posts a picture to Twitter of whatever is put in it. It’s not just another gateway to social media addiction though, she tells us it follows Design For Disuse principles in which it must be powered up and adjusted for each picture, and that it provides no feedback to satisfy the social media craving.

Under the hood of the laser-cut housing reminiscent of an older hobby 3D printer is a Raspberry Pi 3 Model A+ and a webcam, with a ring of LEDs for illumination. On top is the only interface, a small “arm” button to set things up and a big red arcade button to do the business. The software is in Python, and provides glue between resizing the photo, uploading it to a cloud service, and triggering ITTT to do the Tweeting. You can see the whole thing in the video below, and the result is a rather eye-catching device.

Of course, there are other ways to keep yourself off social media.

Continue reading “Be On Twitter Without Being On Twitter”