While searching in Instructables for ideas to use the 7-segment display, as I was fascinated by it in the mid-week session.
I found this project, and I thought I could use the ultrasonic sensor to sense if someone is close, the 7-segment displays my mobile number.
Software
I used Tinker CAD to design the circuit and to create the code blocks.
I used Arduino IDE to upload the text code on Arduino UNO board
Electronic components
Arduino UNO board
Is going to be connected to the inputs and the outputs and power them. It is also going to run the code on the components.
Ultrasonic sensor
Is going to be our input, when it senses a person or an object, the output component is going to work.
7-Segment display
Is going to be the output component.
Breadboard
To fix the components in and connects them together.
Jumper wires
Connecting the components.
220-ohm Resistor
Adjusts the current passing through the LED of the 7-segment display.
I started with connecting the different LEDs of the 7-segment display to the pins of the Arduino from 2 to 9 and the common of the 7-segment to a 220 ohm resistor then to the GND of the Arduino.
The Echo pin and the Trig pin of the ultrasonic sensor are connected to pins 9 and 10 of the Arduino. The VCC is connected to the 5V and the Gnd of the sensor is connected to the GND of the Arduino.
Seven Segment Display
In this picture of 7 segment display, we can see which pin controls which LED so we can turn different LEDs on and off to display the numbers
Each pin of the 7-segment display is connected to a pin in Arduino, we are going to relate them to make it easier to do the code blocks
PIN A = PIN 4
PIN B = PIN 5
PIN C = PIN 7
PIN D = PIN 8
PIN E = PIN 9
PIN G = PIN 2
PIN F = PIN 3
PIN DP = PIN 6
Code Blocks
Using Code Blocks in TinkerCAD
From Control I chose " if - then - else ".
From Math I chose " analog read smaller than analog read".
From Input I chose " read ultrasonic distance " in the first previous analog read.
I chose the pins of the sensor and the distance "10 cm" in the second analog read.
Start making digital blocks to set different pins to high and low to show different numbers as shown in the images.
Wait one second.
Turn all digital pins off.
Repeat until the mobile number is done.
Else turn all digital pins off.
Circuit simulation on TinkerCAD
Using TinkerCAD, I started the simulation to test the Code Blocks.
Circuit with actual components
Using the actual components, I connected all the parts according to my TinkerCAD simulation.
Using Arduino IDE to past the text code that we copied from TinkerCAD and Uploaded it on the Arduino board.
Actual Circuit
Final product, when the sensor sense anything within 10 cm range, the 7-segment display starts viewing my mobile number.
First Challenge
After finishing the circuit on TinkerCAD, I started replicating it with actual components, I realized that it is much more complicated with this amount of resistors.
I tried using one resistor with the common pin attached to the GND of Arduino and it worked and with less components and less complications .
Second Challenge
Using the digital Code Blocks, I started with
The number 0
Wait 1 sec
The number 1
Wait 1 sec
The number 0
Wait 1 sec
The number 0
Wait 1 sec
I realized I have to turn off all the LEDs in between numbers to see repeated numbers
Code Blocks before edits
This week I have learned about Arduino and a lot of input and output components. I have now clearer vision of how can we make the touch sensitive table, and why we can not use a lot of sensor I thought would work. Hopefully, soon I can figure out the best sensor for the application.
The dish party was a nice way to get to know my colleagues in my group and other groups.
It was a fun day with lots of delicious food, fun games, and very good company.
If you were wondering what I learned from this day, I learned a lot about my colleagues and it enriched my knowledge of them. I saw different sides of them other than the academic side.
The positive influence was really obvious the next day in the end-of-week session.
Title of Media