The assignment's idea for this week was about building and programming a smart circuit using an arduino UNO which reads a signal from an input component (ultrasonic-sensor) to control an action component (Buzzer) using code blocks.
at first i searched on Arduino project hub to find ideas but they didn't work with me (i started with difficult ideas ) ,so i decided to make a very simple model of my final project idea.
my final project is about making a third eye for blind that make sound from the buzzer when they get closer to any project.
https://create.arduino.cc/projecthub/muhammedazhar/third-eye-for-the-blind-8c246d
software: Tinkercad to create circuits and simulate it and to use code blocks to build my code in it.
components: arduino uno, jumpers, buzzer, ultrasonic-sensor.
searching for the datasheet of the Ultrasonic sensor which consists of four pins;
1-Vcc; The Vcc pin powers the sensor, typically with +5V
2-Trigger pin is an Input pin. This pin has to be kept high for 10us to initialize measurement by sending US wave.
3-Echo pin is an Output pin. This pin goes high for a period of time which will be equal to the time taken for the US wave to return back to the sensor.
4-Ground;This pin is connected to the Ground of the system.
Then connecting it to the arduino uno by the breadboard and wires;
-connecting the VCC to the positive ground which is connected to the power (5v) from the arduino uno.
-connecting TRIG to D3 of the arduino uno.
-connecting ECHO to D2 of the atduino uno.
-connecting the GND to the negative ground which is connected to the GND from the arduino uno.
searching for the datasheet of the buzzer which consists of two pins;
1-Positive;
Identified by (+) symbol or longer terminal lead. Can be powered by 6V DC
2-Negative;
Identified by short terminal lead. Typically connected to the ground of the circuit
Then connecting it to the arduino uno by the breadboard and wires;
-connecting the negative pin to the negative ground which is connected to the GND from the arduino uno.
-connecting the positive pin to D6 of the arduino uno.
using code blocks primarily to build my code on tinkercad.
-the ultrasonic-sensor is controlled through the input blocks(the purple block).
-comparing the distance through math blocks(green blocks).
-if objects get closer on distance equal or more than 25 cm, then the buzzer will make sound using trigger pin 3 and echo pin 2 to detect the distance as input and to send an output signal to the buzzer .
-if it was more tnan 25 cm in distance the buzzer won't make sound.
-the buzzer is controlled through the output blocks(blue blocks).
the Text
coping the code from tinkercad into arduino app so i can be able to connect it to the arduino uno through the cable.
connecting arduino uno to the laptop
then i made the same connection on the circuit
yes, i asked my friends for a feedback about the idea and they like it
i faced problems when i upload the code, i always had mistakes in my arduino code so my instructor advised me to arrange my ideas first as i should think before coding, it helped me in decreasing the mistakes.
i also faced a problem in making the servo motor with the potentiometer in the exercise of the end of week session ,at first, the way of thinking was to assign a rotation angle for every increase in the resistance of the potentiometer. Actually that wasn't the best way to do the coding as i would then get 180 if condition .
i chose very cool ideas from arduino hub to make at first but i didn't know how to make the blocks of them.
i will be able to use the arduino uno for my final project.