WiFi Bottle Opener

Description
  • Date: November 4, 2023
  • Categories: Fun

Project Summary

In December 2022 it was fast approaching Christmas, and I realised I hadn’t got my Dad a present yet. I wanted to get him something memorable, not just a boring pair of socks. I remembered we used to have an Elvis Presley bottle opener, that would sing “Viva Las Vegas” when opening a bottle…We all found this hilarious, but one day it broke.

I set out on my quest to find this bottle opener, but found nothing. It was a really old product, not being sold anymore. Time to make one!

Investigation Phase

Initially, a bought a bog standard singing bottle opener from Amazon, with the hope that I could figure out how it actually works. I tore it apart and found a basic sound module, that I had zero idea how to program. I did find some useful information though, in that the part of the bottle opener that touched the bottle cap was split into two metal sections, and essentially the metal bottle cap would complete a circuit that triggered the musical sound.

Initial Concept

I couldn’t reprogram the bottle opener I had purchased, so I decided to tear all of the electronics out of it, and purchase something called a “Programmable Sound Module” on Amazon. These modules can be programmed with a button and a microphone, and then once you have programmed them, you can just disconnect the microphone and button assembly so that it fits into your ideal card / case or whatever you are using it for…Unfortunately this didn’t fit the bottle opener.

So, I can’t fit a normal sound module speaker in this thing…Project doomed.

Second Concept

At this point I stepped back and had a think. I can’t fit a speaker inside the case, so what can I do? I tried to think out of the box, and then it literally hit me…Have the speaker outside of the bottle opener. 

A bit of extra thinking later, and I settled on using my kitchens Sonos sound system to play the music. But how would this work?

Design / Implementation

I first started to figure out how to tell that a bottle was being opened, so that the “Viva Las Vegas” song could be played on the Sonos system. I realised I could use an RF transmitter, that would easily fit inside the bottle opener, and then receive this signal with a Raspberry PI and use some magic to get sound playing.
 

After deciding the above flow, I next purchased an RF receiver and transmitter from Amazon. I then started to do some research into the GPIO pins that my Raspberry Pi 3 had, as I had only limited practice of using them before this project. I knew that I would need to use them to detect when the receiver was detecting an RF signal.

Following on from this research, I produced the following basic electrical diagrams for my interpretation of how the components would interact on both the bottle opener side, and the Raspberry Pi side.

At this point it was time to start thinking about programming. To be honest, I started with a nice clean Github repository, and then I gave up pulling/fetching it to the Raspberry Pi and just started locally developing and debugging on the device. I’ve since lost the SD card that the OS was on and I also cleverly deleted the repository…

Essentially the code used the RPi.GPIO library to detect inputs from the 5v GPIO port connected to the receivers VCC output. I used SoCo to connect to the Sonos speakers, and the device would spin up a media server with the song to playback, and then on each receiver input, SoCo would tell the local Sonos API the location of the selected song to play.

During programming, I of-course had to set up the hardware as-well. Debugging usually takes a while, and if I had opened a can of beer each time I tried to test the thing, I probably wouldn’t be alive to tell this story. Instead, whilst locally testing I just hooked up the transmitter module to a button. Once I had finished debugging, I then put the transmitter module inside the bottle opener and soldered it to the existing contacts.

I don’t actually have any pictures of the Raspberry Pi and receiver, but I have managed to find a video of myself showcasing the prototype. You’re going to have to ignore the fact that I’m using my finger to test the unit, I wasn’t really thinking about publishing this video when I made it…

You will notice that the status LED is constantly flickering due to the RF noise being picked up – more on this later – but the LED completely turns off when the bottle opener contacts are connected.

Challenges

There where many challenges with this project. The first major challenge was the time pressure I placed on myself, having committed to this being the sole present for my Dad, I couldn’t just accept tons of his gifts on Christmas and then present him with a pile of electrical junk…

The first technical challenge was clearly not being able to find a small enough sound module to fit inside the bottle opener, leading to the thought of using an RF transmitter instead – and thus a vastly larger and more complex project scope.

The second challenge was learning how to solder…I had a tiny amount of soldering experience before this project, but the bottle opener casing I had, used tiny wires to connect to the contacts, and every mistake would just make them shorter. I didn’t have a second case to play around with, so I was facing quite some pressure to get solders right the first time around. I practiced soldering by just connecting small wires I had from a Raspberry Pi kit, before attempting the real thing.

The third and final challenge was unfortunately not solved before Christmas day. I had not anticipated the amount of RF interference in a typical house. When thinking back, it is clear that this would be an issue given my home uses lots of smart devices. Whilst you can physically see the LED flickering in the above video and then turning off completely on the bottle openers contacts being connected, this was extremely hard to determine in the code as I could not figure out how to determine the voltage being detected from the GPIO pin, instead it seems that the library I was using only supported telling me whether the contact was powered or not…I may have got this wrong, but at the time that was my conclusion.

Essentially, when the device was powered on, it would seem to work as normal, but every now and then the Kitchen speakers would randomly erupt with “VIVA LAS VEGAS”, not exactly great! I am now aware that there is a mechanism to set specific values in the RF signals, so that the transmitter and receiver can be more accurately “tuned” if that is the correct word.

 

Closing Notes

Overall the project was a slight success, but it could definitely be turned into a success if I where to approach it again.

If you’ve read this far, thanks for sticking with my writing! I feel I’ve rambled a lot here, and would really love some feedback to help improve my writing style as I continue to publish more of my old projects. Send over any feedback to: contact@jackdevonshire.co.uk