Distance measuring tool
Measuring distances with traditional tools like rulers and tape measures can be inconvenient. They require direct contact, are difficult to use for long distances, and are often prone to human error. So, I’m working on a smart distance meter that uses an ultrasonic sensor.
A red wire connects the 5V pin on the Arduino to the positive (+) rail of the breadboard.
A black wire connects the Arduino’s GND pin to one side pin of the slide switch.
The switch’s common pin is connected to the negative (–) rail of the breadboard.
GND → Negative rail
VCC → Positive rail
TRIG → Arduino pin 6
ECHO → Arduino pin 5
GND → Negative rail
VCC → Positive rail
SDL → Arduino pin A5
SDA → Arduino pin A4
LCD Configuration:
Set the I2C address to 0x27 (this address for our LCD).
Select the type of I2C as image (like our I2C).
Full Circuit Link
LCD Configuration Steps:
Configure the LCD to use I2C type with the default address 0x27.
Turn on the backlight to enable visibility.
Set the cursor position to column 0, row 0.
Clear the LCD to remove any previous data.
LCD Workflow for Displaying Ultrasonic Distance
Clear the screen → Wipes any previous text or data, ensuring a fresh display.
Set cursor (column 0, row 0) → Positions the cursor at the top-left corner of the LCD.
Print "Distance:" → Displays the static label on the first line.
Set cursor (column 0, row 1) → Moves the cursor to the beginning of the second line.
Read ultrasonic sensor value →
Trigger pin connected to Arduino pin 6.
Echo pin connected to Arduino pin 5.
Measures distance in centimeters (cm).
Print distance value → Shows the numerical reading on the second line.
Print " cm" → Adds units after the number (e.g., 15 cm).
Wait 0.5 seconds → Pauses briefly so the reading stays visible before updating.
Outputs:
LCD Screen
Inputs:
Ultrasonic Sensor
Controls:
ON/OFF Switch → powers the circuit
Power Supply:
9V DC from a 9V 2A adapter for Arduino
Full Circuit Link 🔗
First, we gathered the required components: jumpers, breadboard, Arduino, on/off switch, ultrasonic sensor, and 9V adapter .
The device is a simple ultrasonic distance measurement system with an LCD display.
Connect the power wire to the slide switch: the positive wire goes to the common pin of the slide switch, and the negative wire goes to the breadboard’s negative rail.
Then connect one side pin of switch to Vin and then negative rail breadboard to Arduino ground and Arduino 5v to breadboard positive rail
Then, connect the ultrasonic sensor exactly as the same way we did in our Tinkercad simulator.
Then, we connected four wires to the LCD exactly as the same way we did in our Tinkercad simulator.
Then, we connected the yellow (SCL) and orange (SDA ) wires to Arduino pins A4 and A5, just like in the circuit simulation.
Finally, we uploaded the code to the Arduino
Then, we connected the 9V adapter and tested the circuit.
My peer Zain asked me if there’s a way to make a push button work as a latch. I told him that there are methods to do this, and I shared with him a this project where pressing the button once turns the LED on, and pressing it again turns it off.
In the midweek session, my peer Zain faced an issue with the 7-segment display in Tinkercad not working. I pointed out that the problem was due to him using a common anode instead of a common cathode.
When I powered the circuit, it didn’t work. As soon as I noticed this, I immediately disconnected the power to avoid damaging any components. Then, I visually troubleshooted 👀 the circuit, found the mistake—I had accidentally swapped the GND and VCC pins—corrected it, and everything worked fine afterwards. Nothing was damaged, al-ḥamdu li-llāh.
I noticed that the ultrasonic sensor readings were not fully accurate, with about a 0.5 cm error. We can perform calibration to make it more precise."
Chess clock🕒
This week was an introduction to Arduino and sensors. The skills and knowledge I gained—such as designing electronic circuits in Tinkercad, troubleshooting them, and practicing with code blocks—will be very useful for my chess clock project. They will help me integrate Arduino with sensors, design and prototype components more efficiently, simulate and test ideas before implementation, and solve technical issues with greater confidence.
This week we went to Dish Party at the main campus in Maadi 🎉. We discovered that in Mansoura and Zagazig they’ve been tricking us 🤯—they don’t provide the same 10 vouchers we get here! 😂 But honestly, the Dish Party was super fun 🍽️ and the community was really nice 🤝.
Dish Pratty
In the off-line session, I worked with Dalia and Youssef on a beautiful project, which is to control the servo motor through the Ultra Sonic Sensor, and the work was great, and the task was completed successfully after many attempts, and the work was wonderful with a different and unique project
Smart Waving Robot