The Babble BLASTER
Do you have a friend who just won't stop talking? Or maybe a co-worker who loves the sound of their own voice a little too much? Enter the Babble Blaster, your new best friend for keeping chatterboxes in check!
Powered by an Arduino, the Babble Blaster is a playful, tongue-in-cheek solution to excessive blabbering. This delightful gadget is designed to detect when someone is talking too much (for more than five seconds or so), swiftly orient itself to face the talkative culprit, and then deliver a sassy, pre-recorded message to let them know they've been caught in the act. But that's not all – it follows up with a refreshing (or maybe just surprising!) spritz of water to really drive the point home.
Perfect for adding some light-hearted fun to your office or home, the Babble Blaster is a great project for anyone interested in Arduino, robotics, or just looking for a way to spice up their social interactions. In this tutorial, we'll guide you through the steps to create your very own Babble Blaster, from assembling the hardware to programming the Arduino. Get ready to turn the tables on those talkative types with a splash of humor!
This project was conducted by Nadine Aderhold, Jonas Mertens, and Stefan Lang as a part of the Computational Design and Digital Fabrication seminar in the ITECH master program.
Supplies
Robot Body
The body of our robot is composed of 3 main elements:
- a lower reservoir for water
- a component frame
- and a cover shell (with googly eyes!)
We printed all of these components on a desktop 3D printer, and have included the files below for reference. The fitting of the cover shell was a bit tight, so we would recommend sizing all the components up slightly.
Plastic Components for the Robot Body:
- 4x 3D printed robot shell components
- 1m PVC hose (5mm diameter)
- 1x nozzle (can be 3D printed, or use a precision glue applicator tip)
- 2x googly eyes
Note: We tested out a few different nozzle types for the strength of the water blast and its watertightness: while tapered precision glue applications created an incredibly strong stream, the plastic part cracked and we eventually replaced it with a 3d printed nozzle.
Electronics
If you are new to electronics, we recommend that you get an Arduino Starter Kit, that will contain many of the components needed for this project.
- 1x Arduino Uno R3
- 1x external battery pack
- 4x 1.5V AA batteries
- Lots of jumper wires (female-to-male, male-to-male)
- 1x 28BYJ-48 5V stepper motor
- 1x ULN2003 stepper motor driver board
- 2x KY-037 sound sensor modules
- 1x speaker module
- 1x spi reader SD card shield module
- 1x mini sd card
- 1x mini 12v air pump
- 1x mosfet module
Additional Tools and Equipment:
- 3D printer
- wire cutters
- precision screwdrivers
- glue
- a soldering iron is not mandatory but very practical to have at hand!
- assortment of M2 screws
Programming the Arduino
We recommend breaking down the task of programming the arduino into three actions that can be tested independently. The logic behind the Babble Blaster consists of:
- detecting sound and orienting the robot to face it;
- broadcasting a pre-recorded message;
- and activating the air pump to spray water through the nozzle
Sound Detection and Orientation
This section involves the stepper motor, stepper motor driver, and the sound sensors.
For the sound detection two sound sensors with digital and analog output are used. Connect the sound sensors as follows:
D0: Connect to Arduino digital pins 4 (right sensor) and 7 (left sensor)
+: Connect to 5V power supply of Arduino
GND: Connect to ground of Arduino
A0: Connect to A0 (right sensor) and A2 (left sensor) of Arduino
The analog output of the sensor is not used in our current implementation, but feel free to explore it's possibilities for sound detection. IMPORTANT: The sound sensors have to be calibrated by adjusting the screw on the sensor until the green LED turns off or flickers and the analog value is a about 500. This can be done by printing the analog value of the sensor connected to the Arduino pins A0 and A2 to the serial port.
To aim towards the detected sound source the system features a simple stepper motor and the respective driver board. The driver and motor can be easily connected by use of the socket on the driver board. Furthermore, connect the motor driver as follows:
IN1: Connect to digital pin 8 on Arduino
IN2: Connect to digital pin 9 on Arduino
IN3: Connect to digital pin 10 on Arduino
IN4: Connect to digital pin 11 on Arduino
Please also download the <CheapStepper.h> library.
Playing a Pre-Recorded Message:
This section involves the spi reader, mini sd card, and the speaker.
All of our information is based on this project: https://steemit.com/utopian-io/@kimp0gi/playing-music-in-arduino-using-sd-card-module
You will have to convert the recordings you want to play into a WAV format. The correct bit resolution is important, as it has to be 8 bit, sampling rate of 16000Hz, and a mono audio chanel.
For testing purposes, we suggest trying out this part without the other elements (water blaset, sound detection) first. Connect the speaker to GND and digital pin 9.
Connect your SPI Reader as follows:
CS: Connect to the Arduino digital pin 4.
SCK: Connect to the Arduino digital pin 13.
MOSI: Connect to the Arduino digital pin 11.
MISO: Connect to the Arduino digital pin 12.
VCC: Connect to 5V pin of Arduino.
GND: Connect to GND.
The wiring in the actual Babble BLASTER can be different than this trial set-up!
Please also download the <SimpleSDAudio.h> and <pitches.h>library.
Activating the Water Blaster:
Connect your MOS module to the Arduino, battery pack, and air pump.
SIG: Connect to the Arduino output pin.
GND: Connect to the Arduino ground (GND).
V+: Connect to the positive terminal of the air pump.
V-: Connect to the negative terminal of the air pump.
VIN: Connect to the positive terminal of the battery.
GND: Connect to the negative terminal of the battery.
Please also download the <HCMotor.h> library. You will now be able to control the 12V air pump using your Arduino through the MOS module, enabling you to turn the pump on and off as needed for your project.
Using two pieces of PVC pipe, you can connect the air pump to a water source and a nozzle to create a water spraying device. We tested this part independently by putting our water sprayer onto a spray bottle-- but always be careful where and how you are testing when using water and electricity!!!
Understanding the Code
Sound Detection and Orientation
Download the <CheapStepper.h> library.
To detect the relative location of the soundsource, the delay between the two sensors for a sound signal is measured. Since the speed of sound and the distance between the two sensors is known the angle at which the sound hits the imaginary connection line between the two sensors can be calculated with the following formula:
rad = asin((time*0.000001*343.00)/(DISTANCE))
To reduce inaccuracies caused by the code execution time of the arduino commands, direct pin manipulation is used instead of digitalRead() commands. This has the benefit of manipulating multiple pins simultaneously.
After calculating the direction of sound the angle in radians is mapped to steps of the stepper motor. Subsequently the stepper motor can be moved by the amount of steps that equals the angle at which the sound source is located. If no sound is located the stepper motor is moved randomly. This helps to also detect sound signals that might be in the opposite direction of the current sensor orientation.
Playing a Pre-Recorded Message:
Download the <SimpleSDAudio.h> and <pitches.h>library.
In the code, after the water is shot, the shoot() function plays a sound from an SD card. The sound file (music.wav) is initialized and prepared for playback in the setup() function using the SimpleSDAudio library. When the SdPlay.play() command is called, the audio file is played, and the code waits until the playback is finished before proceeding.
Activating the Water Blaster: shoot()
Download the <HCMotor.h> library.
This part of the code is fairly simple. When sound is detected and the robot has oriented itself, the motor in the air pump is turned on for a few seconds, and then shuts off.
Assembling the Robo-guts
The Babble Blaster consists of three main parts
- a component frame, which helps to place and organize the internal electronic components
- a lower reservoir for water, which helps to separate the water from the electronic components, and is designed to allow an internal hose to rotate around the entire circumference of the robot;
- and a cover shell (with googly eyes!), which brings the cute robot to life!
The most important part is assembling the Arduino components onto the component frame. This needs some time and calm hands. All boards and sensors can be screwed with M2 screws directly into the small holes in the 3D print. No nuts are needed. There is a slot for the battery pack, so it can be easily taken out to replace the batteries. Moreover make sure to attach the speaker from the side of the Arduino. Otherwise the cover won't fit. Also make sure to either attach all cables to the Arduino board before placing the water pump in front of it. Lastly check that the rubber hoses fit tightly onto the pins of the water pump. You don't want any leaks!
The Final Assembly
After numerous rounds of testing and prototyping, we can finally assemble the full robot!
- Assemble the Water Reservoir:
Snap the lid of the reservoir onto the fitting column of the water reservoir base. Ensure there is a ~5mm gap between the outer ridge of the reservoir base and the lid to allow for a hose to slot through and rotate around the base.
- Attach the Air Pump:
Attach two pieces of PVC pipe to the end of the air pump.
Fit one end of the supply hose through the hole of the component frame, and down into the water reservoir.
- Place the Outer Shell:
Gently place the outer shell around the robot, taking care not to disconnect any wires!
- Fit the Nozzle:
Fit the other end of the PVC pipe through the nozzle hole in the robot shell and attach the nozzle.
Note: We originally wanted the water to spray out of the robot mouth but ran out of space due to the complex internal wiring, and were worried about water leakage. We decided to drill a 5mm hole in the robot shell above its eyes so that the nozzle attached from the outside of the shell, like a unicorn horn.
Your Babble Blaster is now ready to go! Enjoy watching it in action as it humorously interrupts those who talk too much.