Arduino UNO and L298N Motor Driver Controlled DC Motor with Encoder
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino UNO, an L298N DC motor driver, and a DC motor with an encoder. The Arduino UNO is used to control the motor driver, which in turn drives the DC motor. The encoder provides feedback to the Arduino for precise motor control.
Component List
L298N DC Motor Driver
- Description: A dual H-Bridge motor driver that allows control of the speed and direction of two DC motors.
- Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
Arduino UNO
- Description: A microcontroller board based on the ATmega328P. It has 14 digital input/output pins, 6 analog inputs, and is programmable with the Arduino IDE.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
DC Motor with Encoder
- Description: A DC motor equipped with an encoder for feedback on the motor's position and speed.
- Pins: Encoder B, Encoder A, GND, VCC, Motor +ve, Motor -ve
Wiring Details
L298N DC Motor Driver
- OUT1: Connected to Encoder B of the DC Motor with Encoder
- OUT2: Connected to Motor -ve of the DC Motor with Encoder
- GND: Connected to GND of the Arduino UNO
- 5V: Connected to 5V of the Arduino UNO
- ENA: Connected to D6 of the Arduino UNO
- IN1: Connected to D7 of the Arduino UNO
- IN2: Connected to D8 of the Arduino UNO
Arduino UNO
- GND: Connected to GND of the L298N DC Motor Driver and GND of the DC Motor with Encoder
- 5V: Connected to 5V of the L298N DC Motor Driver
- D6: Connected to ENA of the L298N DC Motor Driver
- D7: Connected to IN1 of the L298N DC Motor Driver
- D8: Connected to IN2 of the L298N DC Motor Driver
- 3.3V: Connected to Motor +ve of the DC Motor with Encoder
- D3: Connected to VCC of the DC Motor with Encoder
- D2: Connected to Encoder A of the DC Motor with Encoder
DC Motor with Encoder
- Encoder B: Connected to OUT1 of the L298N DC Motor Driver
- Motor -ve: Connected to OUT2 of the L298N DC Motor Driver
- Motor +ve: Connected to 3.3V of the Arduino UNO
- GND: Connected to GND of the Arduino UNO
- VCC: Connected to D3 of the Arduino UNO
- Encoder A: Connected to D2 of the Arduino UNO
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:
}
Additional Documentation (documentation.txt)
This document provides a comprehensive overview of the circuit, including the components used, their connections, and the code for the Arduino UNO.