Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Controlled 8-Motor System with Keypad and DFPlayer Mini

View and Edit Project In Cirkit DesignerImage of Arduino UNO Controlled 8-Motor System with Keypad and DFPlayer Mini

Circuit Documentation

Summary

This circuit is designed to control 8 DC motors using an Arduino UNO, an 8-channel relay module, and a 4x4 membrane matrix keypad. Additionally, a DFPlayer Mini MP3 player is included to provide audio feedback. The circuit is powered by a 12V 200Ah battery.

Component List

  1. 12V 200Ah Battery

    • Pins: GND, 12V
    • Description: Provides power to the entire circuit.
  2. DC Mini Metal Gear Motor

    • Pins: IN1, IN2
    • Description: Drives mechanical components.
  3. DFPlayer MINI

    • Pins: VCC, BUSY, RX, USB -, TX, USB +, DAC_R, K2/ADC_KEY, DAC_L, K1/ADC_KEY, SPK1, IO 2, GND, SPK2, IO 1
    • Description: Plays MP3 files from a microSD card.
  4. Arduino UNO

    • 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
    • Description: Microcontroller that controls the entire circuit.
  5. 8 Channel Relay JD-VCC

    • Pins: JD-VCC, VCC, GND, In8, In7, In6, In5, In4, In3, In2, In1, In1_NC, IN1_COM, IN1_NO, IN2_NC, IN2_COM, IN2_NO, IN3_NC, IN3_COM, IN3_NO, IN4_NC, IN4_COM, IN4_NO, IN5_NC, IN5_COM, IN5_NO, IN6_NC, IN6_COM, IN6_NO, IN7_NC, IN7_COM, IN7_NO, IN8_NC, IN8_COM, IN8_NO
    • Description: Controls the power to the motors.
  6. 4X4 Membrane Matrix Keypad

    • Pins: R1, R2, R3, R4, C1, C2, C3, C4
    • Description: Provides user input to control the motors.
  7. Loudspeaker

    • Pins: pin1, pin2
    • Description: Outputs audio from the DFPlayer Mini.

Wiring Details

12V 200Ah Battery

DC Mini Metal Gear Motor

DFPlayer MINI

Arduino UNO

8 Channel Relay JD-VCC

4X4 Membrane Matrix Keypad

Loudspeaker

Documented Code

Main Sketch

#include <Keypad.h>
#include <SoftwareSerial.h>
#include "DFRobotDFPlayerMini.h"

static const uint8_t PIN_MP3_TX = 1; // Connects to module's RX 
static const uint8_t PIN_MP3_RX = 0; // Connects to module's TX 
SoftwareSerial softwareSerial(PIN_MP3_RX, PIN_MP3_TX);

// Create the Player object
DFRobotDFPlayerMini player;

// Define the keypad
const byte ROWS = 4; // Four rows
const byte COLS = 4; // Four columns
char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};
byte rowPins[ROWS] = {9, 8, 7, 6}; // Connect to the row pinouts of the keypad
byte colPins[COLS] = {5, 4, 3, 2}; // Connect to the column pinouts of the keypad

Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);

// Define relay pins
const int relayPins[8] = {10, 11, 12, 13, A0, A1, A2, A3};

void setup() {
  // Initialize relay pins as outputs
  for (int i = 0; i < 8; i++) {
    pinMode(relayPins[i], OUTPUT);
    digitalWrite(relayPins[i], LOW); // Ensure all relays are off initially
  }
  Serial.begin(9600);