What inspired me to choose this idea were electric doors, robots, and smart glasses for blind people—all of which can detect objects from a distance. This made me curious, so I researched which sensors they use, and I discovered that they commonly rely on ultrasonic sensors.
An ultrasonic sensor is an instrument that measures the distance to an object using ultrasonic sound waves.
Programs
Tinkercad Autodesk
Arduino IDE
Material Kits
Breadboard
Jumper wires
LED
Arduino Uno
Resistor 220 ohm
Piezo/ Buzzer
Ultrasonic sensor
USB Electric Arduino cable
Searching
I began by searching for projects that use ultrasonic sensors. On
www.instructables.com/Ultrasonic-Glasses-for-Blind-People/.
I found an idea where ultrasonic sensors were used to create glasses that help blind people, but the design included only a buzzer. In my version, I decided to add an LED as well.
Connecting the circuit
1- I signed in to Tinker cad using my Gmail account.
2- I selected the components: breadboard, LED, resistor, piezo, Arduino uno, and ultra sonic sensor.
3- I Connected the ultrasonic with the Arduino, ground to ground - echo to pin 2 - trig to pin 3 - VCC to the positive trail then to 5v on Arduino.
4- Connect the buzzer ground to negative trail and from it to ground and the positive to pin 10 (Output)
5- I used breadboard to connect the LED, negative with resistor 220 to negative trail and positive to pin 12 (Output)
Writing the code:
I used an if-else condition.
I programmed the ultrasonic sensor so that if the measured distance is less than 40 cm, it will read the input from the sensor (trigger at pin 3 and echo at pin 2). In this case, the outputs will be LED at pin 12 turns ON and the buzzer at pin 10 produces a high sound.
Otherwise, if the distance is greater than 40 cm, the LED at pin 12 will be OFF and the buzzer at pin 10 will also be OFF.
3- I ran the circuit simulation, and it worked successfully.
When the distance less 40 cm both LED and buzzer work and it reaches more than that both stop.
4- Choose block and text then copy the code.
5- Paste the code on Arduino IDE
6- Select the board (Arduino Uno)
7- Verify the code
8- Upload the code to Arduino.
Pick the components
Edit the power of the resistor
Connect all the components of the circuit.
Write the code.
Simulate the connection.
Copy the text code.
Select the board
Verify the code.
Downloading the code to Arduino Uno
Connecting the jumpers to Arduino and other components
1- I began by Connecting the ultrasonic sensor with the Arduino as following: - ground to ground pin on
Arduino - Echo to pin 2 - Trigger to pin 3 and VCC to the positive trail on the breadboard then connect another
jumper from the positive trail to the 5V on the Arduino.
3- Connect the positive of the LED to pin 12 and the negative side from the resistor to the negative trail that is
connected by another jumper to the ground.
4- Connect the positive of the buzzer to pin 10 and the negative trail to the ground.
Test the sensor
After connecting all components and uploading the code, place a box closer than 40 cm to the
ultrasonic sensor: both the buzzer and LED turn on and work. When the box is moved farther than 40
cm, both will turn off.
Connect all real the components
Test the components
Real connections
Simulation for real connections.
I asked my colleagues about the differences between inputs and outputs to help me while writing codes and I was still struggling to differentiate between both. Their explaining was: -
Input = Things that Arduino receives or reads from sensors (Temperature, distance)
Output = Things that Arduino controls (LED, Buzzer, motion)
I had some difficulty connecting the ultrasonic sensor with both the LED and the buzzer, as I initially connected only the buzzer. After asking my colleagues, they explained that the LED should also be set as an output, just like the buzzer, and connected in the same way with positive to the digital pin and ground to ground pin so I connected the positive side of the Led with pin 12 and the other side that contains resistor with ground.
The second challenge I faced was writing the code for the ultrasonic sensor, since I wasn’t very confident in using variables. Instead, I chose a simpler method we had already learned—using an IF condition. I set the input from the ultrasonic sensor with the distance I wanted < 40 cm and programmed both outputs to turn HIGH if an object was within range, and LOW if it was farther away so, both Led, and buzzer will turn on when an object is closer within 40 cm and turn of when the object moved away. This approach worked successfully.
The tasks I worked on this week will definitely help me with my final project, particularly in connecting various electronic components to the Arduino and developing suitable code for them.
What I enjoyed most this week was creating paper circuits to light up two LEDs. I found it to be an easy and simple way to demonstrate circuits, and I plan to use it with my students.
Paper Circuit
Title of Media