Project tutorial
How to make Arduino Piano keyboard

How to make Arduino Piano keyboard

You can arduino piano keyboard with piano notes

  • 6,280 views
  • 2 comments
  • 10 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

  • 108,058 views
  • 77 comments
  • 231 respects

Arduino Tutorial : Mini Piano

Project tutorial by Rahul Khanna D

  • 43,047 views
  • 9 comments
  • 41 respects

Unravel Preset Piano Easy Arduino (Even a Ghoul Can Make It)

Project in progress by ExeCuteLi

  • 27,647 views
  • 27 comments
  • 50 respects

Arduino Keyboard

Project in progress by Gabriele Scordamaglia

  • 22,110 views
  • 18 comments
  • 26 respects

Keyboard Melodies

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

  • 9,419 views
  • 3 comments
  • 12 respects

ATBOY Minimal Retro Gaming Console

Project tutorial by Arnov Sharma

  • 2,786 views
  • 4 comments
  • 11 respects
Add projectSign up / Login