Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO with HC-SR04 Ultrasonic Distance Measurement

View and Edit Project In Cirkit DesignerImage of Arduino UNO with HC-SR04 Ultrasonic Distance Measurement

Circuit Documentation

Summary of the Circuit

This circuit consists of an Arduino UNO microcontroller board interfaced with an HC-SR04 Ultrasonic Distance Sensor. The Arduino UNO is responsible for controlling the sensor and processing the distance measurements. The HC-SR04 sensor is powered by the 5V output from the Arduino and uses two digital pins for triggering and receiving the ultrasonic pulses to measure distance.

Component List

Arduino UNO

HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)

Wiring Details

Arduino UNO

HC-SR04 Ultrasonic Distance Sensor

Documented Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

The provided code is a template for the Arduino UNO microcontroller. The setup() function is intended to contain initialization code that runs once when the microcontroller is powered on or reset. The loop() function is designed to contain the main logic of the program, which will run repeatedly in an infinite loop.

To fully utilize the HC-SR04 sensor, the code needs to be completed with the initialization of the TRIG and ECHO pins as outputs and inputs, respectively, and the implementation of the logic to trigger the ultrasonic pulse and read the distance from the ECHO pin.