• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Circuit Ideas for You

Get free circuit ideas online.

  • Home
  • Privacy Policy
  • About
Home » Arduino Piano Music Keyboard with Memory Circuit

Arduino Piano Music Keyboard with Memory Circuit

Last updated on 23 June 2026 by Admin-Lavi Leave a Comment

This project is for Arduino Piano Music Keyboard with Memory Circuit and its main parts are Arduino Uno, push buttons, buzzer, LCD and resistors.

When button is press then buzzer make piano sound, LCD show note name on screen and then we can record notes and play again later.

Furthermore, it is small and fun project and is good for learning Arduino, electronics and music.

Arduino Code:

#include <LiquidCrystal.h>
#include <Tone.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int buzzer = 10;
int keys[8] = {A0, A1, A2, A3, A4, A5, 6, 7};
int notes[8] = {262, 294, 330, 349, 392, 440, 494, 523};
int recordData[100];
int recordTime[100];
int index = 0;
bool recording = false;
unsigned long lastTime;

void setup() {
lcd.begin(16,2);
lcd.print("Arduino Piano");
for(int i=0;i<8;i++){
pinMode(keys[i],INPUT);
}
pinMode(buzzer,OUTPUT);
delay(1000);
lcd.clear();
}

void loop() {
for(int i=0;i<8;i++){
if(digitalRead(keys[i])==HIGH){
tone(buzzer,notes[i],300);
lcd.setCursor(0,0);
lcd.print("Note: ");
lcd.print(notes[i]);
if(recording){
recordData[index] = notes[i];
recordTime[index] = millis()-lastTime;
lastTime = millis();
index++;
}
delay(300);
}
}
if(digitalRead(8)==HIGH){
recording = true;
index = 0;
lastTime = millis();
lcd.clear();
lcd.print("Recording...");
delay(500);
}
if(digitalRead(9)==HIGH){
lcd.clear();
lcd.print("Playing...");
for(int j=0;j<index;j++){
delay(recordTime[j]);
tone(buzzer,recordData[j],300);
}
recording = false;
delay(500);
}
}

Code Explanation:

  • First LCD library used for display.
  • Buzzer pin defined.
  • Notes frequency array used for 8 notes.
  • Push buttons connected to analog and digital pins.
  • In loop Arduino check button press.
  • If pressed then it plays tone and display frequency on LCD.
  • If recording is true, the Arduino saves the note and its time difference in an array.
  • One button start recording and another button start replay.
  • During replay, Arduino read notes and play them back with same delay.

Circuit Working:

Arduino Piano Music Keyboard with Memory Circuit Diagram

Parts List:

ComponentsValuesQuantity
Resistors (All resistors are 1/4 watt unless specified)10k3
560Ω1
1.5k1
2.6k1
3.9k1
5.6k1
6.8k1
8.2k1
Preset 10k1
SemiconductorsArduino UNO Board1
LCD Display 16×21
Piezo Buzzer1
Tactile Switches S1 to S8 piano keys8
Record Tactile Switch1
Replay Tactile Switch1

Arduino Uno is brain of this project.

The circuit uses a total of 10 tactile switches, eight switches function as piano keys, while two additional switches are located near the buzzer and LCD.

One for Record and one for replay; when button is press then Arduino check which one and each button send signal to Arduino.

Arduino play tone on buzzer for that button and then LCD also show note name and then VR1 preset use for LCD contrast adjust.

After that, power come from Arduino 5V and GND to breadboard rails and resistors used as pull down for buttons.

When record mode is ON, the Arduino saves the notes along with their time intervals and when the user presses the replay button, the Arduino reads the saved notes and plays them again with the same timing.

Formulas:

Frequency of tone given by formula:

f = 1/T

where,

  • f is the frequency
  • T is time period for (1/f)

Arduino tone function use square wave.

How to Build:

To build a Arduino Piano Music Keyboard with Memory Circuit follow the below steps for connections:

  • First, collect all parts same like circuit diagram.

Push button connections:

  • Next, 8 tactile switches go to Arduino digital pins 2,3,4,5,6,7,8,9 through resistors.
  • Then record switch one side go to Arduino pin 8 and other side go to GND.
  • After that, put 10k resistor pull-down between pin 8 and GND.
  • Now replay switch one side go to Arduino pin 9 and other side go to GND.
  • Also, put 10k resistor pull-down between pin 9 and GND.

Buzzer connections:

  • Buzzer positive leg (+) connect to Arduino pin 10 and buzzer negative leg (–) connect to GND.

LCD connections:

  • 16×2 LCD connect in 4-bit mode: RS to pin 12, E to pin 11, D4 to pin 5, D5 to pin 4, D6 to pin 3, D7 to pin 2.

Preset connections:

  • VR1 middle pin go to LCD pin V0 (pin 3), then one side of VR1 go to +5V and other side of VR1 go to GND.

Conclusion:

To conclude, this Arduino Piano Music Keyboard with Memory Circuit is simple project, it is small and fun to make.

Also, project show how to use buttons, buzzer, LCD and memory in Arduino; furthermore, we can add more notes in future and we can use better buzzer or speaker.

Moreover, we can use SD card for saving songs, it is a good project for learning embedded system and this circuit is also nice DIY music toy for beginners.

Filed Under: Arduino Projects, Audio Circuits

About Admin-Lavi

Lavi is a B.Tech electronics engineer with a passion for designing new electronic circuits. Do you have questions regarding the circuit diagrams presented on this blog? Feel free to comment and solve your queries with quick replies

Previous Post: « Sound Sensor Circuit using IC LM393
Next Post: Arduino with Non Contact Liquid Sensor Circuit »

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar




Categories

  • 555 Timer Projects (122)
  • Alarm Circuits (75)
  • Amplifier Circuits (92)
  • Arduino Projects (103)
  • Audio Circuits (189)
  • Automation Circuits (103)
  • Automobile Circuits (38)
  • Battery Charger Circuits (86)
  • DIY Projects (365)
  • Free Energy (12)
  • Heater and Temperature Controllers (32)
  • High Voltage (23)
  • Hobby Circuits (194)
  • Indicator Circuits (62)
  • Inverter Circuits (19)
  • IoT projects (8)
  • LDR Circuits (45)
  • LED and Lamps (195)
  • Meters and Testers (43)
  • Mini Projects (279)
  • Motor Controllers (25)
  • Oscillator Circuits (63)
  • Power Supply Circuits (221)
  • Radio Frequency (7)
  • Remote Control Circuits (11)
  • Renewable energy (6)
  • Security and Protection (105)
  • Sensors and Detectors (223)
  • Solar Circuits (31)
  • Timer Circuits (62)
  • Transistor Circuits (175)
  • Transmitter Circuit (20)
  • Tutorials (23)
  • Voltage Regulator (38)
  • Water Level Controller (10)

Recent Posts

  • Low Current Controlled Battery Charger Circuit using LM723 IC
  • 741 Op-Amp Treble Booster Circuit
  • Simple Diode and Transistor Based Audio Limiter Circuit
  • Simple 500mW Speaker Driver Circuit
  • Easy DIY LM386 Audio Amplifier Circuit

Recent Comments

  1. Tony Gallegos on NTC Thermistor Based Temperature to Voltage Converter Circuit
  2. colin on Simple Single Transistor Audio Amplifier Circuit
  3. How to Make a Bird Chirping Noise Easily on Chirping Bird Sound Generator Circuit
  4. Transistor Based Medium Impedance Preamplifier Circuit - Circuit Ideas for You on Low Impedance Input Transistor Preamplifier Circuit
  5. Admin-Lavi on Alternate Red Green LED Flasher Circuit

Copyright © 2026 | New Circuit Ideas