Arduino UNO-Based Battery-Powered Robotic Motor Controller with MPU-6050
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, an L298N DC motor driver, a Lipo Battery, two motors with reducers, and an MPU-6050 sensor. The circuit is designed to control the motors using the motor driver and read sensor data from the MPU-6050. The Arduino UNO serves as the central controller, interfacing with the motor driver and the sensor.
Component List
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
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
Lipo Battery
- Description: A rechargeable lithium polymer battery.
- Pins: VCC, GND
Motor with Reducer (Motor 1)
- Description: A DC motor with a gear reducer.
- Pins: 3 - 6 VCC, GND
Motor with Reducer (Motor 2)
- Description: A DC motor with a gear reducer.
- Pins: 3 - 6 VCC, GND
MPU-6050
- Description: A 6-axis motion tracking device that combines a 3-axis gyroscope and a 3-axis accelerometer.
- Pins: VCC, GND, SCL, SDA, XDA, XCL, AD0, INT
Wiring Details
Arduino UNO
- 5V connected to MPU-6050 VCC
- GND connected to MPU-6050 GND, Lipo Battery GND, L298N DC Motor Driver GND
- Vin connected to L298N DC Motor Driver 5V
- A4 connected to MPU-6050 SDA
- A5 connected to MPU-6050 SCL
- D11 connected to L298N DC Motor Driver ENA
- D10 connected to L298N DC Motor Driver ENB
- D7 connected to L298N DC Motor Driver IN1
- D6 connected to L298N DC Motor Driver IN2
- D5 connected to L298N DC Motor Driver IN3
- D4 connected to L298N DC Motor Driver IN4
- D2 connected to MPU-6050 INT
L298N DC Motor Driver
- GND connected to Arduino UNO GND, Lipo Battery GND
- 5V connected to Arduino UNO Vin
- ENA connected to Arduino UNO D11
- ENB connected to Arduino UNO D10
- IN1 connected to Arduino UNO D7
- IN2 connected to Arduino UNO D6
- IN3 connected to Arduino UNO D5
- IN4 connected to Arduino UNO D4
- OUT1 connected to Motor 1 3 - 6 VCC
- OUT2 connected to Motor 1 GND
- OUT3 connected to Motor 2 GND
- OUT4 connected to Motor 2 3 - 6 VCC
- 12V connected to Lipo Battery VCC
Lipo Battery
- VCC connected to L298N DC Motor Driver 12V
- GND connected to Arduino UNO GND, L298N DC Motor Driver GND
Motor with Reducer (Motor 1)
- 3 - 6 VCC connected to L298N DC Motor Driver OUT1
- GND connected to L298N DC Motor Driver OUT2
Motor with Reducer (Motor 2)
- 3 - 6 VCC connected to L298N DC Motor Driver OUT4
- GND connected to L298N DC Motor Driver OUT3
MPU-6050
- VCC connected to Arduino UNO 5V
- GND connected to Arduino UNO GND
- SDA connected to Arduino UNO A4
- SCL connected to Arduino UNO A5
- INT connected to Arduino UNO D2
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)