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

Arduino UNO Controlled Ultrasonic Distance Measurement with LED Indicators

View and Edit Project In Cirkit DesignerImage of Arduino UNO Controlled Ultrasonic Distance Measurement with LED Indicators

Circuit Documentation

Summary

This circuit is designed around an Arduino UNO microcontroller and includes a variety of components such as an HC-SR04 Ultrasonic Sensor, multiple LEDs of different colors, and resistors. The circuit is powered by a pair of 18650 Li-ion batteries connected through a 2.1mm Barrel Jack with Terminal Block. The LEDs are controlled by the Arduino UNO and are connected with resistors to limit the current through them. The HC-SR04 Ultrasonic Sensor is interfaced with the Arduino for distance measurement.

Component List

Microcontroller

Sensors

LEDs

Resistors

Power Components

Wiring Details

Arduino UNO

HC-SR04 Ultrasonic Sensor

LEDs

Resistors

Power Components

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 with empty setup() and loop() functions, which are the standard structure for Arduino sketches. The setup() function is intended for initialization code that runs once when the program starts, such as configuring pin modes. The loop() function contains the main logic of the sketch, which runs repeatedly as long as the Arduino is powered.

For this circuit, the setup() function would typically be used to initialize the pins connected to the LEDs as outputs and the pins connected to the HC-SR04 sensor. The loop() function would handle the logic for turning the LEDs on and off and reading distance measurements from the HC-SR04 sensor. However, the actual implementation details are not provided in the input code.