6th Week - Journal
6th Week - Journal
Since we are so close to the final project, I thought of testing a part of my device function which is sensing the water level using an ultrasonic sensor. So when the tank is empty, the sensor will detect it and the buzzer will turn on making a noise.
This one is used to upload Arduino code to Arduino.
I used it to write Arduino code (blocks), and build the circuit.
(4 female-male & 3 male-male)
Using input and output components is a must in this assignment. The input component I used is the ultrasonic sensor while the output component is the buzzer.
1- The -ve terminal of the buzzer is connected to -ve side of the breadboard using a male-male jumper wire, while the +ve terminal is connected to digital pin 2.
2- The GND pin of the ultrasonic is connected to -ve terminal of the breadboard by using a female-male jumper wire, then a male-male wire is connected from -ve column of the breadboard to GND of Arduino. While the power pin is connected to 5v on Arduino using a female-male jumper wire.
3- The trigger pin of ultrasonic is connected to pin 5 while echo is connected to 6 pin by using two female-male jumper wires.
First Step: Build the Circuit.
I started by building the circuit as I designed in Tinkercad but instead of attaching directly the ultrasonic sensor in the breadboard, I used female-male jumper wires to make them more flexible to move around.
Then, I fixed the ultrasonic sensor on the wooden stick using tape.
I tried the circuit and it worked.
I started to build the code using tinkercad blocks.
First, you have to enter the input which is the ultrasonic sensor then identify the trigger and echo pins.
You have to decide the distance at which the buzzer will turn on (high). This step can be done by measuring the water container (tank) length or depth -In my case, it was 15cm-. The sensor will detect water surface level. So if you want the buzzer to turn on when the container is filled up to 3cm of the container length then you have to subtract the total depth of the container from the water level at which you want the buzzer to make noises -which in my case was 3cm- since the ultrasonic will be placed at the top of the container and this will be the distance you will enter in the code.
I wanted the buzzer to give an alert when the container is empty so I put if condition. If the ultrasonic sensed a distance greater than 12cm, the buzzer will turn on.
Second Step: Write the code.
Third Step: Copy the text code to Arduino.
After copy & paste the code from tinkercad to Arduino, you an verify your code.
After connecting the Arduino to your PC, check from the tools bar that you're connected to your Arduino. Then you can safely upload the code.
Fourth Step: Connect Arduino & Upload the code.
There was no time to take any feedback. I took the instructor's idea of using an ultrasonic sensor as a water level sensor for my graduation project.
I got help from my little sister in taking the previous videos :)
I made a lot of thoughts in fixing the ultrasonic above the container. I finally decided to go with the wooden stick as it appears in the video and I fixed the sensor on the stick using adhesive tape.
The code didn't work at first because I put a wrong distance but after looking at this project I got the idea and switch the distance to the one appears at the code.
This absolutely made huge progress in my graduation project. I'm kinda relieved that this part of my project is done so if there were any problem in the future, I can easily know where it is and fixed so hope for the best :)
When I was in mid-school, we learned how to use scratch programming to make small projects. So using tinkercad in writing the code blocks was pretty awesome, interesting, and easy for me. I truly enjoyed this week :)