Bouncer Bot With Speaker System
by tripa93386 in Circuits > Arduino
892 Views, 7 Favorites, 0 Comments
Bouncer Bot With Speaker System

For Instructables’ 20th birthday, I have created a Bouncer Bot, who will stop unwanted guests, and say voicelines and play music to keep the party amazing!
Brief:
I have created a distance sensing circuit using an ultrasonic sensor, two LEDs, and a buzzer with an Arduino, with a bluetooth speaker.
The sensor will measure how long a sound pulse takes to return, and my code will calculate the distance using distance_cm = 0.017 * duration_us. If an object is closer than 50 cm, a red LED will turn on, and the buzzer will beep; otherwise, a green LED will illuminate. This demonstrates how code and sensors can collaborate to respond to the environment. On top of that, I will add a Bluetooth speaker system that you can connect to and play music, sounds and voice lines, to make the experience of a bouncer more immersive.
To sum up, if it detects an object 50 cm or closer, it changes its light and starts making a buzzing sound. On top of that it has a Bluetooth speaker system, which the party host can connect to and play voicelines that a bouncer would say, or set the mood for a party by playing some music.
Supplies






















Bouncer Bot (Tools and Materials):
2 LEDs
Buzzer
Jumper Wires (for Arduino)
22 Ohm Resistors (2)
Battery Case (fits 4 batteries)
4 Batteries
Plastic Tube
Wire Strippers
Red Marker
BT Speaker (Tools and Materials):
Filament (for 3D printer)
Autodesk Fusion (any CAD app)
Battery Case (fits 4 batteries)
4 Batteries
Screws x8
Wire Strippers
Screwdriver
Wire cutter
Black marker
FlashPrint 5
Coding and Setting Up Arduino










The first step of the project involves developing the Arduino code while constructing the electronic circuit.
The code was designed using computational thinking principles, including decomposition, pattern recognition, abstraction, and algorithms.
Decomposition was applied to separate tasks, including sensor setup, defining the distance threshold, and controlling the output of the LEDs and buzzer.
Pattern recognition was evident in the repeated use of input/output structures and conditional logic for different components.
Abstraction simplified the system by focusing only on the essential interactions—measuring distance and activating outputs—while omitting unnecessary details.
The algorithm provides step-by-step instructions for generating ultrasonic pulses, calculating the distance to the object, and determining whether to activate the LEDs and buzzer.
The code (Arduino IDE):
const int TRIG_PIN = 6; // Arduino pin connected to Ultrasonic Sensor's TRIG pin
const int ECHO_PIN = 7; // Arduino pin connected to Ultrasonic Sensor's ECHO pin
const int LED_PIN = 10; // Arduino pin connected to LED's pin
const int LED_PIN2 = 11;
const int SPEAKER = 12;
const int DISTANCE_THRESHOLD = 50; // centimeters
float duration_us , distance_cm;
void setup() {
pinMode(TRIG_PIN, OUTPUT);
pinMode(ECHO_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
pinMode(LED_PIN2, OUTPUT);
pinMode(SPEAKER, OUTPUT);
}
void loop() {
// generate 10-microsecond pulse to TRIG pin
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);
// measure duration of pulse from ECHO pin
duration_us = pulseIn(ECHO_PIN, HIGH);
// calculate the distance
distance_cm = 0.017 * duration_us;
if(distance_cm < DISTANCE_THRESHOLD) {
digitalWrite(LED_PIN, HIGH);
digitalWrite(SPEAKER, HIGH); // Turn on active buzzer
delay(30);
digitalWrite(SPEAKER, LOW); // Turn off active buzzer
} else {
digitalWrite(LED_PIN, LOW);
}
if(distance_cm > DISTANCE_THRESHOLD) {
digitalWrite(LED_PIN2, HIGH);
} else {
digitalWrite(LED_PIN2, LOW);
}
delay(500);
}
The circuit was then assembled to operationalise the code. An Arduino Nano serves as the microcontroller, connected to the ultrasonic sensor (HC-SR04), two LEDs, a buzzer, resistors, and a power switch. A 9V battery pack supplied power to the system. The schematic guided the placement of components on a breadboard, ensuring accurate connections between input and output devices. Individual components were tested before being integrated into the complete circuit. Check out the above photos, and look at the videos for the setup.
This concludes the setup, coding and construction of the Arduino and circuit.
Downloads
Building the Exterior for the Arduino-bot






For the second stage of the project, the focus was on constructing the exterior structure of the circuit and the microcontroller. This process began with designing the outer components digitally, ensuring precise dimensions and alignment to fit with the previously coded Arduino system, on xTools.
The exterior was made using a laser cutter. It was chosen because it possessed the ability to achieve high accuracy and clean cuts on materials such as acrylic and wood (I used 6mm MDF), in a very short amount of time (taking a maximum of 3 minutes to do all of the cutting).
For the switch, buzzer, and the 2 LEDs, I drilled holes, so the perfect size could be achieved first try. I ensured that all joints were secured firmly and that the openings for electronic components matched the design specifications.
To give the robot a feeling that it was alive, I attached a bendable plastic tube to cover the wires of the Ultrasonic sensor, making it look like a neck, giving it a similar look to Wall-E
I used hot glue for a secure hold and simple construction.
This concludes the Bouncer Part of the bot.
Setting Up the BT Speakers + Attaching





For the third stage of this project, I focused on adding working Bluetooth speakers, so I could connect from my phone (which can be connected to by any Bluetooth-compatible device), and play voicelines that a bouncer would say (check the 4th step for that video).
In this stage, I soldered the ends of the JST wires to their respective metal tabs (red to positive terminal and black to the negative terminal).
I repeated this for my second speaker.
I made sure to add enough solder to avoid soldering again.
After the wires are soldered into their respective terminals, I attached the crimp terminals of the JST wires into the audio module.
I then put 4 batteries in the battery case, and then I soldered a switch in between the red wire, which could let me control when I wanted to turn it on. After that, I plugged in the batteries into the module.
When turned on, it made 4 beeping sounds, and then any Bluetooth-compatible device was able to connect and play sounds.
I then designed a CAD file (using Fusion), a housing for the audio module and batteries, so it wouldn't be visible and give a cleaner look. Attached below is the STL file for it. I used Flashprint 5 to 3D print it, by connecting to the Adventurer 5M pro 3D printer.
I attached the battery case to the housing with hot glue and then secured the housing to the laser-cut bouncer bot exterior, while letting the switch and both speakers out of the holes on the sides of the exterior.
This lets me control the speaker system from outside.
I used yellow filament for the printout, but any could be used.
See the videos, photos and files to see the process in action.
This concludes the setup and connection of the Bluetooth speaker system.
The Speaker Casing and Final Touches



For the final stage, I just added a casing for the speaker, added a "suit", and distinguished the LEDs.
I designed a casing for the speakers on Fusion, so the speakers would sound better using a modified stereo setup, and would be secured to the housing of the bot.
When I 3D printed the casing, I screwed in the speakers, but let it have some room, so it doesn't stifle the vibrations.
After that, I attached the switch to the exterior, so it was easy to use and accessible, while not having wires flailing around.
Then, I 3D printed the "suit" so it gave off more of a bouncer vibe, and colored in the tie and the sides with a black marker, to give it a look of a black suit and tie with a red shirt.
I also colored in the LED, which signalled "Go Away," with a red marker, establishing that the LED represented what, and also wrote "Go Away" and "You're Okay" under the LEDs to further convey the meaning of the LEDs.
For the casing I used dark blue-green filament, and the suit was made from red filament, but any can be used.
This concludes the entire project, and I hope this is a worthy addition for the 20th Birthday!