Diy dancing flower garden

DIY Dancing Flower Garden 🌷🤖 Arduino Multi-Servo Robotics Project for Kids
🌷 ROBOTICS FOR KIDS · LEVEL: BEGINNER

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!

⏱️ 2–3 hours 🎂 Ages 8+ (with an adult) 🌼 5 Dancing Flowers

💃 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!

x1

Arduino Uno

The brain that keeps all five flowers moving in sync.

x5

SG90 Micro Servo Motors

One per flower, swaying each stem side to side.

x1

Sound Sensor Module (KY-038)

Detects claps or music to trigger the dance.

x1

Push Button

Manually starts a dance wave anytime.

x1

Small Buzzer (optional)

Plays a fun beep when the dance starts.

x1

Breadboard

For connecting everything without soldering.

x5

Craft Flowers on Sticks

Glued to each servo horn as the "stem."

x1

Wooden Board or Planter Box

Holds all five servos upright like a flower bed.

x1

4x AA Battery Pack

Powers all five servos once unplugged from USB.

~15

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.

Arduino Uno UNO Pin 3 — Flower 1 Pin 5 — Flower 2 Pin 6 — Flower 3 Pin 9 — Flower 4 Pin 10 — Flower 5 A0 — Sound Sensor Pin 2 — Push Button Pin 8 — Buzzer 5V GND Servo 1 — Flower 1 Servo 2 — Flower 2 Servo 3 — Flower 3 Servo 4 — Flower 4 Servo 5 — Flower 5 Sound Sensor Button + Buzzer
Flower servos → pins 3, 5, 6, 9, 10 Sound sensor → analog pin A0 Button → pin 2 · Buzzer → pin 8
🛠️

Step-by-Step Build Instructions

Ask an adult to help with cutting and gluing the craft flowers. Let's plant Posey's garden!

1

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.

2

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!
3

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.

4

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.

5

Wire everything to the Arduino

Connect all five servos, the sound sensor, the button, and the buzzer exactly as shown in the circuit diagram.

6

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.

dancing_flower_garden.ino
// 🌷🤖 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.

🎉 Lovely work — you just built a real dancing robot garden! Clap your hands and watch Posey's flowers sway into a wave.

⬆️ Back to Materials List

Comments

Product Cards
Buddy Bot eBook
⭐ New 2026 Release
Build Your
Own Robot!
3D design, wiring &
Arduino coding.
Young inventors love it!
🖨️
3D Print
All parts
Wire it
Circuit guide
💻
Code it
Arduino IDE
🤖
Watch it
Walk & react
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Website Offer
₹499 300
🌍 International: $5 USD
One-time · Instant digital delivery
🔒 Secured by Razorpay · Your data is safe
📄 Download Free Sample Copy
🔒 Secured by Razorpay · Your data is safe
🍓
Raspberry Pi Pico Mastery
21 Projects
⚡ Launch Price — 80% OFF
Learn Pico
Build 21 Projects!
MicroPython · Wokwi
IoT · Certificate
Perfect for beginners!
🖥️
Wokwi
No hardware
🐍
MicroPy
From zero
🔨
21 Projects
IoT + sensors
📄
Certificate
Verified cert
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Launch Offer
₹999 200 80% OFF
🌍 International: $5 USD
One-time · Lifetime access · No subscription
🔒 Secured by Razorpay · UPI · Cards · NetBanking
🎉

You're in!

Payment successful! Your Buddy Bot eBook is ready. Time to build!

📖 Access Your eBook Now
🎉

Enrolled!

Payment successful! Lifetime access to all 21 Pico Projects is yours!

🍓 Go to My Course