Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino-Controlled Ultrasonic Distance Measurement with Servo Feedback

Image of Arduino-Controlled Ultrasonic Distance Measurement with Servo Feedback

Circuit Documentation

Summary

The circuit in question consists of an Arduino UNO microcontroller interfaced with an HC-SR04 Ultrasonic Distance Sensor and a Servomotor SG90. The Arduino UNO is responsible for controlling the servomotor based on the distance measurements obtained from the ultrasonic sensor. The sensor triggers ultrasonic pulses and receives the echo to determine the distance to an object. The servomotor adjusts its position accordingly, as instructed by the Arduino UNO.

Component List

Arduino UNO

  • Description: A microcontroller board based on the ATmega328P.
  • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13.

HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)

  • Description: A sensor that measures distance by emitting ultrasonic waves and measuring the time taken for the echo to return.
  • Pins: VCC, TRIG, ECHO, GND.

Servomotor SG90

  • Description: A small and lightweight servo motor capable of precise control.
  • Pins: SIG, VCC, GND.

Wiring Details

Arduino UNO

  • 5V connected to VCC of HC-SR04 Ultrasonic Sensor and VCC of Servomotor SG90.
  • GND connected to GND of HC-SR04 Ultrasonic Sensor and GND of Servomotor SG90.
  • D12 connected to SIG of Servomotor SG90.
  • D11 connected to ECHO of HC-SR04 Ultrasonic Sensor.
  • D10 connected to TRIG of HC-SR04 Ultrasonic Sensor.

HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)

  • VCC connected to 5V of Arduino UNO.
  • TRIG connected to D10 of Arduino UNO.
  • ECHO connected to D11 of Arduino UNO.
  • GND connected to GND of Arduino UNO.

Servomotor SG90

  • SIG connected to D12 of Arduino UNO.
  • VCC connected to 5V of Arduino UNO.
  • GND connected to GND of Arduino UNO.

Documented Code

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

}

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

}

Filename: sketch.ino

Note: The provided code is a template and does not contain any functional code to control the components. The user is expected to write the necessary setup and loop functions to initialize the pins and implement the control logic for the HC-SR04 sensor and the SG90 servomotor.