Arduino-Controlled Dual DC Motor Driver with NRF24L01 Wireless Communication and MPU-6050 Motion Tracking
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to control two DC motors using an L298N DC motor driver, interfaced with an Arduino Nano microcontroller. The Arduino Nano also communicates with an NRF24L01 module for wireless communication and an MPU-6050 sensor for motion tracking. The circuit is powered by two sets of 18650 batteries, and it includes a red LED with a current-limiting resistor for indication purposes.
Component List
L298N DC Motor Driver
- Description: A motor driver module capable of driving 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
NRF24L01
- Description: A wireless communication module operating on the 2.4GHz band.
- Pins: IRQ (not used), MOSI, CSN, VCC (3V), GND, CE, SCK, MISO
Arduino Nano
- Description: A small, complete, and breadboard-friendly microcontroller board based on the ATmega328P.
- Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
2x 18650 Batteries (Two Instances)
- Description: Rechargeable lithium-ion cells providing power to the circuit.
- Pins: VCC, GND
DC Motors (Two Instances)
- Description: Electric motors converting electrical energy into mechanical rotation.
- Pins: Pin 1, Pin 2
LED: Two Pin (Red)
- Description: A red light-emitting diode used as an indicator.
- Pins: Cathode, Anode
MPU-6050
- Description: A motion tracking device with a 3-axis gyroscope and a 3-axis accelerometer.
- Pins: VCC, GND, SCL, SDA, XDA, XCL, AD0, INT
Resistor
- Description: A passive two-terminal electrical component that implements electrical resistance as a circuit element.
- Pins: Pin1, Pin2
- Properties: Resistance: 200 Ohms
Wiring Details
L298N DC Motor Driver
- OUT1 connected to DC Motor (Motor 1) Pin 2
- OUT2 connected to DC Motor (Motor 1) Pin 1
- 12V connected to 18650 Battery Pack VCC
- GND connected to 18650 Battery Pack GND
- OUT3 connected to DC Motor (Motor 2) Pin 2
- OUT4 connected to DC Motor (Motor 2) Pin 1
- ENA connected to Arduino Nano D3
- IN1 connected to Arduino Nano D4
- IN2 connected to Arduino Nano D5
- IN3 connected to Arduino Nano D6
- IN4 connected to Arduino Nano D7
- ENB connected to Arduino Nano D10
NRF24L01
- MOSI connected to Arduino Nano D11/MOSI
- CSN connected to Arduino Nano A1
- VCC (3V) connected to Arduino Nano 3V3
- GND connected to common ground net
- CE connected to Arduino Nano A0
- SCK connected to Arduino Nano D13/SCK
- MISO connected to Arduino Nano D12/MISO
Arduino Nano
- GND connected to common ground net
- VIN connected to 18650 Battery Pack VCC
- 5V connected to MPU-6050 VCC
- A5 connected to MPU-6050 SDA
- A4 connected to MPU-6050 SCL
- D2 connected to LED Anode
2x 18650 Batteries
- VCC and GND used to power the circuit and components.
DC Motors
- Each motor has two pins connected to the L298N motor driver.
LED: Two Pin (Red)
- Anode connected to Arduino Nano D2
- Cathode connected to Resistor Pin2
MPU-6050
- VCC connected to Arduino Nano 5V
- GND connected to common ground net
- SDA connected to Arduino Nano A5
- SCL connected to Arduino Nano A4
Resistor
- Pin1 connected to common ground net
- Pin2 connected to LED Cathode
Documented Code
Arduino Nano Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Additional Notes
- The provided code is a template and does not contain any functional code for the operation of the circuit.
- The user must implement the setup and loop functions to control the motors, read sensor data, and handle wireless communication.
- The common ground net indicates that all GND pins are interconnected.
- The 18650 Battery Packs must be connected in such a way that they provide the correct voltage levels to the components requiring power.