Week 6
Goal
Build and Program a smart circuit using an Arduino UNO which reads a signal from an input component (Sensor, Switch, or variable resistor) to control an action component (Motor, Buzzer, LED...etc) using Code Blocks
My Idea is to create a distance warning for people with hearing difficulties by warning them with light instead of alarm sound using ultrasonic sensor .
Tool Chain
I needed to use Tinkercad and Arduino IDE .
I needed to use TINKERCAD to simulate my electronical circuit and I also used the website to create my code . It was a technical requirement to use code blocks in TINKERCAD for this week and that's that I did .
I also used Arduino IDE to upload my code to my Arduino .
Design/Preparation Process
First : create circuit using TINKERCAD
I needed to use Arduino Uno ( brain)
Breadboard
Ultrasonic sensor ( input )
RGB LED ( output )
I started with searching for the right way to wire ultrasonic sensor to Arduino . ( You should wire the trigger to a signal output and the Echo to an Analog output )
Then I added The RGB LED to the circuit , wired the cathode to the ground and only wired the red an green RGBs' pins .
I used code blocks to create my code and started to simulate . I was surprised that the RGB LED turned the yellow color light instead of red or green. So, I added another output to my condition that when the distance is more then 50 cm then the green light is turned on and red light is off . Else , The Red light will be turned on and the green on is turned off . That was the trick that helped me to avoid color mixing in RGB LED .
I wanted to add some reality to my circuit so I add blinking to when the distance is less than 50 cm as a warning of danger .
Development/Implementation Process
Explain the development/implementation process of your assignment. How did you use the machine/tool to manufacture or implement the design of your assignment?
Overcoming Challenges
What kinds of challenges or problems did you face while doing the assignment, tutorials, or exercises? How did you solve them? Did you ask for help from an instructor or peer? Please provide a link to the tutorial or article that you used to solve your problem (if any)
I had a problem showing the right light colors depending on the condition I created .
I solved this problem by adding an output that makes the right color turned to HIGH and the other color turned to LOW .
Final Project
How can you use the skills and knowledge that you've acquired this week in your final project?
I was so excited for this week . I wanted to learn more about electronics and coding and I don't regret it at all .
Can't explain how happy I became when the components really worked without issues .
Here are the steps of bringing my circuit to life .
Trust the process ...
WOW!
What is the coolest thing that you've learned this week? What is something that you will never forget from this week?
I created the same wiring showed in TINKERCAD .
I wired the 5 V Arduino output to the positive row of the breadboard
The ground of Arduino to the negative row of the breadboard .
Ultrasonic sensor :
I wired the VCC to the positive row of the breadboard and the GND to the negative one .
wired Trigger to the digital pin 4
wired Echo to the analog pin 3
RGB LED :
I wired the common to the negative row
the red pin to the resistor then to pin 6
the green pin to 330 ohm resistor then to pin 5