Introduction: DIY Piano Using Scratch and Evive (Arduino Mega Based Prototyping Platform)
Music, one of the best gifts to mankind! Kids, teens, adults, everybody enjoys it. Won't you love to see your kid playing a Piano, that too made by himself? :)
We built a simple 8 key piano for kids using a very user-friendly learning and prototyping platform called evive. It has been programmed using mblock which is derived from scratch as a programmer. Just go through the following steps and make this cute looking piano yourself.
Enjoy the music :)
Step 1: Installing the Scratch on Your PC
To start with, you need to install the mblock software on your PC which can be download for free it from its official website-
You can extract the zip file using winrar which you can get from here.
Extract these files to your workspace, and run the setup. You can watch the video for more instructions.
Step 2: Components You'll Need
We don't think you'll anything more than the following for this:
- pushbuttons (8)
- resistors (8)
- breadboard wires
Step 3: Making the Circuit
Do you have all your components in place? Cool! We're good to go now.
To begin with, let us introduce you to a breadboard. Look for the red highlights on the provided image of the breadboard. That indicates the shorting pattern, the middle section has vertical shorting, each of the 5 pins/holes in a column are internally connected. The upper and lower sections have horizontal shorting, each half of the rows is internally connected. Now,
- Place the push-buttons between middle sections of the breadboard as shown
- Connect one of the pins on a side of the switch with 5V, you can do so by connecting them to one of the upper/lower rows and the row to 5V
- Connect the other pin on the same side to ground via a high value resistor
- You now have to take input from the push-button which you can do by joining the other side of the switch to evive's digital pins (we did it with pins 2-9)
- Ensure you've done this for all 8 push-buttons
Step 4: Tones!
We have 8 basic tones- Sa, Re, Ga, Ma, Pa, Dha, Ni, San in Hindi (first seven are equivalent to Do Re Mi Fa So La Ti in western music). We have used these in our piano. Actually all possibles notes can be derived by these 8 notes. You can read more about this from here .
What we are writing is called 'sargam' in Hindi. Corresponding piano keywords and the frequencies, are sent from Arduino to the buzzer, both of which are present inside evive.
Step 5: Building the Project in Mblock
Cool! Our circuit is ready now! And all we need is to start our project on mblock.
Open Scratch (download it from here if you haven't done it yet), you will see the default scratch interface. Following simple steps will guide you through:
- Go to edit and select 'Arduino mode'
- Go to board and select 'Arduino mega 2560' (the heart of evive)
- Start the project by selecting 'robot' script
- Choose the 'Arduino program' tag and release it in middle
- Our code for the project will work in infinite loop, so go to 'control' script, select 'forever' and attach it to 'Arduino program' tag
- Now you have to select 8 'if then' tags and place it inside the 'forever' tag
- Our code will check whether the digital pins (2, 3, 4, 5, 6, 7, 8, 9) are high, if they are then the code should play corresponding tone for 1/4th of the second
- For this go to 'Robot' script again and select 'digital read pin' and place it in the 'if then' condition part
- Then pick the 'play tone' tag and place it in 'then' part of the 'if then' tag
- Repeat above steps for each of the 8 switches
Seems a little tough? Don't worry, watch the video :)
Step 6: Uploading the Code to Evive and Watching It Work
Once you have finished making the project, all you need to do is upload your project to evive.
Connect evive to your PC using an A to B USB cable. Then go to connect, then Serial port in mblock and you will see the COM#. This is the port your evive is connected to. Save your project by clicking on the 'upload to arduino' button on the right side.
Great! You made it! You're just one step behind making your friends jealous of you :D
Step 7: But What Is Evive?
evive is an open-source electronic prototyping platform for makers like you. Its made for all age groups to serve a wide range of applications. Besides helping hobbyists and students in building their projects and experimental setups, it can be used by beginners to develop their making skills and by advanced users like researchers, professionals and educators to analyze and debug their projects.
evive is available on Indiegogo, you can find it here.
Participated in the
Participated in the
Summer Fun Contest 2016
Participated in the
DIY Summer Camp Challenge