Project tutorial
How to make Arduino Piano keyboard

How to make Arduino Piano keyboard

You can arduino piano keyboard with piano notes

  • 750 views
  • 2 comments
  • 4 respects

Components and supplies

Apps and online services

About this project

Here I have used Arduino to make Arduino piano with the piano notes. Arduino hobbyist who aspires to make Arduino project, Can make their own Arduino piano with the piano notes. Here I have used tone function to set different frequency of piano in Arduino sketch so well you can play the eleven different notes of piano through this Arduino piano. but it does not give original piano's feel, You can feel the version that how would it match with Arduino keyboard.

Components

1.Bread board

2.Arduino Uno

3.1w Speaker

4.Jumper cable

5.push buttons


Thanks UTSOURCE.net to offer electronic components for my projects

Code

Here I have used tone Library to get different frequency through a speaker.as well as to get different frequency through a speaker.as well as to get the piano's frequency in the input pins as I used before, I have used real piano notes to get the frequency, for input that values into my different push button pins

for more projects visit here

Video


Code

codeC/C++
//fore more projects visit www.blackkeyhole.com

#define T_C 1047
#define T_CD 1109
#define T_D 1175
#define T_DE 1245
#define T_E 1319
#define T_F 1397
#define T_FG 1480 
#define T_G 1568
#define T_GA 1661
#define T_A 1760
#define T_B 1976

const int C = 10;
const int CD = 12;
const int D = 9;
const int DE = 13;
const int E = 8;
const int F = 7;
const int FG = 3;
const int G = 6;
const int GA = 2;
const int A = 5;
const int B = 4;

const int Buzz = 11;


void setup()
{
  
  pinMode(C, INPUT);
  digitalWrite(C,HIGH);

  pinMode(CD, INPUT);
  digitalWrite(CD,HIGH);
  
  pinMode(D, INPUT);
  digitalWrite(D,HIGH);

  pinMode(DE, INPUT);
  digitalWrite(DE,HIGH);
  
  pinMode(E, INPUT);
  digitalWrite(E,HIGH);
  
  pinMode(F, INPUT);
  digitalWrite(F,HIGH);

  pinMode(FG, INPUT);
  digitalWrite(FG,HIGH);
  
  pinMode(G, INPUT);
  digitalWrite(G,HIGH);

  pinMode(GA, INPUT);
  digitalWrite(GA,HIGH);
  
  pinMode(A, INPUT);
  digitalWrite(A,HIGH);
  
  pinMode(B, INPUT);
  digitalWrite(B,HIGH);

   
}

void loop()
{
  while(digitalRead(C) == LOW)
  {
    tone(Buzz,T_C);
    
  }

  while(digitalRead(CD) == LOW)
  {
    tone(Buzz,T_CD);
    
  }

  while(digitalRead(D) == LOW)
  {
    tone(Buzz,T_D);
    
  }

  while(digitalRead(DE) == LOW)
  {
    tone(Buzz,T_DE);
    
  }

  while(digitalRead(E) == LOW)
  {
    tone(Buzz,T_E);
    
  }

  while(digitalRead(F) == LOW)
  {
    tone(Buzz,T_F);
    
  }

  while(digitalRead(FG) == LOW)
  {
    tone(Buzz,T_FG);
    
  }

  while(digitalRead(G) == LOW)
  {
    tone(Buzz,T_G);
    
  }

  while(digitalRead(GA) == LOW)
  {
    tone(Buzz,T_GA);
    
  }

  while(digitalRead(A) == LOW)
  {
    tone(Buzz,T_A);
    
  }

  while(digitalRead(B) == LOW)
  {
    tone(Buzz,T_B);
    
  }

  noTone(Buzz);
  

}

Schematics

Circuit
Untitled sketch bb xtzeuuzjoe

Comments

Similar projects you might like

Electronic Piano Keyboard With Preset Songs

Project tutorial by Lindsay Fox

  • 96,091 views
  • 71 comments
  • 199 respects

Arduino Tutorial : Mini Piano

Project tutorial by the lonely programmer

  • 26,403 views
  • 7 comments
  • 37 respects

Arduino + LEDs + MIDI Keyboard + MuseScore = Piano Tutor

Project tutorial by tcucinotta

  • 15,072 views
  • 4 comments
  • 23 respects

Keyboard Melodies

Project tutorial by Ava Baker -21 and Natalie Clark -20

  • 5,122 views
  • 2 comments
  • 12 respects

Tamaguino Update with Huge OLED

Project tutorial by Alojz Jakob

  • 2,981 views
  • 1 comment
  • 7 respects

Arduino Game By LCD

Project tutorial by Mohammed Magdy

  • 71,482 views
  • 73 comments
  • 221 respects
Add projectSign up / Login