Circuit Documentation
Summary
This circuit is designed to control two DC Mini Metal Gear Motors using an Arduino Nano microcontroller and an L298N DC motor driver. The L298N motor driver interfaces with the Arduino Nano to drive the motors based on the control signals provided by the Arduino's digital pins. The circuit is powered by a lipo battery that provides the necessary voltage to the motor driver and the Arduino Nano.
Component List
Arduino Nano
- Microcontroller board based on the ATmega328P
- It has a variety of digital and analog I/O pins for interfacing with various components and sensors.
- The Arduino Nano is used as the central control unit for the circuit.
L298N DC Motor Driver
- A module capable of driving two DC motors with a maximum current of 2A per channel.
- It provides the necessary current and voltage to the motors from the power source.
- The motor driver receives control signals from the Arduino Nano to operate the motors.
DC Mini Metal Gear Motor (x2)
- A compact and powerful DC motor with a gearbox for increased torque.
- These motors are the actuators in the circuit, responsible for converting electrical energy into mechanical motion.
Lipo Battery 2200mAh 30C
- A rechargeable battery that provides the power source for the motor driver and the Arduino Nano.
- It has a high discharge rate suitable for applications requiring high current draw.
Wiring Details
Arduino Nano
- D3 connected to L298N DC motor driver IN1
- D4 connected to L298N DC motor driver IN2
- D5 connected to L298N DC motor driver IN3
- D6 connected to L298N DC motor driver IN4
- VIN connected to L298N DC motor driver 5V
- GND connected to common ground with L298N DC motor driver and lipo battery
L298N DC Motor Driver
- IN1 connected to Arduino Nano D3
- IN2 connected to Arduino Nano D4
- IN3 connected to Arduino Nano D5
- IN4 connected to Arduino Nano D6
- OUT1 connected to DC Mini Metal Gear Motor (Motor 1) IN2
- OUT2 connected to DC Mini Metal Gear Motor (Motor 1) IN1
- OUT3 connected to DC Mini Metal Gear Motor (Motor 2) IN2
- OUT4 connected to DC Mini Metal Gear Motor (Motor 2) IN1
- 5V connected to Arduino Nano VIN
- GND connected to common ground with Arduino Nano and lipo battery
- 12V connected to lipo battery VCC
DC Mini Metal Gear Motor (Motor 1)
- IN1 connected to L298N DC motor driver OUT2
- IN2 connected to L298N DC motor driver OUT1
DC Mini Metal Gear Motor (Motor 2)
- IN1 connected to L298N DC motor driver OUT4
- IN2 connected to L298N DC motor driver OUT3
Lipo Battery 2200mAh 30C
- VCC connected to L298N DC motor driver 12V
- GND connected to common ground with Arduino Nano and L298N DC motor driver
Documented Code
Arduino Nano - sketch.ino
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Note: The provided code is a template and does not contain any functional code to control the motors. The user must implement the control logic within the setup() and loop() functions to drive the motors using the L298N motor driver.
