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

Arduino UNO Controlled Servomotor with HC-SR04 Ultrasonic Distance Sensing

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

Circuit Documentation

Summary of the Circuit

This circuit integrates an Arduino UNO microcontroller with a Servomotor SG90 and an HC-SR04 Ultrasonic Distance Sensor. The Arduino UNO serves as the central processing unit, controlling the servomotor's position and reading distance measurements from the ultrasonic sensor. The servomotor is powered directly from the Arduino's 5V output, and the ultrasonic sensor is interfaced with the Arduino through digital pins for triggering and receiving echo signals. The circuit is designed to perform tasks that require distance sensing and actuation based on the sensed distance.

Component List

Arduino UNO

Servomotor SG90

HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)

Wiring Details

Arduino UNO

Servomotor SG90

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:

}

File: sketch.ino

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 code that needs to run once when the microcontroller is reset or powered on, such as pin initialization. The loop() function contains code that runs continuously as long as the Arduino is powered.

Additional code would be required to initialize the pins connected to the HC-SR04 sensor and the servomotor, as well as to implement the logic for distance measurement and motor control.