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

Arduino Leonardo-Controlled Robot with L298N Motor Driver and Multiple Sensors

Image of Arduino Leonardo-Controlled Robot with L298N Motor Driver and Multiple Sensors

Circuit Documentation

Summary

This circuit is designed to interface an Arduino Leonardo with various sensors, actuators, and a motor driver. It includes IR sensors for object detection, an ultrasonic sensor for distance measurement, gearmotors controlled by an L298N motor driver, LEDs with current-limiting resistors, a servomotor, a piezo speaker for audio feedback, and a power supply system using 18650 batteries with a rocker switch. The circuit is likely intended for a robotics application, given the presence of motor control and various sensors for environmental interaction.

Component List

Microcontroller

  • Arduino Leonardo (Rev3b): A microcontroller board based on the ATmega32u4, with digital and analog I/O pins.

Motor Driver

  • L298N DC Motor Driver: A high-power motor driver capable of driving up to four DC motors or two stepper motors.

Motors

  • Gearmotor DC / Motorreductor: DC gearmotors used for driving wheels or other mechanical parts.

Sensors

  • IR Sensor: Infrared sensors used for object detection or line tracking.
  • HC-SR04 Ultrasonic Sensor: An ultrasonic distance sensor that can measure distances using sonar.

Actuator

  • Servomotor SG92R: A small servo motor for precise angular movement.

Power Supply

  • 2x 18650 Battery Holder: A battery holder for two 18650 lithium-ion batteries.

Indicators

  • LED: Two Pin (white): White LEDs used as indicators or for illumination.

Passive Components

  • Resistor: Resistors used to limit current through LEDs and for pull-up/pull-down purposes.
  • Piezo Speaker: An electronic component that can generate sound when an electrical signal is applied.

Switch

  • Rocker Switch: A switch used to control the power supply to the circuit.

Wiring Details

Arduino Leonardo (Rev3b)

  • Digital pins D0-D13 are used for interfacing with the IR sensors, ultrasonic sensor, motor driver, and servomotor.
  • Analog pins A0-A2 are used for additional sensor inputs.
  • Power pins (5V, GND, VIN) are connected to the power supply system and ground connections.

L298N DC Motor Driver

  • IN1-IN4 are control inputs from the Arduino.
  • ENA and ENB are enable pins for motor control, connected to the Arduino PWM outputs.
  • OUT1-OUT4 are motor outputs connected to the gearmotors.
  • Power pins (12V, GND) are connected to the battery holder and ground.

Gearmotor DC / Motorreductor

  • Pin1 and Pin2 are connected to the motor driver outputs.

IR Sensor

  • VCC and GND are connected to the power supply and ground.
  • OUT is connected to the Arduino digital input pins.

HC-SR04 Ultrasonic Sensor

  • VCC and GND are connected to the power supply and ground.
  • TRIG and ECHO are connected to the Arduino digital pins.

Servomotor SG92R

  • VCC and GND are connected to the power supply and ground.
  • SIG is connected to an Arduino analog input pin.

2x 18650 Battery Holder

  • VCC and GND are connected to the motor driver and the Arduino VIN and GND pins.

LED: Two Pin (white)

  • Anode is connected to the Arduino digital pins through current-limiting resistors.
  • Cathode is connected to ground.

Resistor

  • Connected in series with LEDs to limit the current.

Piezo Speaker

  • Pin1 and Pin2 are connected to each other (possibly a mistake in the circuit design).

Rocker Switch

  • Connected in series with the battery holder and the motor driver power input to control the power supply.

Documented Code

No code has been provided for the microcontroller. The expected code would handle the reading of sensor inputs, control the motor driver, and manage the outputs to the LEDs and servomotor based on the sensor data.


Please note that the provided information is based on the given parts list and electrical net list. The actual functionality of the circuit would be determined by the embedded code running on the Arduino Leonardo, which has not been provided.