Introduction
In this beginner-friendly project, we will build a Kids Piano Circuit with 8 Keys using an Arduino Uno and simulate it in Tinkercad.
Each push button acts as a piano key. When pressed, it plays a musical note through a piezo buzzer. This is a perfect school project to introduce children to:
-
Basic electronics
-
Digital input using push buttons
-
Sound generation using a buzzer
-
Music and frequency concepts
Components Required
-
Arduino UNO
-
8 × Push Buttons
-
8 × 10kΩ Resistors (pull-down)
-
Piezo Buzzer
-
Breadboard
-
Jumper wires
Circuit Connections
Buttons
-
Connect one side of each button to 5V
-
Connect the other side to Arduino digital pins:
-
Button 1 → D2
-
Button 2 → D3
-
Button 3 → D4
-
Button 4 → D5
-
Button 5 → D6
-
Button 6 → D7
-
Button 7 → D8
-
Button 8 → D9
-
-
Add 10kΩ resistor from each button pin to GND (pull-down)
Buzzer
-
Positive → D10
-
Negative → GND
⚠ Avoid using D0 and D1 because they are used for serial communication.
Notes and Correct Frequencies
| Button | Arduino Pin | Note | Frequency (Hz) |
|---|---|---|---|
| 1 | D2 | C4 | 262 |
| 2 | D3 | D4 | 294 |
| 3 | D4 | E4 | 330 |
| 4 | D5 | F4 | 349 |
| 5 | D6 | G4 | 392 |
| 6 | D7 | A4 | 440 |
| 7 | D8 | B4 | 494 |
| 8 | D9 | C5 | 523 |
(These are standard piano note frequencies.)
Arduino Code
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};
void setup() {
for(int i=0; i<8; i++){
pinMode(buttons[i], INPUT);
}
pinMode(buzzer, OUTPUT);
}
void loop() {
for(int i=0; i<8; i++){
if(digitalRead(buttons[i]) == HIGH){
tone(buzzer, notes[i]);
}
}
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);
}
}
How It Works
-
Each push button sends a HIGH signal when pressed.
-
The Arduino reads the button input.
-
The
tone()function generates a square wave at a specific frequency. -
The buzzer converts this electrical signal into sound.
When children press different buttons, they hear different musical notes — just like a mini piano 🎹
Learning Outcomes
This project helps students understand:
-
Digital input/output
-
Arrays in Arduino
-
Sound frequency basics
-
Interactive electronics design
Applications
-
DIY kids piano toy
-
STEM classroom activity
-
School exhibition project
-
Beginner Arduino music project
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:
BEGINNER PROJECTS (Foundation Skills)
- Ultrasonic Distance Measurement
- Traffic Light Simulation with 7-Segment Display
- 7-Segment Display Counter
- Kids Piano Circuit (8-Key Version)
- 16×2 LCD Display with Text Output
- LCD I2C to Arduino UNO
- Temperature Measurement using Arduino UNO
- LDR Controlled Street Light
INTERMEDIATE PROJECTS (Build Your Skills)
- Servo Motor Control Using Potentiometer
- DC Motor Speed Control
- Temperature Controlled Fan
- PIR Based Theft Alert System
- LPG Gas Leakage Detection System
- Automatic Door Locking System
- Soil Moisture Based Automatic Watering System
- Simple Digital Clock using Arduino UNO
- Automatic Voting Machine (EVM)
- Joystick Control using Arduino Uno
- RGB Lamp Control using Arduino Uno
ADVANCED PROJECTS (Master Level)
- Home Automation Using Arduino UNO
- Bluetooth RC Car using Arduino Uno
- Obstacle Avoiding Robot
- Line Follower Robot
- Radar System Using Arduino UNO
- Automatic Parking System
- Bi-Directional People Counter using Arduino Uno
- Automatic Plant Watering System
- NeoPixel LED Ring Control using Arduino Uno
- Smart Gloves for Bedridden People

Comments
Post a Comment