Kids Piano Circuit – 8 Keys Version Using Arduino Uno (Tinkercad Project)

Kids Piano Circuit with 8 Keys – Arduino Tutorial | MakeMindz
Arduino Project · Kids Series

Kids Piano Circuit
with 8 Keys

Build a mini playable piano using an Arduino UNO and a piezo buzzer — perfect for school exhibitions and STEM classrooms.

🟢 Beginner Friendly ⏱ 30–45 min build 🎵 C4 to C5 octave 🔌 Arduino UNO
🎹 Try the Piano — Click or Press Keys 1–8
Click keys above · or press keyboard 1 2 3 4 5 6 7 8

1 Components Required

🧠
Arduino UNO
× 1
🔘
Push Buttons
× 8
📻
Piezo Buzzer
× 1
🔌
10kΩ Resistors
× 8 (pull-down)
🟫
Breadboard
× 1 (830-point)
🔁
Jumper Wires
Male-to-Male
Circuit diagram:

When a child presses any of the 8 buttons, the piezo buzzer plays a corresponding note (C4 to C5), making it a simple, interactive piano toy. It's a great way to introduce kids to electronics and music!

CODE:


Try this using tinkercad:


2 Circuit Diagram

Kids Piano Circuit — 8 Keys Arduino UNO + Piezo Buzzer + 8× Push Buttons Arduino UNO USB Digital Pins D2 D3 D4 D5 D6 D7 D8 D9 D10 ♪ GND 5V BREADBOARD + 5V — GND 1 10k 2 10k 3 10k 4 5 6 7 8 BUZZER D10 + LEGEND Button → Arduino pin Buzzer + → D10 GND connection C4·262Hz D4·294Hz E4·330Hz F4·349Hz G4·392Hz A4·440Hz B4·494Hz C5·523Hz

⚠️ Dashed lines represent wire connections. Avoid D0 & D1 — reserved for serial communication.

3 Step-by-Step Instructions

1
Set up the power rails on the breadboard
Connect Arduino's 5V pin to the breadboard's red (+) power rail and GND to the blue (−) rail using jumper wires.
💡 Use red wire for 5V and black wire for GND — a colour convention that prevents confusion.
2
Place all 8 push buttons on the breadboard
Space the buttons across the breadboard. Each button straddles the center gap of the breadboard so both sides are accessible independently.
3
Wire one leg of each button to 5V
Connect the left leg of each button to the red (+) power rail. This means pressing the button sends a HIGH signal to the Arduino.
4
Add pull-down resistors (10kΩ)
Connect a 10kΩ resistor from the right leg of each button to the GND rail. This ensures the pin reads LOW when the button is not pressed (prevents floating inputs).
⚠️ Without pull-down resistors, the input pins will "float" and give random readings.
5
Connect buttons to Arduino digital pins D2–D9
Wire the right leg of each button (same node as the resistor) to the corresponding Arduino pin: Button 1 → D2, Button 2 → D3, … Button 8 → D9.
6
Connect the piezo buzzer
Place the buzzer on the breadboard. Connect its positive leg (+) to Arduino pin D10. Connect its negative leg (−) to the GND rail.
7
Upload the code & test
Paste the Arduino code below into the IDE, select Arduino UNO as the board, and upload. Press each button — you should hear the corresponding note!
⚠️
Do not use digital pins D0 and D1 — these are reserved for serial (TX/RX) communication and will conflict with the USB connection used for programming.

4 Notes & Frequencies

Button Arduino Pin Note Frequency (Hz)
1D2C4262
2D3D4294
3D4E4330
4D5F4349
5D6G4392
6D7A4440
7D8B4494
8D9C5523

5 Arduino Code

kids_piano.ino
// Kids Piano — 8 Keys | MakeMindz.com

const int buzzer = 10;

int buttons[8] = {2, 3, 4, 5, 6, 7, 8, 9};
int notes[8]   = {262, 294, 330, 349, 392, 440, 494, 523};
// Notes:        C4    D4    E4    F4    G4    A4    B4    C5

void setup() {
  for (int i = 0; i < 8; i++) {
    pinMode(buttons[i], INPUT);
  }
  pinMode(buzzer, OUTPUT);
}

void loop() {
  // Check each button — play note if pressed
  for (int i = 0; i < 8; i++) {
    if (digitalRead(buttons[i]) == HIGH) {
      tone(buzzer, notes[i]);
    }
  }

  // Stop buzzer when no button is pressed
  if (
    digitalRead(2) == LOW &&
    digitalRead(3) == LOW &&
    digitalRead(4) == LOW &&
    digitalRead(5) == LOW &&
    digitalRead(6) == LOW &&
    digitalRead(7) == LOW &&
    digitalRead(8) == LOW &&
    digitalRead(9) == LOW
  ) {
    noTone(buzzer);
  }
}

7 Try the Simulation

🎮 Run it in Tinkercad

No hardware? No problem. Open the full simulation — press buttons to hear notes play in real time inside your browser.

▶ Open Tinkercad Sim

8 How It Works

👆
Button Pressed
Sends a HIGH signal to the Arduino digital pin via the 5V rail.
🧠
Arduino Reads Input
digitalRead() detects HIGH and looks up the matching frequency in the notes array.
〰️
Square Wave Generated
tone(buzzer, freq) generates a square wave at the correct Hz on pin D10.
🔊
Sound Plays
The piezo buzzer converts the electrical signal into audible musical notes.

9 Learning Outcomes

Digital input / output (I/O)
📋 Arrays in Arduino C++
🎵 Sound frequency basics
🔌 Pull-down resistor circuits
🔁 For-loop logic
🎹 Interactive electronics design

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