Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino Mega 2560 Multi-Motor Control System with NRF24L01 Wireless Module

Image of Arduino Mega 2560 Multi-Motor Control System with NRF24L01 Wireless Module

Circuit Documentation

Summary

This circuit integrates various components to perform multiple functions, including motor control, wireless communication, and stepper motor driving. The central processing unit is an Arduino Mega 2560, which interfaces with an NRF24L01 wireless module, an L298N DC motor driver, a TB6612FNG motor driver, and an A4988 stepper motor driver. Power is supplied by a 2200mAh LiPo battery and a 12V battery, which are connected to the motor drivers. The circuit controls several DC motors and a bipolar stepper motor.

Component List

Arduino Mega 2560

  • Microcontroller board based on the ATmega2560
  • Provides 54 digital input/output pins, 16 analog inputs, 4 UARTs, a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button.

NRF24L01

  • A wireless transceiver module that operates in the 2.4GHz band
  • Features include up to 2Mbps data rate, low power consumption, and enhanced ShockBurst™ and Auto Acknowledgment support.

L298N DC Motor Driver

  • A high-power motor driver capable of driving up to two DC motors
  • Provides several control modes and is capable of delivering up to 2A per channel.

TB6612FNG Motor Driver

  • A compact dual motor driver carrier
  • Can deliver up to 1.2A per channel continuously (3.2A peak) with thermal shutdown protection.

A4988 Stepper Motor Driver (Red)

  • A complete microstepping motor driver with a built-in translator for easy operation
  • The driver offers five different step resolutions and operates bipolar stepper motors in full-, half-, quarter-, eighth-, and sixteenth-step modes.

LiPo Battery 2200mAh 30C

  • A rechargeable battery with high discharge rates
  • Used to power the motors and motor drivers in the circuit.

12V Battery

  • Provides the necessary voltage for certain components in the circuit that require higher operating voltages.

DC Motors

  • Electric motors that convert electrical energy into mechanical energy
  • Used for various applications requiring rotational motion.

DC Mini Metal Gear Motor

  • A small DC motor with a gearbox for increased torque
  • Suitable for applications where space is limited and high torque is required.

Stepper Motor (Bipolar)

  • A motor that divides a full rotation into a number of equal steps
  • Ideal for precise control of rotation angle, speed, and position.

Wiring Details

Arduino Mega 2560

  • 3V3 connected to NRF24L01 VCC (3V)
  • 5V connected to TB6612FNG Motor Driver VCC and A4988 Stepper Motor Driver VDD
  • GND connected to NRF24L01 GND, A4988 Stepper Motor Driver GND, L298N DC Motor Driver GND, and TB6612FNG Motor Driver GND
  • VIN connected to L298N DC Motor Driver 5V
  • A0 connected to L298N DC Motor Driver ENA
  • A1 connected to L298N DC Motor Driver ENB
  • A2 connected to TB6612FNG Motor Driver PWMB
  • A3 connected to TB6612FNG Motor Driver PWMA
  • D2 PWM connected to A4988 Stepper Motor Driver DIR
  • D3 PWM connected to A4988 Stepper Motor Driver STEP
  • D7 PWM connected to NRF24L01 CE
  • D8 PWM connected to NRF24L01 CSN
  • D10 PWM connected to TB6612FNG Motor Driver AI2
  • D11 PWM connected to TB6612FNG Motor Driver AI1
  • D12 PWM connected to TB6612FNG Motor Driver BI1
  • D13 PWM connected to TB6612FNG Motor Driver BI2
  • D24 connected to L298N DC Motor Driver IN1
  • D25 connected to L298N DC Motor Driver IN2
  • D26 connected to L298N DC Motor Driver IN3
  • D27 connected to L298N DC Motor Driver IN4
  • D50 connected to NRF24L01 MISO
  • D51 connected to NRF24L01 MOSI
  • D52 connected to NRF24L01 SCK

NRF24L01

  • VCC (3V) connected to Arduino Mega 2560 3V3
  • GND connected to Arduino Mega 2560 GND
  • CE connected to Arduino Mega 2560 D7 PWM
  • CSN connected to Arduino Mega 2560 D8 PWM
  • SCK connected to Arduino Mega 2560 D52
  • MISO connected to Arduino Mega 2560 D50
  • MOSI connected to Arduino Mega 2560 D51

L298N DC Motor Driver

  • GND connected to Arduino Mega 2560 GND and LiPo Battery 2200mAh 30C GND
  • 5V connected to Arduino Mega 2560 VIN
  • ENA connected to Arduino Mega 2560 A0
  • ENB connected to Arduino Mega 2560 A1
  • IN1 connected to Arduino Mega 2560 D24
  • IN2 connected to Arduino Mega 2560 D25
  • IN3 connected to Arduino Mega 2560 D26
  • IN4 connected to Arduino Mega 2560 D27
  • OUT1 connected to DC Motor pin 2 (Instance 1)
  • OUT2 connected to DC Motor pin 1 (Instance 1)
  • OUT3 connected to DC Motor pin 2 (Instance 2)
  • OUT4 connected to DC Motor pin 1 (Instance 2)
  • 12V connected to LiPo Battery 2200mAh 30C VCC

TB6612FNG Motor Driver

  • VCC connected to Arduino Mega 2560 5V
  • GND connected to Arduino Mega 2560 GND, A4988 Stepper Motor Driver GND, and 12V Battery -
  • VM connected to 12V Battery +
  • PWMB connected to Arduino Mega 2560 A2
  • PWMA connected to Arduino Mega 2560 A3
  • AI2 connected to Arduino Mega 2560 D10 PWM
  • AI1 connected to Arduino Mega 2560 D11 PWM
  • BI1 connected to Arduino Mega 2560 D12 PWM
  • BI2 connected to Arduino Mega 2560 D13 PWM
  • B01 connected to DC Mini Metal Gear Motor IN1 (Instance 1)
  • B02 connected to DC Mini Metal Gear Motor IN2 (Instance 1)
  • A02 connected to DC Mini Metal Gear Motor IN1 (Instance 2)
  • A01 connected to DC Mini Metal Gear Motor IN2 (Instance 2)

A4988 Stepper Motor Driver (Red)

  • VDD connected to Arduino Mega 2560 5V
  • GND connected to Arduino Mega 2560 GND and TB6612FNG Motor Driver GND
  • VMOT connected to 12V Battery +
  • DIR connected to Arduino Mega 2560 D2 PWM
  • STEP connected to Arduino Mega 2560 D3 PWM
  • RESET connected to A4988 Stepper Motor Driver SLEEP
  • 2B connected to Stepper Motor (Bipolar) A
  • 2A connected to Stepper Motor (Bipolar) C
  • 1A connected to Stepper Motor (Bipolar) B
  • 1B connected to Stepper Motor (Bipolar) D

LiPo Battery 2200mAh 30C

  • VCC connected to L298N DC Motor Driver 12V
  • GND connected to L298N DC Motor Driver GND

12V Battery

  • + connected to TB6612FNG Motor Driver VM and A4988 Stepper Motor Driver VMOT
  • - connected to TB6612FNG Motor Driver GND

DC Motors

  • pin 1 and pin 2 of each DC Motor connected to the corresponding OUT pins of the L298N DC Motor Driver

DC Mini Metal Gear Motors

  • IN1 and IN2 of each DC Mini Metal Gear Motor connected to the corresponding B01/B02 or A01/A02 pins of the TB6612FNG Motor Driver

Stepper Motor (Bipolar)

  • A, B, C, D pins of the Stepper Motor connected to the corresponding 2B/2A/1A/1B pins of the A4988 Stepper Motor Driver

Documented Code

Arduino Mega 2560 Code (sketch.ino)

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

The provided code