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

Arduino UNO Controlled Robot with Ultrasonic Sensor and Dual Motor Drivers

Image of Arduino UNO Controlled Robot with Ultrasonic Sensor and Dual Motor Drivers

Circuit Documentation

Summary of the Circuit

This circuit is designed to control a pair of DC motors using an L298N motor driver module, interfaced with an Arduino UNO microcontroller. It also includes a Tower Pro SG90 servo motor and an ultrasonic sensor for additional functionalities such as distance measurement or object detection. The power supply for the circuit is provided by a 18650 Li-Ion battery. The Arduino UNO is responsible for controlling the behavior of the motors and the servo, as well as processing the signals from the ultrasonic sensor.

Component List

Arduino UNO

  • Microcontroller board based on the ATmega328P
  • It has 14 digital input/output pins, 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header, and a reset button.

18650 Li-Ion Battery

  • Rechargeable lithium-ion battery
  • Provides power to the circuit.

L298N DC Motor Driver

  • A dual H-bridge motor driver module
  • Capable of driving two DC motors or one stepper motor.

Tower Pro SG90 Servo

  • A small and lightweight servo motor
  • Capable of precise position control.

Ultrasonic Sensor

  • Used for measuring distance to an object using ultrasonic waves.

Motor Amarillo Motorreductor Hobby (x2)

  • A yellow hobby gear motor
  • Used for applications requiring simple DC motors with gear reduction.

Wiring Details

Arduino UNO

  • 5V pin connected to the 5V power bus
  • GND pin connected to the ground bus
  • Digital pins D5 to D11 are used to interface with the servo, ultrasonic sensor, and motor driver.

18650 Li-Ion Battery

  • Positive terminal connected to the 12V input of the L298N motor driver
  • Negative terminal connected to the ground bus

L298N DC Motor Driver

  • 5V pin connected to the 5V power bus
  • GND pin connected to the ground bus
  • 12V pin connected to the positive terminal of the 18650 Li-Ion battery
  • IN1 to IN4 pins connected to Arduino UNO digital pins D8 to D11
  • OUT1 to OUT4 pins connected to the terminals of the two DC motors

Tower Pro SG90 Servo

  • Signal pin connected to Arduino UNO digital pin D5
  • +5V pin connected to the 5V power bus
  • GND pin connected to the ground bus

Ultrasonic Sensor

  • +VCC pin connected to the 5V power bus
  • GND pin connected to the ground bus
  • Trigger pin connected to Arduino UNO digital pin D6
  • Echo pin connected to Arduino UNO digital pin D7

Motor Amarillo Motorreductor Hobby

  • One motor's vcc and GND pins connected to OUT1 and OUT2 of the L298N motor driver
  • The other motor's vcc and GND pins connected to OUT3 and OUT4 of the L298N motor driver

Documented Code

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

}

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

}

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 should be added to initialize the pins connected to the L298N motor driver, the servo, and the ultrasonic sensor. The logic to control the motors, read sensor data, and actuate the servo should also be implemented within the loop function.