The purpose of this activty is to introduce participants to applications of Arduino to output such as sound. It also introduces a higher level of difficulty than the previous acitivities in Arduino.
For each participant:
In general:
This activity uses capacitive sensing, specifically capcitive touch sensing. It is used to sense human touch through a material, which allows the sensor to be visibly concealed. The lead in a #2 pencil is conductive and allows the sensor to sense electrical signals.
One of the many outputs of Arduino is sound. By using a speaker, we can get the Arduino to output sound based on the input it receives. A speaker works by converting electrical signal into sound waves. Sound waves are just vibrations in the air pressure. The pitch is caused by the speed in the vibrations. Higher pitches (higher sounding notes) are caused by faster vibrations of sound waves.
A one-octave piano has 8 white keys, with 5 black keys which are the half-steps. We will only be using the 8 white keys to produce sound in this activity. Our piano is based off of the image below:
The keys are labeled with note names, which correspond to their pitch.
Good video resource to see the end product
A schematic design that should make the directions easier to follow
As students go through these steps, make sure they are thinking about the importance of the placement of the objects. Can they use their knowledge of breadboards to explain why certain wires are being placed in certain spots? Can they use their knowledge of Arduino to explain why it matters which wire goes in which Arduino pin? Can they use their knowledge of circuits to explain how they are creating a closed circuit using the Arduino and breadboard? Etc.
Have participants draw the piano on their piece of paper, based on the image above. Make sure to color in the keys completey and to press heavily with the pencil to ensure there is enough lead for the keys to be conductive.
Place the paper clips on the piano, one on each key
Place the resistors on the breadboard, following the schematic above
Connect one end of the wires to one side of the resistor, and connect the other side to the correct pin of the Arduino following the image above. (Make sure the correct wires are going to the correct Arduino pin or else the Arduino code won't work and the piano will not make sound)
Connect one end of the wires to the piano by placing the metal portion under the paper clip. Connect the other end of the wires to their respective spot on the breadboard
Unlike on the schematic, attach the speakers to the Arduino as shown below:
The circuit should now be complete.
Here is the code:
You can either type it exactly or copy paste it. Anything followed by a "//" is a comment and thus it doesn't have to be exact, and you don't have to include it if you don't want.
The piano should work now and participants can play it!
Identity Questions:
Lesson Questions:
This activity was taken from the project linked below: