The inspiration :I think about making a piano ,I like playing music on guitar & piano
The idea is about making different tones of a buzzer to simulate the tones of piano
The source of inspiration : https://www.pinterest.com/pin/4925880837075800/
Tinker cad icon
Arduino IDE
bread board
Buzzer
jumper wires
Pushbutton
Arduino UNO
Software
Tinker cad : to simulate the circuit before connecting it to avoid any errors in the circuit connection
Arduino IDE: makes it easy to write code and upload it to the board.
Materials
Arduino UNO: It can be programmed to control the electronics ,Like the buzzer tones
Buzzer: Out put sound
Pushbutton: control the state of the circuit (open or close) to make some action
small bread board & jumper wires :Wires the components together
Tones of buzzer VS music tones
Thinking
1-Start with brainstorming and detecting the code and components I need
I simulate the piano to be 5 pushbutton as a input , one buzzer that makes different sounds as a output
2-know about the tones of the piano on the buzzer
The tones of piano are (Do-re-me-fa-sol-la-si-do),but the tones of the buzzer are numbers
INPUT: 5 Pushbuttons (click )
OUTPUT: Buzzer (sound)
Tinker cad circuit
1-start to simulate the circuit on tinker cad to detect any errors
2-The connections are :
Arduino UNO : connect the Arduino GND with the -ve side one the breadboard (brown wire)
Buzzer :connect the -ve side with the ground (black wire ), connect the positive side with the pin number 9 ( blue wire )
Pushbuttons : connect one side of each one to the ground ( black wires ),connect the other sides with different pins on Arduino (2,3,4,5,6 pins)
Tinkercad code blocks
-I want each button play different tone on the buzzer ,so I will use the condition if ,and detect which pin with which tone
STEPS
1-Start with one pushbutton on pin 6
2-if the pushbutton is low (connect with ground ),the buzzer make some tone for 0.4 sec and stop ,else the buzzer is low (if.......else...)
3-The simulation doesn't work because it needs to add the text PULLUP to the code input ,so I copy the code to Arduino ide and edit the code
4-Duplicate this block 4 times and edit the pin numbers and tones as you want
the simulation :
first code block
code blocks on tinker CAD
Arduino IDE code
1-Copy the code from blocks+text on tinker cad
2-Edit the code on Arduino IDE and add PULLUP text after INPUT
3-Verify the code
4-Upload the code on the Arduino
circuit connection with the bread board
Connections
Start to connect the components together like in tinker cad simulation
start with one pushbutton and test it
Arduino UNO : connect the Arduino GND with the -ve side one the breadboard (Black wire)
Buzzer :connect the -ve side with the ground (purple wire), connect the positive side with the pin number 9 ( white wire)
Pushbuttons : connect one side of each one to the ground ( black wires ),connect the other sides with different pins on Arduino (2,3,4,5,6 pins)
Arduino.INO (buzzer piano) https://drive.google.com/drive/folders/1Yc8TQ4-_DjtsVriEKEdMN785F5hqmZ0n
Music 🎹
Edit the tones of the buzzer to be suitable to play some music
I choose easy music and play it
https://www.pinterest.com/pin/872572496548128777/
playyy🤩
music tones of the song
DO DO RE DO *3
DO SI DO RE
Buzzer tones for the music
49 49 50 49 *3
49 47 49 50
*This week we worked in teams in the offline session to make a wave hand
* I helped my team to connect the circuit and write a code without any errors
* They helped me in the electronic connections
The problem:
In the step of simulating on tinkercad , The simulation didnt work .All the connections and the code are right .
The reason :
-The pushbutton when it is up it doesn't connect with the ground and also doesn't connect with 5 volt ,so the state of the pushbutton isn't High or Low
The solution:
-Edit the code on Arduino IDE and add PULLUP after the INPUT , this means that when the pushbutton in up (doesn't connect with the ground ) it connected with 5 V
TINKER CAD
* In the process of designing the circuit of the smart planter and connecting the sensors together I will use tinker cad to simulate the circuit before connecting it to avoid any errors
* I will need the basic information about circuits connections and electrons to imagine the path of the electricity in the project circuit
ARDUINO IDE
*helps me in uploading codes on Arduino to control the electronics
Arduino IDE
Tinker cad icon
I can call this week the Master week ,I totally deal with new things like coding & arduino coding 🥳
بسم الله Team
wave hand 😏