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

Arduino UNO Controlled Servomotor with HC-SR04 Ultrasonic Sensor

Image of Arduino UNO Controlled Servomotor with HC-SR04 Ultrasonic Sensor

Circuit Documentation

Summary

The circuit in question consists of an Arduino UNO microcontroller, a Servomotor SG90, and an HC-SR04 Ultrasonic Sensor. The Arduino UNO serves as the central processing unit, controlling the servomotor and interfacing with the ultrasonic sensor to possibly measure distance or detect objects. The servomotor is likely used for some form of motion or position control, and the ultrasonic sensor is used for distance measurements or proximity detection.

Component List

Arduino UNO

  • Description: A microcontroller board based on the ATmega328P.
  • Pins Used: IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13.
  • Purpose: Acts as the central controller for the circuit, interfacing with the sensor and controlling the servomotor.

Servomotor SG90

  • Description: A small and lightweight servo motor capable of precise control.
  • Pins Used: SIG, VCC, GND.
  • Purpose: Provides precise control of mechanical movement in response to electrical signals from the Arduino UNO.

HC-SR04 Ultrasonic Sensor

  • Description: An ultrasonic ranging module that provides 2cm to 400cm non-contact measurement functionality.
  • Pins Used: VCC, TRIG, ECHO, GND.
  • Purpose: Measures distances by emitting ultrasonic waves and detecting the reflection back from objects.

Wiring Details

Arduino UNO

  • 5V connected to VCC of Servomotor SG90 and HC-SR04 Ultrasonic Sensor.
  • GND connected to GND of Servomotor SG90 and HC-SR04 Ultrasonic Sensor.
  • 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.

Servomotor SG90

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

HC-SR04 Ultrasonic Sensor

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

Documented Code

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

}

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

}

File Name: sketch.ino

The provided code is a template with the standard setup() and loop() functions for an Arduino sketch. The setup() function is intended to contain initialization code that runs once when the microcontroller is powered on or reset. The loop() function contains the main logic of the sketch, which runs repeatedly as long as the microcontroller is powered. Additional code would be required to control the servomotor and read data from the ultrasonic sensor.