this post was submitted on 31 Oct 2023
98 points (99.0% liked)

DIY

2842 readers
3 users here now

Share your self-made stuff and half-baked projects here.

Also check out !diy@beehaw.org

There is also a related XMPP chat.

founded 2 years ago
MODERATORS
 

My grandmother recently lost her vision. She wanted a sound recorder so she could continue writing/recording her stories, but she's never been comfortable with computers or small electronics, even when she could see them. One of the features she really wanted was automatic transcription voice to text. But all the voice recorders I could find online, even simple ones, seemed like they'd be hard for her to use. They had small buttons, recessed into the case (she has trouble feeling stuff like that), switches on the sides, multiple modes, screens she couldn't see, etc. After the last year of trying to find various devices for her, and of being frustrated at how overly complicated devices supposedly intended for the elderly and vision-impaired still are, I decided to just build something that would actually fit her needs. Unfortunately, I had just a week to do it in before I was heading up to visit.

The goals:

  • It had to be aggressively simple to use. No modes, no settings, no buttons combos to remember.
  • It had to support advanced features (transcription was one she really wanted, but just being able to get the voice files out to relatives easily was big)
  • Sturdy design

I googled around and found this tutorial for making a spy device from a raspberry pi. It was pretty much perfect - when it detected motion, the device was meant to record audio, transcribe it, and then send the transcription out to the 'spy' as an email. That was perfect - email is a robust system all my other relatives are familiar with, figuring out what to do with the files, renaming them, forwarding them as necessary is well within their abilities. Plus the email account could act as a backup.

I started with setting up a button. I used this tutorial as my guide, and used an old arcade button left over from helping a friend build an arcade cab. I soldered a 220 resistor in line with the button per the tutorial. The arcade button was a good fit - it's designed for this kind of project and mounts easily to a hole drilled through a board, it's big and raised up, meaning its easy to find.

Then it was on to the python code:

The changes I had to make were mostly around the motion sensor. We were going to replace that with a single button. Push it once, it plays my voice saying 'recording' and starts recording. Push it again, it stops recording and says 'stop'. It's been years since I wrote python code, but all I really had to do with identify the parts relevant to my requirements and make changes. I ended up using this code for preventing button bounce, since the built-in GPIO features failed to prevent it. The only change was a minor adjustment to the end of look_for_triggers() (which will show up in my code,) because it was preventing the second button press from being detected. I basically just stitched the button_callback() function to start_recording() and replaced the for loop in audioRecording() with a while loop to support variable-length recordings based on the button press. And I used pygame to play my voice audio. The other change I added was to the email feature. I added some try and except error catching, so failing to send an email (like if her wifi goes down) won't crash the program. I won't be around to start it up again so I wanted it to be robust, and to degrade gracefully. I explained that if it says 'email error' after 'stop' that just means it couldn't send an email, but the file is still saved and the program still works.

After getting email to work, the next job was to make sure the program ran as soon as the raspberry pi booted up. My grandmother has lots of friends who love to help, which often means unplugging things, moving them around, losing them, finding them, reorganizing her house, and mailing back audiobooks she hasn't listened to yet. I needed this thing to be able to survive power loss and general curious fiddling. And if it crashed, power cycling would be an ugly but functional way to restart the program.

I used this guide and modified the line to say @reboot python3 /home/audio/sound_recorder_good.py

Once that was done, I found I had to replace the 'input("Press enter to quit")' line at the end of the main function with an endless while loop, because the program was no longer running from the terminal and couldn't use input.

You can find my code here: https://mega.nz/file/OJV1hZJB#pVeddKWKu6EwC6yxiMMsSVSCQdoTUkhtcfWM6ryAYIw

At this point, it was pretty reliable, so I started work on the physical case. It's basically just a wooden box containing the pi, a button, a speaker, the microphone, and built to keep people from opening it up, unplugging components, or fiddling with the speaker settings.

I wrote the woodworking part up with pictures here: https://imgur.com/a/xiVjvdQ

The last of the setup was just connecting it to my grandmother's wifi, packing it all into the case, and making sure it still worked before showing her how to use it. She was very pleased with the overall design, she's going to test it for a couple weeks while I'm away, and if she wants, I'll add transcription and urethane the case when I get back.

top 10 comments
sorted by: hot top controversial new old
[–] FuckThePolice@lemmynsfw.com 7 points 1 year ago (1 children)

This was awesome in so many ways. You are a great grandchild and I'm sure she's grateful to have you.

[–] JacobCoffinWrites@slrpnk.net 7 points 1 year ago (1 children)

Thank you!! Once she felt the case and found the button, and I explained that it was the only one and how to use it, she was very happy. Surprised it could send emails and all with just one button press, but happy.

The code is very hacked together so I'm praying it holds up while running constantly for the next couple weeks. I just realized yesterday morning that I didn't set any kind of limit on how long it'll try to record. But I can always make improvements as we go.

[–] FuckThePolice@lemmynsfw.com 3 points 1 year ago (1 children)

All my code looks hacked together lol. You didn't touch on it but what did you do for remote management? If you did the desktop environment on the pi you could just install team viewer as they have a package for it or setup a wireguard tunnel.

[–] JacobCoffinWrites@slrpnk.net 4 points 1 year ago

It's just set up with Raspberry Pi OS Lite - when I was working on it in my apartment, I was SSH-ing into it, but I never set up anything to control it at her place. That would definitely be a great next step, but I genuinely hadn't thought about it until now.

[–] Bluefruit@lemmy.world 6 points 1 year ago (1 children)

This is not only a cool project but quite the labor of love. Really cool stuff man.

[–] JacobCoffinWrites@slrpnk.net 5 points 1 year ago

Thank you! I really appreciate it

[–] EnlightenMe@lemmy.world 6 points 1 year ago (1 children)

Really great project, well thought-out and seemingly implemented. Super impressed, I love how much attention was put on it being sturdy and reliable. I wish more of my tech was designed like this lol

[–] JacobCoffinWrites@slrpnk.net 3 points 1 year ago

Thank you! For a few years now, while trying to help her with her diminishing vision, I've been amazed at how hard it is to find electronics that work well for older folks with poor vision. Whether it's an extra-loud, large-button phone with 15 extra buttons for her to get mixed up with, a supposedly-made-for-old-people answering machine with several menu buttons that interrupt its function, or a coffee maker that requires you to hit one button, load the coffee pod, then hit three more buttons, all in the correct order, unless water is low, in which case you refill it then do them in a different order. Easy for most people to get used to, but hard when you received it after going blind.

I feel like all this stuff needs like, two interfaces. The one she uses which needs to be simple and tactile, and the one designed for a tech-savvy relative or neighbor to configure for them. But it's all built on basic consumer products with tons of modes and settings, and they don't want to remove features, and they can't count on that relative existing, so they split the difference. And they don't think about how easy it is to accidentally brush the tiny volume slider all the way down and not hear your phone for days.

As for this thing, if I lived with her and could tend to it, I'd say it should be exactly what she wanted. Unfortunately it'll have to fend for itself for weeks at a time, and any error or crash could erode her confidence in it. I tried to make it resilient and to think about all the ways it could get messed up short of someone dumping tea over the top of it, but we'll find out how well I did over the next few days. Once I add the next step from the spy device, the transcription (which I ran out of time to add) I'll try to have it fail in stages - ideally it records, transcribes, and emails out the audio file and the transcription. If transcription fails, it'll still send out the audio file. If email fails, it still records to the device.

[–] Fediforza@lemm.ee 5 points 1 year ago

What a cool project!

[–] FfaerieOxide@kbin.social 4 points 1 year ago

I was over here thinking, "...fucking tape recorder?" but look at you being all scientific with emails and speech-to-text.