Arduino UNO Controlled DC Motor with Encoder and Cytron Driver - Battery Powered
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino UNO microcontroller, a Cytron motor driver, a DC motor with an encoder, resistors, alligator clip cables, and a 12V battery. The circuit is designed to control the DC motor using the Arduino UNO and Cytron motor driver, with power supplied by the 12V battery.
Component List
Resistor
- Description: A resistor with a resistance of 333 Ohms.
- Pins: pin1, pin2
- Properties:
- Resistance: 333 Ohms
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- 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
Alligator Clip Cable (Red)
- Description: A red alligator clip cable.
- Pins: Pin, Alligator
Alligator Clip Cable (Blue)
- Description: A blue alligator clip cable.
- Pins: Pin, Alligator
12V Battery
- Description: A 12V battery for powering the circuit.
- Pins: VCC, GND
Cytron Motor Driver
- Description: A motor driver for controlling DC motors.
- Pins: m1b, m1a, b+, b-, m2a, m2b, dir1, pwm1, dir2, pwm2, gnd
DC Motor with Encoder
- Description: A DC motor with an integrated encoder for feedback.
- Pins: Encoder B, Encoder A, GND - Encoder, VCC - Encoder Power, Motor +ve, Motor -ve
Wiring Details
Arduino UNO
- D8 connected to Cytron Motor Driver pin dir1
- D9 connected to Cytron Motor Driver pin pwm1
- GND connected to DC Motor with Encoder pin Encoder B and Cytron Motor Driver pin gnd
- 5V connected to DC Motor with Encoder pin VCC - Encoder Power
- D3 connected to DC Motor with Encoder pin Encoder A
- D2 connected to DC Motor with Encoder pin GND - Encoder
Cytron Motor Driver
- dir1 connected to Arduino UNO pin D8
- pwm1 connected to Arduino UNO pin D9
- gnd connected to DC Motor with Encoder pin Encoder B and Arduino UNO pin GND
- m1b connected to DC Motor with Encoder pin Motor +ve
- m1a connected to DC Motor with Encoder pin Motor -ve
- b+ connected to 12V Battery pin VCC via Alligator Clip Cable (Red)
- b- connected to 12V Battery pin GND
DC Motor with Encoder
- Encoder B connected to Cytron Motor Driver pin gnd and Arduino UNO pin GND
- VCC - Encoder Power connected to Arduino UNO pin 5V
- Encoder A connected to Arduino UNO pin D3
- GND - Encoder connected to Arduino UNO pin D2
- Motor +ve connected to Cytron Motor Driver pin m1b
- Motor -ve connected to Cytron Motor Driver pin m1a
12V Battery
- VCC connected to Cytron Motor Driver pin b+ via Alligator Clip Cable (Red)
- GND connected to Cytron Motor Driver pin b-
Alligator Clip Cable (Red)
- Alligator connected to Cytron Motor Driver pin b+
- Pin connected to 12V Battery pin VCC
Alligator Clip Cable (Blue)
- Alligator connected to Cytron Motor Driver pin b-
- Pin connected to 12V Battery pin GND
Code Documentation
Arduino UNO Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code is a basic template for the Arduino UNO. The setup function is used to initialize any settings or configurations, and the loop function contains the main code that runs repeatedly. Currently, both functions are empty and need to be populated with the specific logic for controlling the DC motor and reading the encoder values.