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

Arduino-Controlled Obstacle-Avoiding Robot with Ultrasonic Sensor and Servo

View and Edit Project In Cirkit DesignerImage of Arduino-Controlled Obstacle-Avoiding Robot with Ultrasonic Sensor and Servo

Circuit Documentation

Summary

This circuit is designed to control a set of motors, read distance measurements from an ultrasonic sensor, and provide feedback through a servo and a buzzer. The main controller for the circuit is an Arduino UNO, which interfaces with an L298N DC motor driver to control the speed and direction of the motors. The HC-SR04 Ultrasonic Sensor is used for distance sensing, and a servo is controlled via PWM from the Arduino. A buzzer provides audio feedback, and a rocker switch (SPST) is used to control the power supply from the 18650 Li-ion batteries to the motor driver.

Component List

Wiring Details

Servo

HC-SR04 Ultrasonic Sensor

Gearmotor DC Wheels (Right and Left)

Buzzer

L298N DC Motor Driver

Arduino UNO

Rocker Switch (SPST)

18650 Li-ion Battery x 2

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:

}

This code is a template and does not contain any functional implementation. The setup() function is intended to contain initialization code that runs once, such as pin mode declarations. The loop() function is meant to contain the main logic of the program, which runs repeatedly.

Additional Notes