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

Arduino-Controlled Robotic Vehicle with Joystick and L298N Motor Driver

Image of Arduino-Controlled Robotic Vehicle with Joystick and L298N Motor Driver

Circuit Documentation

Summary

This circuit is designed to control a dual-axis joystick module and a pair of DC gearmotors through an Arduino UNO microcontroller and an L298N DC motor driver. The joystick provides input to the Arduino, which then processes the signals to control the speed and direction of the motors. The motors are powered by a 6V battery pack, while the Arduino and the joystick module are powered by a separate 5V DC source.

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.

KY-023 Dual Axis Joystick Module

  • A module that provides two analog outputs (one for each axis) and a digital output (button press)
  • It has a comfortable thumb joystick and an easy-to-use interface.

L298N DC Motor Driver

  • A high-power motor driver capable of driving up to 2 DC motors
  • It has 4 input pins for controlling the motors in different directions and 2 enable pins for speed control.

Gearmotor DC Wheels (Left and Right)

  • DC gearmotors used to drive the wheels of a vehicle or robot
  • Each motor has two connection pins for power.

DC Source 5V

  • A power supply module that provides a regulated 5V output
  • It powers the Arduino and the joystick module.

Battery AAx4 6V

  • A battery pack consisting of 4 AA batteries providing a total of 6V
  • It is used to power the L298N motor driver and, subsequently, the DC motors.

Wiring Details

Arduino UNO

  • A0 connected to Joystick Module VRy
  • A1 connected to Joystick Module VRx
  • D2 connected to Joystick Module SW
  • D5 connected to Motor Driver ENA
  • D6 connected to Motor Driver IN1
  • D7 connected to Motor Driver IN2
  • D8 connected to Motor Driver IN3
  • D9 connected to Motor Driver IN4
  • D10 connected to Motor Driver ENB
  • 5V connected to Joystick Module +5V
  • GND connected to Joystick Module GND, Motor Driver GND, and Battery GND
  • Vin connected to DC Source VCC
  • GND connected to DC Source GND

KY-023 Dual Axis Joystick Module

  • VRx connected to Arduino A1
  • VRy connected to Arduino A0
  • SW connected to Arduino D2
  • +5V connected to Arduino 5V
  • GND connected to Arduino GND

L298N DC Motor Driver

  • ENA connected to Arduino D5
  • IN1 connected to Arduino D6
  • IN2 connected to Arduino D7
  • IN3 connected to Arduino D8
  • IN4 connected to Arduino D9
  • ENB connected to Arduino D10
  • OUT1 connected to Right Gearmotor PIN2
  • OUT2 connected to Right Gearmotor PIN1
  • OUT3 connected to Left Gearmotor PIN2
  • OUT4 connected to Left Gearmotor PIN1
  • 12V connected to Battery VCC
  • GND connected to Arduino GND

Gearmotor DC Wheels Left

  • PIN1 connected to Motor Driver OUT4
  • PIN2 connected to Motor Driver OUT3

Gearmotor DC Wheels Right

  • PIN1 connected to Motor Driver OUT2
  • PIN2 connected to Motor Driver OUT1

DC Source 5V

  • VCC connected to Arduino Vin
  • GND connected to Arduino GND

Battery AAx4 6V

  • VCC connected to Motor Driver 12V
  • GND connected to Arduino GND

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 for the Arduino UNO microcontroller. The setup() function is called once when the microcontroller is first powered on or reset. The loop() function is called repeatedly and contains the main logic that controls the circuit's behavior. The actual implementation details would be added to these functions to read the joystick inputs and control the motor driver accordingly.