call_end

    • Pe chevron_right

      A DIY digital stethoscope for cats

      comics.movim.eu / PepperCarrot • 24 April • 4 minutes


    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.