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

Arduino UNO Stepper Motor Controller with Keypad Shield and Relay Integration

Image of Arduino UNO Stepper Motor Controller with Keypad Shield and Relay Integration

Circuit Documentation

Summary

This circuit involves an Arduino UNO microcontroller interfacing with various components including a DM542 stepper driver, a 5V 2-Relay JD-VCC module, a keypad shield, a NEMA 23 stepper motor, limit switches, an emergency stop button, and indicator lamps. The circuit is designed to control a stepper motor and provide user input through a keypad shield, with safety features such as limit switches and an emergency stop button.

Component List

DM542 Stepper Driver

  • Description: Stepper motor driver
  • Pins: B-, B+, A-, A+, DC+, DC-, ENA-, ENA+, DIR-, DIR+, PUL-, PUL+

5V 2-Relay JD-VCC

  • Description: Relay module
  • Pins: JD-VCC, VCC, GND, IN1, IN2, NO, COM, NC

Keypad Shield

  • Description: Keypad and LCD shield for Arduino
  • Pins: rst, d, 5v, vin, A0, A1, A2, A3, A4, A5

NEMA 23 Stepper Motor

  • Description: Stepper motor
  • Pins: B2 Red, B1 Blue, A2 Black, A1 Green

Arduino UNO

  • Description: Microcontroller board
  • 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

GND

  • Description: Ground connection
  • Pins: GND

Limit Switch

  • Description: Mechanical switch for limit detection
  • Pins: C, NO, NC

Emergency STOP

  • Description: Emergency stop button
  • Pins: NC

SMPS

  • Description: Switched-mode power supply
  • Pins: L, N, GND, -DC, +DC

Lamp Red

  • Description: Red indicator lamp
  • Pins: +, -

Pilot Lamp Green

  • Description: Green indicator lamp
  • Pins: X1, X2

Wiring Details

DM542 Stepper Driver

  • PUL-: Connected to ENA- and DIR-
  • ENA-: Connected to PUL- and DIR-
  • ENA+: Connected to PUL- and DIR-
  • DIR-: Connected to PUL- and ENA-
  • DIR+: Connected to Arduino UNO D3
  • PUL+: Connected to Arduino UNO D2
  • B-: Connected to NEMA 23 A2 Black
  • B+: Connected to NEMA 23 A1 Green
  • A-: Connected to NEMA 23 B2 Red
  • A+: Connected to NEMA 23 B1 Blue
  • DC+: Connected to Emergency STOP NC and Lamp Red +
  • DC-: Connected to SMPS -DC and 5V 2-Relay JD-VCC NC

5V 2-Relay JD-VCC

  • JD-VCC: Connected to Arduino UNO 5V and Keypad Shield 5v
  • VCC: Connected to Arduino UNO 5V and Keypad Shield 5v
  • GND: Connected to Arduino UNO GND
  • IN2: Connected to Arduino UNO D7
  • NC: Connected to DM542 stepper driver DC-
  • NO: Connected to Pilot Lamp Green X1

Keypad Shield

  • 5v: Connected to Arduino UNO 5V and 5V 2-Relay JD-VCC VCC
  • vin: Connected to Arduino UNO Vin
  • A1: Connected to Limit Switch NO and Arduino UNO A1
  • A2: Connected to Limit Switch NC and Arduino UNO A2
  • A3: Connected to Arduino UNO A3
  • A4: Connected to Arduino UNO A4
  • A5: Connected to Arduino UNO A5

NEMA 23 Stepper Motor

  • A2 Black: Connected to DM542 stepper driver B-
  • A1 Green: Connected to DM542 stepper driver B+
  • B2 Red: Connected to DM542 stepper driver A-
  • B1 Blue: Connected to DM542 stepper driver A+

Arduino UNO

  • 5V: Connected to Keypad Shield 5v and 5V 2-Relay JD-VCC VCC
  • GND: Connected to 5V 2-Relay JD-VCC GND and Limit Switch C
  • Vin: Connected to Keypad Shield vin
  • A1: Connected to Keypad Shield A1 and Limit Switch NO
  • A2: Connected to Keypad Shield A2 and Limit Switch NC
  • A3: Connected to Keypad Shield A3
  • A4: Connected to Keypad Shield A4
  • A5: Connected to Keypad Shield A5
  • D2: Connected to DM542 stepper driver PUL+
  • D3: Connected to DM542 stepper driver DIR+
  • D7: Connected to 5V 2-Relay JD-VCC IN2
  • D13: Connected to DM542 stepper driver PUL-, ENA-, ENA+, and DIR-

Limit Switch

  • C: Connected to Arduino UNO GND
  • NO: Connected to Keypad Shield A1 and Arduino UNO A1
  • NC: Connected to Keypad Shield A2 and Arduino UNO A2

Emergency STOP

  • NC: Connected to DM542 stepper driver DC+ and Lamp Red +

SMPS

  • -DC: Connected to DM542 stepper driver DC- and 5V 2-Relay JD-VCC NC
  • +DC: Connected to Emergency STOP NC, Lamp Red -, and Pilot Lamp Green X2

Lamp Red

  • +: Connected to DM542 stepper driver DC+
  • -: Connected to SMPS +DC

Pilot Lamp Green

  • X1: Connected to 5V 2-Relay JD-VCC NO
  • X2: Connected to SMPS +DC

Code Documentation

Arduino UNO Code

/*
 * This Arduino Sketch initializes the LCD on the keypad shield.
 * The LCD is connected to the Arduino UNO via the analog pins.
 */

#include <LiquidCrystal.h>

// Initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

void setup() {
  // Set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("Hello, World!");
}

void loop() {
  // Nothing to do here
}

This code initializes the LCD on the keypad shield connected to the Arduino UNO. The LCD is set up with 16 columns and 2 rows, and it displays the message "Hello, World!" upon initialization. The loop function is empty as there is no repetitive task to perform.