Sound Recreater (my First Instructable)
by aswathmurari123 in Circuits > Arduino
45 Views, 2 Favorites, 0 Comments
Sound Recreater (my First Instructable)
This project combines a passive buzzer and a servo motor to make a dancing cardboard character that moves in sync with music.
The buzzer plays simple tunes like nursery rhymes, while the servo makes your character “dance” to each note.
It’s a fun beginner-friendly Arduino project — perfect for kids, STEM fairs, or just for fun at home!
Supplies
Arduino Uno 1
The main controller 1(any arduino preferably uno r3)
Passive Buzzer 1
Servo Motor (SG90) 1(Moves the dancing character)
Breadboard 1
For easy wiring
Jumper Wires
Few
Male-to-male or male-to-female as needed
Cardboard Cutout
1
Your dancing character
USB Cable
1
To connect Arduino to computer
Gathering Parts
1. Gather parts
- Arduino (Uno/Nano/Mega)
- SG90 (or similar) micro-servo
- Passive buzzer (not active)
- Breadboard (optional)
- Jumper wires (male-male)
- Small cardboard figure and tape/glue to mount on servo horn
- USB cable to connect Arduino to PC
- (Optional) External 5V supply if servo draws too much current
Character Making
Cut a small cardboard figure or draw on cardboard (similar to your photo).
Glue or tape the figure to the servo horn (the plastic piece that screws onto the servo). Center the figure so it balances — heavier on one side causes odd motion. Use a small amount of tape so the horn still fits on the servo shaft.
Configuration
3. Wiring (exact pins used in the code)
Use the pins you tested earlier: Buzzer → pin 8, Servo signal → pin 9.
- Servo
- Brown or Black wire → GND (Arduino GND)
- Red wire → 5V (Arduino 5V)
- Orange/Yellow wire → Pin 9 (Arduino digital PWM pin)
- If using external 5V supply: connect servo +5V to the external 5V, connect servo GND to Arduino GND (common ground), and servo signal to pin 9.
- Passive Buzzer
- Buzzer + (long leg) → Pin 8
- Buzzer - (short leg) → GND
- USB
- Connect Arduino to PC with USB cable for power + programming.
Uploading
- Open Arduino IDE on your PC.
- Select correct board and COM port: Tools → Board → Arduino Uno (or your board), Tools → Port → COMx.
- Install nothing extra is required for servo/tone — Servo.h is included by default.
Trial Phase
Upload a test sketch (confirming everything still works)
- Copy this short test sketch into Arduino IDE and upload:
- Open Serial Monitor at 9600 baud to watch status messages while it runs.
Trouble Shooting
Tune servo movement (if motion too harsh)
- If servo moves too fast or strains: reduce travel range. In code, replace myServo.write(45); and myServo.write(135); with gentler angles (for example myServo.write(60); and myServo.write(120);).
- Increase delay slightly between notes to reduce speed: change delay(beat); to delay(beat + 50);
More Songs
To start you out this is a simple rhythm for all.
:
#include <Servo.h>
Servo myServo;
int buzzer = 8;
int servoPin = 9;
void setup() {
myServo.attach(servoPin);
pinMode(buzzer, OUTPUT);
}
void loop() {
// Simple beat pattern
tone(buzzer, 440, 300);
myServo.write(45);
delay(300);
tone(buzzer, 523, 300);
myServo.write(135);
delay(300);
noTone(buzzer);
myServo.write(90);
delay(500);
}
these are more complex songs which might need troubleshooting😅😅😅😅
Twinkle twinkle little star
#include <Servo.h>
Servo myServo;
int buzzer = 8;
int servoPin = 9;
int melody[] = {262, 262, 392, 392, 440, 440, 392,
349, 349, 330, 330, 294, 294, 262};
int noteDurations[] = {4,4,4,4,4,4,2,
4,4,4,4,4,4,2};
void setup() {
myServo.attach(servoPin);
}
void loop() {
for (int i = 0; i < 14; i++) {
int duration = 1000 / noteDurations[i];
tone(buzzer, melody[i], duration);
// Servo dance with notes
if (i % 2 == 0) myServo.write(45);
else myServo.write(135);
delay(duration * 1.3);
noTone(buzzer);
}
myServo.write(90);
delay(2000);
}
mary had a little lamb:
#include <Servo.h>
Servo myServo;
int buzzer = 8;
int servoPin = 9;
int melody[] = {330, 294, 262, 294, 330, 330, 330,
294, 294, 294, 330, 392, 392};
int noteDurations[] = {4,4,4,4,4,4,2,
4,4,4,4,4,2};
void setup() {
myServo.attach(servoPin);
}
void loop() {
for (int i = 0; i < 13; i++) {
int duration = 1000 / noteDurations[i];
tone(buzzer, melody[i], duration);
if (i % 2 == 0) myServo.write(45);
else myServo.write(135);
delay(duration * 1.3);
noTone(buzzer);
}
myServo.write(90);
delay(2000);
}
The End
I hope you can do the project well and improve it by adding lights and voice mimicking but until then
ps: I hope to win this contest and this is my first post btw!!