The Idea
This is kind of an "abandoned-project-components-recycling" project.
The idea came while building the sensor component for the "BLE Breathing Movement Monitor" project: While sealing and checking the sensor cushion under air pressure, it sometimes produced some funny and rather characteristic sounds.
So, when I stumbled upon the circuito.io's Arduino Day Prank Contest, I decided to re-use some of the projects components (sensors and code) for this fun project.
BasicsThe Arduino Razzberry Cushion Simulation (ARCS) device uses an inflatable cushion with a sealed-in barometric pressure sensor and a simple piezo buzzer connected to an Arduino Uno, to simulate the function of a classic razzberry (or whoopee) cushion.
SensorOriginally the sensor cushion was designed for the "BLE Breathing Movement Monitor" project as a sensitive breathing movement detector. It should detect breathing (and of course other) movements of a being lying on it by measuring the changes in air pressure within the cushion. Basically it is a BMP180 barometric pressure sensor glued and sealed into a simple cheap inflatable cushion: Make a thin cut with a sharp knife, put the wired sensor into the cushion and seal the cut with hot glue and/or UV adhesive curing.
The setup of this project with circuito.io is quit simple: Select the BMP180 as input and a piezo speaker as output connected to an Arduino UNO.
The result can be reviewed here: https://storage.circuito.io/index.html?solutionId=58f0e08213fd5300120f5912
The resulting BoM is quite lucid:
- The Arduino UNO
- the BMP180,
- a piezo speaker,
- a transistor,
- a resistor,
- a breadboard and
- some wires.
The resulting wiring is also very straightforward:
Following the instructions you will finally get something like this:
After downloading the generated firmware ...
... and uploading it to the board, the setup can be tested quite comfortably via a serial terminal connection:
The testing with the firmware generated by circuito.io showed, that the setup and the wiring was working. But the volume of the simple piezo speaker was so low, that it was almost inaudible.
After some experiments (replacing the transistor, the resistor, the wires, modifying the code etc.), I finally ended up in using a Grove Buzzer from the Grove Starter kit for Arduino&Genuino 101 as a replacement for the plain piezo speaker. Since using this component made the transistor and the resistor obsolete, I also dropped the breadboard and connected the BMP180 and the buzzer directly to the Arduino.
The final simplified setup looked like this:
After verifying this setup with the firmware generated by circuito.io , I implemented the ARCS program based on the generated code.
The implementation is very simple:
SETUP:
Initialize the BMP sensor (and serial for debugging).
LOOP:
- Read the pressure value from the BMP sensor.
- Compare the value to the previous reading.
- If the difference between the previous reading and the current reading exceeds a given threshold, play the whoopee melody on the speaker.
void setup() {
bmp180.begin();
}
void loop() {
double bmp180Pressure = bmp180.getPressure();
double bmp180PressureChange = bmp180Pressure - previousBmp180Pressure;
previousBmp180Pressure = bmp180Pressure;
if ( bmp180PressureChange >= PRESSURE_CHANGE_THRESHOLD ) {
piezoSpeaker.playMelody(piezoSpeakerWhoopeeLength, piezoSpeakerWhoopeeMelody, piezoSpeakerWhoopeeNoteDurations);
}
}
The complete code (ARCS.ino) can be found in the according section of this project, the additional files generated by circuito.io can be downloaded from the circuito.io-solution-page.
I left the testing of the device to my enthusiastic assistants ...
Disclaimer: No animals were harmed during the making of this project.
Due to lack of time, this is only a very simple project. The ultimate Advanved ARCS (AARCS)?
- A more sophisticated sound sample and audio output.
- Prank-owner identification (perhaps via RFID or NFC): "If I sit on this pillow nothing happens, so it has been definitely YOU!"
- ...
Comments