A DIY digital stethoscope for cats

Published on

Hey everyone, I'm taking a break from my usual digital painting topics to share a special DIY project. I'm not sure who this will help, but I think there's a place for it on my blog somehow. Who knows, maybe it will spark some ideas for your own DIY projects.

Recently, during a routine health check of my four cats, I found out that one of the band might have heart problems, the younger one "Geuloush". I'll tell you right away he's fine, everything is fine, but he just has a little abnormality that needs to be monitored.


Preparing the annual vet routine for the four cats.

So, after a long trip to a specialized vet's office, one in France with an expensive animal echocardiogram (which was an adventure in itself) I was told to monitor his heartbeat monthly. The vet's advice was to just put my finger on his pulse and count, but I was skeptical. I mean, cats have a heartbeat of 140-220 bpm, that's ridiculously fast! The vet seemed confident that it could be done and I was a little too washed up from the whole experience to question the thing. You see, the echocardiogram was a bit of an ordeal: it took all the morning, my cat was covered in echocardiogram gel, and we were in an operating block shared with dogs. So I just nodded and agreed that I'd do my best.


"Geuloush", the star of this article, knows the most charming positions.

Needless to say, when I got home, I realized that manually counting my cat's heartbeat was impossible. I tried the online tip of counting for 15 seconds and multiplying by four, but even that seemed daunting. So I started looking for a machine that could do the job for me, like the one the vet had in his office. But to my surprise, these machines were very expensive and mostly aimed at vet offices.

That's when I decided to get creative and go the DIY route. I figured that if I could just hear the heartbeat more clearly, I might be able to use some audio magic to count it. I picked up a cheap stethoscope (less than 10€) and a low-quality lavalier USB microphone I already had that worked plug-and-play on my Linux machine (around 10€ too).

After doing some research, I found a lot of helpful videos on the subject that showed me how easy it was to attach a microphone to a stethoscope. You just cut the rubber tube and put the microphone inside. Voilà.


A lavalier mic inside the tube of a stethoscope: the USB stethoscope! Peak DIY.

And with that setup, I was able to record my cat's heartbeat using Audacity on my Debian KDE machine. Of course, getting my cat to cooperate was a challenge. At first, all I got was a lot of loud purring that masked the heartbeat sound. But I was patient, and after a few minutes he fell asleep and I managed to get a clean recording.


He didn't even realize he was sleeping on this metal thing.


Audacity hint (red framed): you can toggle the lower view duration to see the length, it helps to select exactly 15 seconds.

▶️ Audio sample: listen the heartbeat of my cat (15sec, ogg)

From there, I cropped a 15-second sample, took a screenshot of the waveform, and used Krita to highlight the most obvious beats. Then it was just a matter of counting and multiplying by four to get an approximate measurement:

41 counted x 4 = 164bpm.

All is well, he is a relaxed cat 😺.


Counting the beats, highlighted here for the blog-post.

I'll be tracking these measurements in a LibreOffice Calc spreadsheet, complete with a graph, so I can keep a close eye on my cat's health.

That's about it! It's not the most conventional DIY project, the DIY part wasn't even really exciting or challenging, but it was an interesting challenge to count the beats per minute of a cat, and I was able to get something that works. I hope it inspires someone else to get creative with everyday problems. And if you have more ideas on how to improve this rig, I'd love to read them.

Update

2025-04-27: Thanks Hackaday for the featuring!

2025-04-29: Thanks to a comment by Nia Valentine, I tried the automatic bpm (beat per minute) analysis with the software mixxx. At first, I was skeptical, because I already tried to detect beats with the CLI software bpm-tools and didn't get a result close to the manual counting.

The difference: mixxx has an option "Assume constant tempo" that you can disable in the settings. After that it does the job pretty well and as easy as just playing the audio. It found 169bpm on a longer sample, which is close enough to the 164bpm I found manually. So I'm validating this approach. That's very good news because it simplifies the counting process and also the trimming of the audio to exactly 15 seconds. I can now sample a larger amount of good quality audio and let mixxx do the work. More info in the mixxx beat detection documentation.


The user interface of Mixxx, loading a longer sample, my mouse cursor is over the bpm analysis number.



License: "A DIY digital stethoscope for cats" by David Revoy − CC-BY 4.0
Tags:  #DIY   | Download: Markdown
31 comments

31 comments

link ElectroFetish   - Reply
ElectroFetish@mastodon.social

over cute!

link ducksauz 🦆   - Reply
ducksauz@snug.town

That is very cool. Thanks for sharing! 😻

link jan Tusi (trucy) 🏳️‍⚧️🔞   - Reply
trucy@girlcock.club

woah, congrats! There’s probably a way to detect those spikes and count them, but that might be over-engineering (aka: fun)

link Alex@rtnVFRmedia Suffolk UK   - Reply
vfrmedia@social.tchncs.de

@trucy I guess this is multispecies, and could equally work for dogs (and humans?)

link David Revoy Author, - Reply
davidrevoy

@vfrmedia @trucy Yes, probably multi-species. Human and Cat confirmed. Dog sounds like a solid assomption to do. 😆

2 ★

link David   - Reply
astrovore@gts.vidja.club

that's super cool. Listening to the recording I agree that trying to count that manually would be a nightmare!

I wonder if one of those little clicker counters they use to count crowds could work here too.

Edit: I looked it up and the thing I'm thinking of is a "tally counter".

link David Revoy Author, - Reply
davidrevoy

@astrovore Thank you for the clicker idea. I might give it another try with my fingers to get the pulse.

link Alexey Skobkin   - Reply
skobkin@gts.skobk.in


Are you recording the purring through the couch? :philosoraptor:

link David Revoy Author, - Reply
davidrevoy

@skobkin Haha, yes, the picture for the header of the article is a bit confusing for the positioning. 😆 In the article, I show where I position it (between the front leg, under him).

link κρ🦥μγ   - Reply
kpmy@m.ocsf.in

got sum' purr audio drugs? 💉

link David Revoy Author, - Reply
davidrevoy

@kpmy I tried! But the sound of the stethoscope is really 'from inside', it's full of infrabass, but I'm sure I could try to capture better purring session with my mic I use to capture my voice for my videos.

But here is a sample of two purrs, captured with the USB Stethoscope.

📎 be70ad9074b87e50.mp3  7 ★

link jezra   - Reply
jezra@pleroma.jezra.net

very cool! thank you for sharing.

link Proton25   - Reply
Proton25@mastodon.social

You may want to apply a lowpass filter on the recorded audio. The heartbeat is only several hundred Hz and you don't need the noise at higher frequencies. Try a 1 KHz lowpass filter and see what the recording looks like. It may make counting easier. You can play with the value until you get a good result.
If you are feeling a little motivated, you can use Blender to help you with the counting using a Python script...

link David Revoy Author, - Reply
davidrevoy

@Proton25 Thank you very much for the tips. Yes, I tried various filters in Audacity in case a EQ or something could make the result easier to count, but it's not really working. But for sure, if I want to automatize, Simplifying the audio and contrasting the heartbeat is definitely the good starting point.

link Irina Krita team, - Reply
irina@wandering.shop

Wow, that's so cool!

link devSJR :python: :rstats:   - Reply
devSJR@fosstodon.org

You have the audacity to record a cat?

link David Revoy Author, - Reply
davidrevoy

@devSJR 🤣 👍

link Xalofar, bookworm ⚰️   - Reply
Xalofar@shelter.moe

Oo
Et on peut vraiment s'en servir comme stéthoscope?!?

link David Revoy Author, - Reply
davidrevoy

@Xalofar Tout à fait, ça marche bien. Je me disais que si un⋅e streameur⋅e gaming horror/suspens se collait ça en source audio dans OBS, ça pourrait vivement communiquer sur les moments de réel flip.

3 ★

link Mekki   - Reply
mekki@mas.to

Love this! Prob gonna try with my fur babies!

link Proton25   - Reply
Proton25@mastodon.social


This is after applying a bandpass filter and a noise gate. Much easier to count...

🖼️ ab35cc03d94c9e10.png 

link David Revoy Author, - Reply
davidrevoy

@Proton25 That looks good indeed! Can you guide me a little bit more on how to reproduce this? Thank you.

link Proton25   - Reply
Proton25@mastodon.social


Of course!
Start out with applying a Filter Curve EQ. effect. Take out the lower frequencies below 40Hz and the high frequencies above 600Hz. This will already improve things. The final step is to apply a gate in order to remove the low volume noise. I used a Calf Gate (part of the calf plugin suit that you can find in the extra repo in Arch based distro) that I installed for my DAW and is available in Audacity. You can play around with the threshold - I used values around 0.3-0.4.

🖼️ e7475a76dd2520ad.png  🖼️ a6975d872503e0a3.png 

link David Revoy Author, - Reply
davidrevoy

@Proton25 Thank you very much for the detailed how-to with screenshot, it will help me a lot. 👍

link Proton25   - Reply
Proton25@mastodon.social


It is the least I could do for someone who has provided me (and others) with so much information and value for several years.

link Andrea :fckafd: :fcknzs:   - Reply
AndreaKusel@digitalcourage.social


Thank you for the beautiful blog post!
Cats, care, a diy project, and open source software, all in one post! What else could one wish for?

link Valvin (framapiaf) Contributor - Pepper&Carrot admin and dev, - Reply
valvin

oh good job ! thanks for sharing

link ElectroFetish   - Reply
ElectroFetish@mastodon.social

special thanks for your easy site, which I can comfortably browse from my old Fujitsu Siemens

🖼️ 14d97289c2539f96.jpg 

link Rabidchaos   - Reply
rabidchaos@hachyderm.io

"the DIY part wasn't even really exciting or challenging" When it's for something important like health, I don't see those as downsides! It is a very nice walkthrough that I hope I don't have to refer back to as my pair get older.

link Denkodama   - Reply
denkodama@mastodon.art

hey you are on Hackaday now !
hackaday.com/2025/04/27/quick-

link David Revoy Author, - Reply
davidrevoy

@denkodama :blobcheerbounce: Wohoo! So happy to see Geuloush featured on Hackaday. Cute!

2 ★


Post a reply

The comments are synchronised every 12h with the replies to this post on Mastodon:


How to use this? (click here to unfold)
Open a new Mastodon account on the server of your choice. Then, Copy/Paste the adress above in your Mastodon 'Search' field. The post will appear and you'll be able to fully interact with it. You'll have full control of your posts: edit, remove, etc. After that, your message will appear here.

Just please note that it may take up to 12 hours for your changes to be reflected here.