DIY Ultrasound Tool Using Arduino Uno
by MaDDy Regal in Circuits > Arduino
1082 Views, 15 Favorites, 0 Comments
DIY Ultrasound Tool Using Arduino Uno

 (2100 x 1800 px).png)


Ultrasound Tool Project – DIY Distance Measuring & Object Detection System
In the age of automation, precise distance measurement and object detection have become critical in various applications, from industrial automation to robotics. This project showcases a DIY Ultrasound Tool, designed and built using Arduino, that provides real-time distance measurement, object detection alarms, object counting, and customizable settings — all in one compact device.
Features & Functionalities
- Digital Distance Scale: Continuously measures and displays distance in real-time on the OLED screen.
- Alarm System: Sounds a buzzer when an object enters a user-defined detection range.
- Object Counter: Tracks and displays the number of objects passing in front of the ultrasonic sensor.
- Settings Menu:
- Unit Conversion: Toggle between centimeters and inches.
- Brightness Adjustment: Customize OLED display brightness for visibility.
- Alarm Distance Setting: Set and modify the alarm trigger distance threshold.
Supplies

Analyze Circuit Diagram

Before jumping into the physical setup, it's essential to thoroughly understand how the components will work together. In this step, we examine the circuit diagram to identify each component’s role.
The ultrasonic sensor (like the HC-SR04) has four pins – VCC, GND, Trigger, and Echo – that need to be correctly interfaced with the Arduino. We also decide which digital pins of the Arduino will be used for triggering the sensor and reading the echo. This analysis helps in planning a clear and error-free connection layout and reduces issues during later stages.
Downloads
Prototyping on Breadboard

- Initial circuit design and testing were carried out on a Breadboard.
- Each component (ultrasonic sensor, OLED display, buzzer, and buttons) was connected to the Arduino Uno.
- Code was uploaded via Arduino IDE to ensure correct sensor readings, display outputs, and button responses.
- Multiple iterations were done to verify accuracy and correct any wiring or logical errors.
Circuit Optimization & Testing
.png)
- Optimized the layout for minimal wiring complexity and interference.
- Ensured power supply stability for the OLED display and sensor modules.
- Integrated debouncing algorithms for pushbuttons to improve menu navigation smoothness.
- Conducted tests for the alarm's response time and object counting a
Transition to Arduino Proto Shield

- After successful testing on breadboard, the final circuit was transferred to the Arduino Proto Shield.
- Components were soldered for a robust and permanent setup.
- Re-tested all functionalities post-soldering to confirm circuit integrity and performance.
Upload Code to Arduino Uno

- Connected the Arduino Uno to PC via USB cable.
- Opened Arduino IDE.
- Selected:
- Board: Arduino Uno.
- Port: Correct COM port.
- Copied the developed code (as shown previously) into the IDE.
- Clicked on Upload button to program the Arduino Uno with the new code.
Downloads
Testing Time

- After code uploading...... add the shield to UNO.
- Now attach the power source to arduino.
- Now you can use tool to measure Distance, Distance Alarm & Object Count
Setting Menu
.png)

We also have a setting option in this menu in which we have includes 3 main options settings.
- Change Digital Scale Unit in - MM, CM & IN.
- Control The Brightness Of Oled Display from 1-10.
- Change The Range Of Distance Alarm O
Technologies Used (In Detail)
- Arduino IDE (C/C++ Programming):
- Used for writing the core logic to handle sensor inputs, process data, manage the menu system, and control output devices (display & buzzer). Download Arduino IDE
- Ultrasonic Sensor HC-SR04 Library:
- Simplified interaction with the ultrasonic sensor, making it easier to get distance measurements accurately and quickly. Download Library
- OLED Display Library (U8g2 / U8glib):
- Provided efficient rendering of text and graphics on the small OLED display, including custom menus and indicators. Download Library
- Debouncing Techniques:
- Implemented in code to ensure reliable pushbutton input handling, avoiding false triggers during menu navigation.
- Prototyping Tools:
- Utilized breadboards and jumper wires during the initial development phase for flexible and rapid testing.