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

Arduino UNO Controlled Servo with HC-SR04 Ultrasonic Distance Sensing

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

Circuit Documentation

Summary

This circuit integrates an Arduino UNO microcontroller with an HC-SR04 Ultrasonic Distance Sensor and a Tower Pro SG90 servo motor. The Arduino UNO serves as the central processing unit, controlling the servo motor's position and reading distance measurements from the ultrasonic sensor. The servo motor is powered directly from the Arduino's 5V output, and the ultrasonic sensor is powered from the Arduino's Vin pin. Communication between the Arduino and the ultrasonic sensor is achieved through digital pins D8 and D9 for trigger and echo signals, respectively. The servo motor receives its control signal from digital pin D10.

Component List

Arduino UNO

HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)

Tower Pro SG90 servo

Wiring Details

Arduino UNO

HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)

Tower Pro SG90 servo

Documented Code

Arduino UNO Code (sketch.ino)

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

}

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

}

Note: The provided code is a template and does not contain any functional code to operate the HC-SR04 Ultrasonic Distance Sensor or the Tower Pro SG90 servo. The user is expected to implement the setup and loop functions to initialize the sensor and servo motor and to handle the logic for distance measurement and servo control.