How to Build a Fun Raspberry Pi Whoo-Pi Cushion in Six Simple Steps

How to Build a Fun Raspberry Pi Whoo-Pi Cushion in Six Simple Steps

Here at Vilros, we love combining the old with the new – especially when it turns into something totally fun! This is why we love this project that uses Raspberry Pi to design a whoopee cushion (a whoo-pi cushion?).

For our readers who may be too young to know, this timeless toy gag balloon device can be used to make a sound reminiscent of flatulence. Apparently, the first whoopee cushions go back to days on the farm when they were made with pig bladders. However, because playing with animal innards is now generally frowned upon, we’re going to replace the old-school way with an updated high-tech approach in which the device you create using Raspberry Pi allows you to play with a bunch of different crazy sounds.

Here’s how to make your Raspberry Pi Whoo-Pi Cushion in 6 steps:

1. Gather Your Supplies

A) Odds and Ends: You will need two paper plates, paper clips, a pair of scissors, cardboard, copper tape, sticky tape, sponges, glue, and aluminum foil.


B) Software: Nothing else is required beyond what is pre-installed in Raspbian as well as a properly up-to-date SD Card.


C) Hardware: All you need is two crocodile clip cables, two male-to-female jumper leads, and a speaker system.

2. Make Your Cushion

A) Using the scissors and cardboard, cut two circles to fit the deep part of the plates.

B) With your sticky tape, attach foil to the cardboard to make an electrical circuit. Make sure the foil strips are long enough to reach the plate’s lip.

C) Fasten the foil to the edge of the plate with your copper tape to maintain conductivity in your complete circuit.

D) Fashion the sponge into cubes and glue them so they surround the foil on one of the plates. This will keep the foil strips away from each other, so your Whoo-Pi Cushion will be silent until someone sits on the plate. If you would like a visual, check out this page.

E) Position the pair of plates so that the foil strips face each other, but make sure that they don’t make contact.

F) Tape the plates together or use paper clips to ensure the Whoo-Pi Cushion functions properly.

3. Link Raspberry Pi with Your Whoo-Pi Cushion

A) Plug one jumper cable into a GND (ground) pin on your Raspberry Pi and the other into GPIO pin 2.
B) Using both of your crocodile clip cables, link the copper tape strips to the male pin of the wires. Repeat this step with the other lead. Check this for images.

4. Use Python to Enable Sound

A) Using the sound jack port on your Raspberry Pi, link it to the speakers.

B) Make a file folder called “whoopi” in Python using the command “mkdir whoopi” and enter it with the code “cd whoopi.”

C) Download funny body sounds with the code “wget” followed by a link to the site where the audio is found and test it using “aplay” followed by the name of the file. Note: Files MUST be .wav to be usable.

D) Use the command “amixer cset numid=3 1” at the terminal window to switch audio to the headphone jack.

E) Can you hear it now? …Good! If not, click here for sound samples and further detailed instructions.

whoopee cushion to the Pi

5. Use Python to Write Your Program

A) From the Programming menu, open Python 3 (IDLE) and make a blank file by clicking File then New Window.

B) Call your new file “whoopi.py” by clicking File and Save As.

C) Use the stretch of code below with a line break at each slash to make use of all libraries in building your program. “import os/import random/from time import sleep/from gpiozero import button”

D) Tell the program that the Button is on pin 2 using the code: button = Button(2).

E) Place single quotes around each sound effect file and commas separating them from each subsequent one on a list flanked by brackets like so: listname = [‘fart 1.wav’, ‘fart 2.wav’, ‘fart 3.wav’]

F) To create an effect when the button is pushed, start by using the “while True:” command to make a loop.

G) Indent four spaces and “button.wait_for_press ()” to make each loop respond accordingly to the press of the button.

H) If you choose to make a group of sounds possible in your list, use the “random.choice” action to pick one from the previous list at random by storing it in another line of code with a name you can select like so: variablename = random.choice(listname).\

I) Play the chosen sound with the “aplay” function as follows: os.system(“aplay {0}”.format(variablename)).

J) Lastly, put a pause in the program before restarting the loop using “sleep(2)”.

K) Click File and Save.

L) Use Run and Run Module coupled with a press of the button to check if the code works. Ensure there are no typographical errors if you press the Whoo-Pi Cushion and don’t hear a random noise from the files you added to your list. The code in its ultimate form should look like this here at Step 11.

6. You’re Ready to Use Your New Whoo-Pi Cushion!

Make sure the delicate mechanism isn’t squashed or seen before use. (This can be tricky because of the requirement for a plug socket or power battery pack – so plan carefully). Now, just run the program! For more fun, try recording your voice or any silly sound you like.

Keep calm and prank on with a little help from Raspberry Pi and your friends at Vilros. And for more fun project ideas, don’t forget to come back and check out updates to our blog.


GET IN TOUCH

MAKE:INSPIRE TEAM

x