Interactive Aquarium
This is an interactive aquarium! There are three cords which you can plug buttons/switches into - two of them play songs of your choice, and the third one lights up the aquarium with ocean blues and greens! If you have an aquarium that already happens to be broken and some free time on your hands, this is a super fun project for you! Also, full credit to Kevin, I couldn't have done it without him.
Supplies
Raspberry Pi - https://www.adafruit.com/product/4027
Circuit Playground Bluefruit - https://www.adafruit.com/product/4333
Battery Pack - https://www.adafruit.com/product/727?gclid=CjwKCAjwtfqKBhBoEiwAZuesiA_WtK_AvfCRkSubuqzWZo9e0l-t2gYC9cyofvPiR_EAjihfOLotCRoC0sIQAvD_BwE
Adafruit Neopixel LED Digital Light Strip - https://www.adafruit.com/product/1376?length=1
Similar Aquarium - https://www.amazon.com/Lightahead-Artificial-Tropical-Aquarium-Decorative/dp/B010MVJZ8E/ref=sr_1_3?keywords=light+up+moving+aquarium&qid=1638338973&qsid=139-2581476-7818337&sr=8-3&sres=B00Z8FTJE0%2CB010MVJZ8E%2CB089N6LMBY%2CB0859MJPMD%2CB07P8816L7%2CB07FTJ31XY%2CB08KZMG6YL%2CB08DC21RQH%2CB075QKKJ4P%2CB07P9L3M88%2CB075314RH2%2CB08SCBLN8L%2CB07V3Q34J6%2CB08Z32YFH5%2CB08R17FS5K%2CB07WFWKMX9%2CB07BTXVNZV%2CB07HBYP2WQ%2CB00D6NPL4S%2CB07N1JSXKF&srpt=LAMP
USB Data Cable - https://www.adafruit.com/product/592
Portable Phone Charger - https://www.amazon.com/Compact-Portable-10000mAh-Miady-Compatible/dp/B07SNBDTTD/ref=sr_1_1?crid=3VFLQRG0WVETW&keywords=portable+phone+charger&nav_sdd=aps&qid=1638339219&qsid=139-2581476-7818337&refinements=p_36%3A2491155011&rnid=2491154011&s=wireless&sprefix=portable+phone+charger&sr=1-1&sres=B07SNBDTTD%2CB083W5RDNN%2CB09B34QL9G%2CB06WWB2R5P%2CB07FVMP1JV%2CB073GGN4RX%2CB071FN8W3J%2CB07FK9M6N8%2CB07RQ9SXVX%2CB07M6RVNFY%2CB081BD33Z3%2CB06XV7W59N%2CB09KTZX8MP%2CB08Q6X1DYQ%2CB07T8N2B29%2CB01N2Y8WTJ%2CB00SZ8WDZE%2CB01I2JZQFO%2CB01JCIJBDC%2CB07TFSZT9G&srpt=POWER_BANK
3 AAA Batteries - https://www.amazon.com/Duracell-CopperTop-Batteries-all-purpose-household/dp/B006CSQXLO/ref=sr_1_5?_encoding=UTF8&c=ts&dchild=1&keywords=AAA+Batteries&qid=1633651779&s=hpc&sr=1-5&ts_id=389578011
Any speaker. I used this cheap one - https://www.amazon.com/Speaker-Portable-Hamburger-Amplifier-Laptop/dp/B07XDB4JVH/ref=sr_1_6?crid=28CFFI3T0SXVY&dchild=1&keywords=hamburger+mini+speaker&qid=1635361776&sprefix=hamburger+mini+speaker%2Caps%2C73&sr=8-6
Soldering Equipment - https://www.amazon.com/Soldering-Kit-Temperature-Desoldering-Electronics/dp/B07GTGGLXN/ref=asc_df_B07GTGGLXN/?tag=hyprod-20&linkCode=df0&hvadid=241999416883&hvpos=&hvnetw=g&hvrand=898369490138609689&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9002072&hvtargid=pla-590653449503&psc=1
3 Wires - https://www.amazon.com/Amazon-Basics-Female-Extension-Adapter/dp/B01CNAUYBY/ref=asc_df_B01CNAUYBY/?tag=hyprod-20&linkCode=df0&hvadid=167146065113&hvpos=&hvnetw=g&hvrand=1035409557114162040&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9002064&hvtargid=pla-282116616219&psc=1
Assistive Tech Button (3) - https://www.amazon.com/AbleNet-Big-Red-Twist-Switch/dp/B00CQASPEK/ref=asc_df_B00CQASPEK/?tag=hyprod-20&linkCode=df0&hvadid=193991302028&hvpos=&hvnetw=g&hvrand=14464467112350118460&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9002072&hvtargid=pla-334682974474&psc=1
Male-Female Jumper Wires - https://www.amazon.com/Elegoo-EL-CP-004-Multicolored-Breadboard-arduino/dp/B01EV70C78/ref=asc_df_B01EV70C78/?tag=hyprod-20&linkCode=df0&hvadid=222785939698&hvpos=&hvnetw=g&hvrand=3676358631814758184&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9002064&hvtargid=pla-362913641420&psc=1
Tape
Hot glue gun - https://www.amazon.com/Gorilla-8401509-Hot-Glue-Sticks/dp/B07K791YRP?th=1
Drill - https://www.amazon.com/BLACK-DECKER-BDCD8HDPK-Home-Project/dp/B079WGV6FB/ref=sxin_14_ac_d_mf_br?ac_md=1-0-QkxBQ0srREVDS0VS-ac_d_mf_br_br&cv_ct_cx=drill&keywords=drill&pd_rd_i=B079WGV6FB&pd_rd_r=fadf0495-85be-4d9c-b7a7-9bad0c9314f6&pd_rd_w=4vFRV&pd_rd_wg=G9sZk&pf_rd_p=17756b3a-4504-468b-830d-8b5875afd168&pf_rd_r=PW7F887XZZ5DJH7CG8HA&psc=1&qid=1638471428&sr=1-1-ed8a42d3-65f1-4884-a3a2-0dd6e83b6876
.386 Drill Bit - https://www.amazon.com/MAXTOOL-Letter-Jobber-Length-JBL02H10RWP2/dp/B085GKTXM1/ref=sr_1_4?keywords=.386+drill+bit&qid=1638471461&s=hi&sr=1-4
Setting Up Your Raspberry Pi
Setting up a raspberry pi is a complicated process. I recommend working alongside the following video playlist, videos 1-4. This will walk you through setting up your raspberry pi to connect to the internet, installing CircuitPython (the coding language I am using in this tutorial), and accessing your raspberry pi's files on your computer.
https://bit.ly/raspberry-pi-tutorials
Setting Up Your Audio
I downloaded audio versions of YouTube videos, one of "The Wellerman - Argules" and one of the theme song from "Spongebob Squarepants". The method I used is:
- Go to your chosen YouTube video
- in the url, change "youtube" to "yout"
- Download as a .WAV File
- Opened Audio files in iMovie
- Edited the files as desired (primarily shortening, changing noise levels, and restructuring)
- Exported the files as MP3 files, no video, because the Raspberry Pi seems to have trouble with playing large files.
- I put the files in a folder called "aquarium_sounds", and I recommend using the same name because you won't have to change any code later on
- Copy the aquarium_sounds folder over to your home folder on your pi
I've attached below the files I constructed for this project.
Setting Up Your CPB
Unfortunately, the Raspberry pi is not able to simultaneously play audio and manipulate LED lights without jumping through a lot of hoops. We will sidestep this by using a Circuit Playground Bluefruit to control the LED Strip while the Raspberry pi controls the audio. In order to set up your CPB, I recommend following this video:
https://www.youtube.com/watch?v=Wa1E8ze3v04&list=PL9VJ9OpT-IPSsQUWqQcNrVJqy4LhBjPX2&index=2
Coding Your Animation
This is a very straightforward piece of code - when a button or switch is pressed, the circuit is completed, and it plays an animation. You can modify the colors or how long the colors stay lit by following the comments in the code. Save the code onto the CPB as code.py.
Downloads
Coding Your Raspberry Pi Songs
This is the code which you want to load onto your raspberry pi. In order to do this, you will need to install the debouncer and pygame libraries onto your pi. I recommend watching the following videos for details on how to do so:
Pygame - https://www.youtube.com/watch?v=5F9cl4ZCqQ8&list=PL9VJ9OpT-IPT_ENLXcWqXw1oNruDCzLYL&index=7&t=662s
Debouncer - https://www.youtube.com/watch?v=zPo2CiKmx1I&list=PL9VJ9OpT-IPT_ENLXcWqXw1oNruDCzLYL&index=8&t=808s
After doing so, you will want to copy the attached code onto your raspberry pi. I have made comments in the code about how to modify it for different choices of folder and audio names. Essentially, when a switch/button is pressed, the pi starts playing one of the audio files.
Downloads
Configure Your Pi to Run Aquarium_test.py When Starting Up
Once you are connected to your raspberry pi according to the videos from step 1, enter the following line of code:
crontab -e
Then, if it gives you choices of 1,2, and 3 (which it will if this is your first time using crontab) select 1.
This will take you into nano. Use the down arrow to move all the way to the bottom, and add the following line of code:
@reboot python aquarium_test.py
Type control-X
Type Y
Press Return
Enter the following code:
sudo reboot
This will log you out of the pi and reboot the code. Now, the aquarium program should automatically run whenever the raspberry pi is turned on.
Beginning the Build
The aquarium which I had was no longer functioning - originally, it would rotate the image around and light up. Because these features were irreparably damaged, I took out all the wiring which was inside of the aquarium.
Drilling
My build has 3 controls (buttons/switches), so I drilled 3 holes in the side of the aquarium near the base, around 3 inches between each hole. I ended up using a .386 drill bit for the final holes. The holes need to be big enough to fit the ends of the wires into them, so that they can be connected to the raspberry pi and CPB inside the aquarium.
Connecting Wires to the CPB
We will be using one of the male to female audio wires on the CPB. First, cut off the male end with wire cutters. Then, strip about an inch of rubber. Put this end through one of the holes you made in the aquarium, and then continue so that the CPB will end up inside the aquarium. Separate the two wires inside, and loop one of them into the CPB capacitive touch pad labelled A3, and the other into the touch pad labelled GND next to it. I then locked these wires into the touch pad by putting bolts through the pads and tightening them on with nuts.
Connecting the LED Light Strip
I did not permanently connect the light strip, but you can easily do so using the same nut & bolt method used in the previous step. The light strip I've linked to comes with red, white, and black alligator clips. Attach the red clip the VOUT pad, the black clip to a different GND pad, and the white clip to the A1 pad. I then used hot glue to make sure that it wouldn't come undone.
Final CPB Steps
Now, using the AAA battery pack I've linked, you can set the CPB up to respond to a button press whenever you have the power turned on. Remember to flip the on switch if you want the CPB to work. Now, if you plug in a button such as the assistive tech button I listed above, when the button is pressed, the ~10 second animation will play. If you want to keep things simple and adjustable, just place the CPB at the bottom of the aquarium and coil the LED strip around the bottom. Connect the battery pack to the CPB, and when you turn it on you are good to go with the light animation. I placed it on the lid, as pictured.
A cheaper alternative to the button (you can use anything like it as long as it has a male connection jack), if you have access to a 3d printer, can be built with the following lab.
https://www.makersmakingchange.com/wp-content/uploads/2019/11/Light_Touch_Switch_Instructions.pdf
Connecting Wires to the Raspberry Pi.
For this step, you will need 4 male to female jumper wires of the sort I listed above. You will need to solder the male ends of the jumper wires onto the male ends of the extension cords. One jumper wire to the base, one jumper wire to the tip, as pictured. Do this twice, once for each of the extension cords. A more optimal method would be to snip off the male end of each extension cord and solder the wires inside directly to the male jumper wires, but this works.
Filling the Aquarium
Now that you have the pi set up, you're almost done! Plug your speaker into the audio jack, hook up the jumper wires so that the ones soldered to the base attach to gnd, and so that the ones soldered to the tip attach to D23 and D24 (interchangeable). Then, place the raspberry pi and speaker into the aquarium.
Final Product! The last thing you need to do is get everything turned on! Plug the portable battery pack into your Raspberry pi, turn on your speaker, and make sure that your CPB battery pack is on. Plug a few switches into the extension cords, and you're good to go! Here's a video of the complete product! I recommend using it in a dark setting if you want to see the full lighting effect!