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

Arduino-Controlled Robotics Platform with Ultrasonic Sensing and Dual Motor Drivers

View and Edit Project In Cirkit DesignerImage of Arduino-Controlled Robotics Platform with Ultrasonic Sensing and Dual Motor Drivers

Circuit Documentation

Summary of the Circuit

This circuit is designed to control a servo motor and two DC motors using an Arduino UNO microcontroller. It also includes an HC-SR04 ultrasonic sensor for distance measurement. The Arduino UNO is powered by a 3xAAA battery pack and interfaces with an L298N DC motor driver to control the motors. The servo motor is directly connected to the Arduino for control signals and power. The ultrasonic sensor is used for input and is connected to the Arduino's digital pins.

Component List

Arduino UNO

DC Motor (x2)

Servo

L298N DC Motor Driver

HC-SR04 Ultrasonic Sensor

3xAAA Battery Pack with Switch and JST

Wiring Details

Arduino UNO

DC Motor #1

DC Motor #2

Servo

L298N DC Motor Driver

HC-SR04 Ultrasonic Sensor

3xAAA Battery Pack with Switch and JST

Documented Code

/*
 * This Arduino sketch controls a green LED using two push buttons.
 * When P/B 1 is pressed, the green LED turns on.
 * When P/B 2 is pressed, the green LED turns off.
 */

const int buttonPin1 = 2; // P/B 1 connected to digital pin 2
const int buttonPin2 = 3; // P/B 2 connected to digital pin 3
const int ledPin = 13;    // Green LED connected to digital pin 13

void setup() {
  pinMode(buttonPin1, INPUT); // Set button pin 1 as input
  pinMode(buttonPin2, INPUT); // Set button pin 2 as input
  pinMode(ledPin, OUTPUT);    // Set LED pin as output
}

void loop() {
  if (digitalRead(buttonPin1) == HIGH) {
    digitalWrite(ledPin, HIGH); // Turn on LED
  }
  if (digitalRead(buttonPin2) == HIGH) {
    digitalWrite(ledPin, LOW);  // Turn off LED
  }
}

Note: The provided code does not match the described functionality of the circuit. The code is for controlling an LED with push buttons, while the circuit is designed to control motors and read from an ultrasonic sensor. The code needs to be updated to reflect the actual components and functionality of the circuit.