Build a Robotic Flower Garden That Dances Together!
Meet Posey — a garden of five servo-powered flowers that gently sway in the breeze, then burst into a synchronized dance wave whenever they hear a clap, music, or a button press!
💃 Say hi to Posey, your dancing flower garden!
What Is a Dancing Flower Garden Robot, Anyway?
Instead of one flower opening its petals, this project plants a whole garden of five flowers, each one mounted on its own servo motor. Most of the time they sway gently like they're in a breeze. But clap your hands, play some music, or press a button, and Posey's flowers burst into a fun synchronized dance — swaying one after another in a wave!
This project is a great way to learn how several motors can move both independently (gentle random swaying) and together (a coordinated dance wave), controlled by the same Arduino.
What You'll Need
Gather these parts before you start planting your robotic garden!
Arduino Uno
The brain that keeps all five flowers moving in sync.
SG90 Micro Servo Motors
One per flower, swaying each stem side to side.
Sound Sensor Module (KY-038)
Detects claps or music to trigger the dance.
Push Button
Manually starts a dance wave anytime.
Small Buzzer (optional)
Plays a fun beep when the dance starts.
Breadboard
For connecting everything without soldering.
Craft Flowers on Sticks
Glued to each servo horn as the "stem."
Wooden Board or Planter Box
Holds all five servos upright like a flower bed.
4x AA Battery Pack
Powers all five servos once unplugged from USB.
Jumper Wires
Male-to-male and male-to-female.
The Circuit Diagram
Five servos, a sound sensor, a button, and an optional buzzer — all connect to one Arduino Uno.
Step-by-Step Build Instructions
Ask an adult to help with cutting and gluing the craft flowers. Let's plant Posey's garden!
Mount the five servos in a row
Fix all five servos upright along a wooden board or inside a small planter box, spaced apart so each flower has room to sway freely.
Attach a flower to each servo
Glue a craft flower on a stick to each servo horn so that turning the servo makes the whole "stem" sway left and right.
💡 Tip: Use different colored flowers on each stem — it makes the dance wave much easier (and prettier) to see!Add the sound sensor
Mount the sound sensor module somewhere central in the garden, facing outward so it can pick up claps or nearby music.
Add the manual button and buzzer
Place the push button where it's easy to reach, and mount the buzzer nearby to play a little beep whenever the dance starts.
Wire everything to the Arduino
Connect all five servos, the sound sensor, the button, and the buzzer exactly as shown in the circuit diagram.
Upload the code and test
Upload the code below, switch to battery power, and clap your hands — watch Posey's garden burst into a wave of dancing flowers!
The Arduino Code
Copy this code into the Arduino IDE, then click Upload. The flowers idle-sway gently until a clap or button press starts the dance wave.
// 🌷🤖 Posey the Dancing Flower Garden — Arduino Multi-Servo Project // Five flowers idle-sway gently, then dance in a wave when triggered #include <Servo.h> Servo flowers[5]; const int servoPins[5] = {3, 5, 6, 9, 10}; const int restAngle = 90; // stem standing straight const int swayAmount = 25; // how far each flower leans during the dance const int soundPin = A0; const int soundThreshold = 600; // tune this after testing your sensor const int buttonPin = 2; const int buzzerPin = 8; void setup() { for (int i = 0; i < 5; i++) { flowers[i].attach(servoPins[i]); flowers[i].write(restAngle); } pinMode(buttonPin, INPUT_PULLUP); pinMode(buzzerPin, OUTPUT); } void loop() { int soundLevel = analogRead(soundPin); bool buttonPressed = (digitalRead(buttonPin) == LOW); if (soundLevel > soundThreshold || buttonPressed) { tone(buzzerPin, 1200, 150); danceWave(); } else { idleSway(); } } // Each flower sways out and back, one after another, creating a wave void danceWave() { for (int i = 0; i < 5; i++) { flowers[i].write(restAngle + swayAmount); delay(150); flowers[i].write(restAngle - swayAmount); delay(150); flowers[i].write(restAngle); } } // Gently sways all flowers using a smooth sine-wave motion void idleSway() { unsigned long t = millis(); for (int i = 0; i < 5; i++) { float angle = restAngle + 8 * sin((t / 600.0) + i); flowers[i].write((int)angle); } delay(30); }
How Does Posey Actually Work?
Here are the big robotics ideas hiding inside this project:
Sound Sensing
The sound sensor's analog output rises with loud noises like claps. Comparing it to a threshold number is all it takes for Posey to "hear" you.
Wave Motion with a Loop
The danceWave() function moves through the flowers[] array one at a time with a small delay between each — that timing gap is exactly what creates the wave look.
Smooth Motion with Sine Waves
The idle sway uses the sin() math function to create a smooth, natural back-and-forth motion instead of a robotic snap — and offsetting each flower by its index i keeps them out of sync, like a real breeze.
Two Behaviors, One Robot
Posey constantly chooses between two modes — calm idle swaying or an energetic dance wave — based on a simple if/else check every loop.
🧑🔬 Safety First!
- Build with an adult, especially when using scissors or a glue gun for the craft flowers.
- Don't hold a flower stem still by hand while its servo is powered on.
- Keep small craft pieces away from little siblings and pets.
- Unplug the battery pack when you're finished enjoying the garden.
Frequently Asked Questions
Can I add more or fewer flowers?
Yes! Just add or remove pin numbers in the servoPins array and change the 5 in each loop to match how many flowers you have.
My sound sensor triggers too easily (or not at all) — what do I do?
Adjust the soundThreshold number — raise it if the garden dances at every little noise, or lower it if claps aren't being detected.
How do I make the dance wave faster or slower?
Change the delay(150) values inside danceWave() — smaller numbers make the wave ripple through the garden faster.
What age group is this project good for?
This project is great for curious kids around age 8 and up, working with a parent, teacher, or older sibling on the wiring and flower assembly.

Comments
Post a Comment