In my English 1102 class at GA Tech this summer, we were assigned a project: present on a topic of curiosity. While there were options to create a book or a website, my group decided to make an exhibit of physical objects. In keeping with the standards of museums, I thought I would create an audio device to accompany the visual exhibit. This would be a perfect use for my Raspberry Pi.
To start, I would need a box to place the device and accompanying circuitry and speaker in. I purchased one from a craft store that fit the required dimensions. Next, I set up the button circuit on a breadboard. I finally got it working after following this post on using buttons with the Pi’s GPIO pins.
Later, I decided to add an LED that would light up when my script ran so I would know it was ready to go.
The next issue I needed to solve was what speaker to use. As it turned out, that day I won a portable speaker by coincidence that would do the job well. It had Bluetooth connectivity but fortunately also a line-in connection.
I was hoping that the speaker would fit inside the box but unfortunately it would stick out of the top a bit. This meant I needed to drill a hole not only for the button but for the speaker as well. Time to get out the tools!
I used a brace and bit to drill the large hole for the speaker. I used a drill to make the smaller hole then finished it with a Dremel tool.
Now it was time to solder the components together. I haven’t done much soldering for a long time, so it was a bit like learning again. When soldering components such as resistors, care must be taken not to overheat them. The alligator clips act as heat sinks when clipped between the resistor and the area being soldered.
I ended up changing my plans halfway through the soldering process, because of the button. I ended up soldering the button to a piece of wire, threading it through the hole, then soldering that wire to the rest of the circuit. This ended up being a much better idea than stuffing the wires you see above through the hole and connecting them directly to the button.
Here is the box with everything inside (except for the battery). On the right is the Raspberry Pi, in the middle is the circuit for the button, and on the left is the speaker with room for the battery.
Here is the final project:
I used a small portable usb charger to power the Raspberry Pi, and it lasted as long as I had it on (over 2 hours).
The Python code I wrote went through a number of changes as I worked on the project. Here is the final version that I used.
This was a fun project to get me started with using the Raspberry Pi’s GPIO pins. Next, I would like to delve into the interesting world of home automation.