Potentiometer scale using 7 segment
The Assignment of this week was to build a smart circuit using Arduino Uno.
My idea was to build a potentiometer scale using a 7 segment, I got the idea from here:
Potentiometer scale using a 7 segment display
TinkerCad to simulate the hardware circuit and code before wiring the hardware.
7-Segment for displaying the numbers from 0 to 9
Arduino IDE for verifying the code and uploading it to the circuit.
7 220 ohm resistors
Bread Board for connecting the hardware components
Jumper wires for connections
Arduino Uno Board + its cable to upload the code onto it
Circuit in Tinker Cad
I used tinkercad here for the wiring and simulation of the circuit, The components are connected as shown in the figure.
As shown in the figure, the potentiometer is connected to A2; an analog Arduino pin, and the 7 segment is connected to digital pins from 2 to 8.
Code Blocks on TinkerCad
For the code, I used code blocks in TinkerCad.
The code idea was to first map the values of the potentiometer which are from 0 to 1023, to the values the 7-segment can display which are from 0 to 9.
The condition of the code is for the 7-segment to display 9 when the potentiometer reaches its max value and when it goes to zero, the 7-segment displays 0, and we repeat the process in the code as we map the potentiometer for each number of the 7-segment display from 9 to 0.
Putting the code in Arduino IDE to upload it.
I copied the text code from tinkercad and put it on Arduino IDE, after that I uploaded the code using the Arduino cable to the circuit
Displaying number 8 on the 7-segment using the potentiometer.
After uploading the code and connecting the potentiometer and wiring it on the Arduino Uno with the 7-segment display.
A video of the finished circuit
I had a problem that the 7-segment display didn't work at all during the simulation, and I didn't know why, even though I double-checked the connections and the code, So I asked Instructor Mohanad during the support session, how to solve the problem, and he helped with adjusting the code, and he discovered that I actually didn't make the 7-segment to be a common cathode, so when he changed it, it worked like magic.
Arduino Uno
Learning how to program the Arduino will help me a lot to be able to program my robot arm and how to make it move to certain degrees and grab things and move it.
We made a cardboard hand that waves at you.
It uses the ultrasonic sensor to sense the move in front of it and the servo to make it move and wave back at you
Me & my teammate with the waving hand.