Inspirational picture of the design
The main objective of the assignment was to dig deeper into electrical circuit design by adding smart sensors to be able to create & design smart devices.
I decided to create musical note based solely on the sense of the position of the object which can be called a smart sensitive piano that provides musical tones that vary based on the position of the object.
I- Electronic:
Software:
Tinkercad (to make sure the circuit if functional).
Arduino IDE (to load programming code to the arduino).
Material:
Arduino Uno.
7-segment display.
220-ohm resistor.
Ultrasonic sensor.
Buzzer.
Breadboard & crocodile wires.
Power adaptor, Rosetta & USB cable.
Softwares & materials used
I-Circuit
Step (1): I started creating the circuit by place & connect Arduino & breadboard together.
Step (2): Then I added Ultrasonic sensor to the bread board & linked it to the Arduino.
Step (3): After that I added 7 segment display with separate resistors for each pin & connected it to the Arduino.
Step (4): After that, I added Buzzer & connect its anode & cathode pins to the Arduino.
II-Code (Code Blocks)
Step (1): I started by creating variable X to store ultrasonic sensor distance which would affect buzzer tones & numbers that shown on the 7-segment display.
Step (2): For 7-segment display, I programmed the code to show tenths of a distance's number on it.
Step (3): For buzzer, I programmed the code to made it beeps with specific frequency for each range of distances to provide picked musical note which is (DO - RE - MI - FA - SOL - LA - SI - DO).
III-Simulation (Tinkercad)
Testing on Tinkercad
I-Circuit (Building Components)
Building the circuit was simple as all the components were already placed on the simulation.
II-Circuit (Testing Components)
Testing 6-Segment display and it worked perfectly.
Testing Buzzer tones with different reads.
III-Circuit (Full Circuit)
Time for testing & creating music tones.
The hard thing that I found during process was that I should link a resistor to each pin of the 7-Segment display instead of having just one at the common cathode, that made a problem as segments are so close to each other that gave a chance for the resistors to touches each other which cause error on displaying (left photo), that's why I connected them on the breadboard & directed each one on them on a different direction (right photo) to provide wrong signal which damage the reading results.
I guess learning to code the Arduino is such an interesting & flexible thing to use which would inspire me to try out more new things in my project.
Also, learning how to use sensors or tangible inputs by the user to reach an action depends on that by any of output elements is really an important thing that I had learned which would help me a lot through my project.
I can definitely say that the coolest thing I did this week was the waving hand exercise done in the end of the week session in the lab.
Automata is one of the most interesting stuffs that I've learned in my life, It's super cute thing to learn how it coule be done.