Arduino Stepper Motor Control




Hardware Preparation

 

 

If you have purchased the Arduino Board from ZTW, we have already uploaded the g-code library for you. If you are using your own Arduino Board, you can doawnload grbl Arduino library online and load it to your board using xloader.

 

 

The power supply is used to give the power to stepper motor driver board.

 

  • USB Cable (A Male – B Male/Printer USB Cable)

A USB cable is need to connect the Arduino board to your computer. An A Male to B Male USB cable will be used, the one usually used for printer USB connection. If you really cannot find one, here is the link you can purchase.

 

Wiring Instruction

ZTW-Arduino-Control-Diagram.jpg




 

This is the diagram we will be following in order to use the Arduino to control our stepper drivers. You will use an Arduino Board(UNO) as a controoler, 3 stepper motors and drivers, a DC power supply and a laptop computer.

 

Arduino Wire 001.JPG
 

First, attach a power cord to your power supply. Please check your outlet voltage, change the 110 – 220V setting on your PSU if necessary according to PSU you are using.

 

Arduino Wire 002.JPG
Now we need to connect the PSU’s DC output (12V) to stepper motor driver. To illustrate this better, we are using red wire for positive and black for negative connections.

 

Arduino Wire 003.JPG
We are going to wire positive terminals on all three stepper motor drivers together, and same for negative terminals. Here you can see the positive(red) wire from the PSU as well as another red wire(jumper) to our first stepper driver.

 

Arduino Wire 004.JPG
Here is how the power wires will be connected from PSU to all three stepper drivers when it is done.

 

Arduino Wire 005.JPG
Now we will start connecting the stepper singal lines to the Arduino. First we need to connect all “-Dir” and “-Pul” terminals together, these will be connected to the ground pin on the Arduino board.

 

Arduino Wire 006.JPG
Now we will connect the signal ground to the Arduino Board ground.

 

Arduino Wire 007.JPG
Here is a closer look at the Arduino board ground pin connection.

 

Arduino Wire 008.JPG
Now the “+Pul” for X axis will be connected to Arduino board pin 2.

 

Arduino Wire 009.JPG
And the “+Dir” for X axis will be connected to Arduino board pin 5.

 

Arduino Wire 010.JPG
 

 

Arduino Wire 011.JPG
Now let’s connect Y axis, “+Pul” will be connected to Arduino Pin3, and “+Dir” need to be connected to Pin6.

 

Arduino Wire 012.JPG
For Z Axis, connect “+Pul” to Pin4, and “+Dir” to Pin7.

 

Arduino Wire 013.JPG
All stepper sigal wires have been connected between the stepper drivers and Arduino Board.

 

Arduino Wire 014.JPG
Now we need to connect the stepper motors to the driver boards. Detailed information on our Shinano Stepper Motors can be found here: http://www.shinano.com/motors/stepper.html

 

Arduino Wire 015.JPG
First, we need to identify the two wires that belong to the same loop. A multimeter can be used here. If you have our Unipolar stepper motor(Shinano NEMA17), two center wires will not be used.(black & white)

 

Arduino Wire 016.JPG
The motors wires have been connected to stepper driver’s “A+”, “A-” and “B+” “B-“

 

Arduino Wire 017.JPG
Stepper Motors for all three axis have been connected to their driver boards.
Arduino Wire 018.JPG
If you already have installed the software (below), then you are ready to connect the Arduino board to the computer through USB cable.

 

 

Software Installation

ArduinoControl 001.jpg
 

ArduinoControl 001:
In This tutorial, we will be walking you through one way to control your CNC machine with an Arduino.
The first thing you will want to do is to navigate to http://arduino.cc in your web browser.

 

ArduinoControl 002.jpg
 

ArduinoControl 002:
Navigate or click on the download tab.

 

ArduinoControl 003.jpg
 

ArduinoControl 003:
Choose the proper download for your machine. Note- the software we will be using to send
G-Code to the arduino is currently only available in Windows.

 

ArduinoControl 004.jpg
 

ArduinoControl 004:
Click open.

 

ArduinoControl 005.jpg
 

ArduinoControl 005:
Choose where you would like to download the file.

 

ArduinoControl 006.jpg
 

ArduinoControl 006:
Wait for the download to complete.

 

ArduinoControl 007.jpg
 

ArduinoControl 007:
Once the download has completed, click open.

 

ArduinoControl 008.jpg
 

ArduinoControl 008:
The arduino software downloads as a zip file, so we will need to extract the files.

 

ArduinoControl 009.jpg
 

ArduinoControl 009:
Right click on the folder, and choose extract all.

 

ArduinoControl 010.jpg
 

ArduinoControl 010:
Choose the destination where you would like to extract the arduino
folder and click extract.

 

For more detail: Arduino Stepper Motor Control




This Post / Project can also be found using search terms:

  • arduino uno m542
  • m542 arduino
  • m542 stepper driver arduino projek
  • with lcd using arduino to conrtrol a stepper motor
Clip to Evernote

Leave a Comment

(Spamcheck Enabled)

Read previous post:
Arduino Thermostat with TC74 sensor
Arduino Thermostat with TC74 sensor

Hello all! This is a quick guide on how to use an Arduino© to control whether a cooling fan and...

Close
Scroll to top