Introduction: Easy to Build CNC Mill Stepper Motor and Driver Circuits

Picture of Easy to Build CNC Mill Stepper Motor and Driver Circuits

This is a follow up to the Easy to Build Desk Top 3 Axis CNC Milling Machine Once you get the machine all put together its time to make it go.

So it's time to drive the motors. And here I've put together a circuit that I think is the absolute cheapest and easiest way to control stepper motors with step and direction signals. It works with many of the free or low cost softwares that produce step and direction signals through the parallel printer port. I'll explain how it works but for those of you who just want to get on with it... The_Next_Step

But I would suggest for those of you who are unfamiliar with circuits to do it on a bread board (see pictures). This way you can easly correct any mistakes and try different things.

This schematic is just to control one motor so for the milling machine you need 3 of these circuits and 3 motors.
From Left to right and top to bottom. I try to draw schematics so that positive voltages are toward the top and ground or negative volge is toward the bottom. Inputs are to the left and outputs to the right. Fist off the voltage that you are going to use to run the motor needs to be stepped down and regulated for the logic chips. I used a 6.2 volt Zener to do this because it's low enought for the logic chips to receive the signals from your printer port and high enough for the outputs to drive many of the standard power FETs, so you may not have to use logic FETs like the schematic shows. So the resistor R1 drops the voltage, the Zener diode regulates it to 6.2 volts and the capacitor C1 filters out any noise from the motor, and this voltage powers the two IC's.
The first IC (CD4516) is called an up/down counter. One signal from the printer port will tell the counter if it will count up or down and the other signal, called step, will increment or decrement the counter by one count. Now were only going to use two outputs from the counter Q1 and Q2. With this binary counting method there are only 4 combinations of output from the counter: 00, 01, 10, and 11. These lines are fed to the A and B inputs of the other IC (CD4028) which decodes these combinations to 4 seprate outputs.
I did a trick here using the C input to work as an Enable input. If the Enable(optional) is connected to the parallel port and the computor tells it to shut off all of the outputs to the FETs will go low(Off). So the four outputs of the decoder drive the FET transistors and the FETs drive the four poles of the motor.
Now everybody wants to know what the light bulb is for. Its not so much whether you use a bulb or a resistor, its that a bulb comes with a socket. You can get these wedge base light bulbs from 1 watt to 20 watts. Start with may be a 4 watt bulb and if you find you need a little more beef you just pull it out and put in a 10 watt bulb. It's really handy. And I found it's good to have some voltage drop there as kind of a ballast for the motor windings. The diodes catch some of the current that comes out of the motor each time the FET transistors turn off. The diode feeds this current back to the supply.
When you get the circuit up and running find a power supply that puts out more voltage than you really need and then change out light bulbs till you get it running smoothly. Some of my stepper motors are 5 or 6 volt and some are 12 volt but it all works out.

Step 1: The Circuit Board of Appeals

Picture of The Circuit Board of Appeals

OK here's what your all looking for. I made a simple PC board layout that includes 3 motor driver circuits connected to a 25 pin D sub Parallel printer port connector. Here's a picture of the layout. At the top of the picture you see a place for a voltage regulator. You can use that or you can put a resistor and Zener Diode in its place(like the schematic shows). On the right edge is a place for the 25 pin D-sub connector that connects to the parallel printer port. You just jam the PC board between the two rows of pins and solder it.
On the left side are places for the lamp sockets. You need to look over the schematic to see where some of the parts go but it's all there.

Step 2: Circuit Cloning

Picture of Circuit Cloning

If you have a time machine you can go to the future and ask yourself to make the circuit board with the finished machine and then bring it back and finish building the machine. After a couple of tries I got the board to come out pretty good. The machine routes what are called isolation paths which means it seperates the copper that is associated with a conductive path from all the other copper around it. This leaves some areas of the board that are not associated with a path still covered with copper. You could leave this extra copper on there but when your soldering it is easy to get solder bridges across the isolation paths and short circuit something. So I take the soldering iron and touch it on the excess copper and peal it up off the board. It makes the board more like what you would get if you chemical etched it or bought it from a board house(see below).

Any way look over the schematic and place the parts accordingly. I added a few capacitors along the power lines just for general principals. There were so few traces on the top side of the board I didn't bother milling it. I just used jumper wires. See the pictures below of the populated board. All the little FETs ligned up like marching soldiers.

Step 3: Photo Etching a Driver Board

Picture of Photo Etching a Driver Board

OK, For all you chemistry majors who want to do something a little more professional here are some .pdf files you can print out and iron on or what ever you do to make an etched PC board. There's a Top Silk (just for reference), Top Copper, and Bottom Copper.

If you want to go easy Just do the Bottom Copper. There's not that much on the top and you can just solder jumpers where you need to.

Step 4: TESTING..1..2..3

Picture of TESTING..1..2..3

Don't be nervus. It's just a little electricity. First off it would be good to load up the KCAM (or what ever you plan on using) in your computor. Then when you feel comfortable that all the parts are in the right place plug the parallel port connector into the driver board(as shown below) and put a low wattage build in the socket for the motor. In this case I'm using middle, the Y axis driver.

For power I like to use one if these universal power adapters with selectable voltage output. They're cheap and they don't put out a lot of current so if something goes wrong it's less likely to damage your circuit. Set the voltage low and see if you have some vlotage on the power pins(16) of the CD4516 and the CD4028. If you don't have a volt meter just take an LED and tie a 10K(BRN,BLK,ORN) resistor to the positive(the long leg) and wire to ground tied to the negative(the short leg). Now you can use this as a probe to see where you have voltage. It will be very dim but we don't want to draw too much current away from the circuit.

Now go into the computer program and find the Setup Table. Set the steps per inch to 1000. Then open the CNC control and set the single step for .001 inch and activate the single step mode. Now each time you click the yellow arrows (up and down for the Y axis) the computor will output one pulse to the stepper motor driver circuit.

Put your LED probe on pin 10 of the CD4516. This is the up down input. When you click the up arrow the input will be low(LED off) and when you click the down arrow the input will be high(LED on). Pin 15 is the step input you will see a very short blink each time you click a n up or down arrow on this pin. Pin 6 is the Q1 output. It will change state(high/low) each time you click an arrow. And Pin 11 is the Q2 output. It will change state every other time you click an arrow.

On the output side of things we should see some activity on the CD4028 chip. Putting your probe on any of the output pins 1,4,6,or 7. These outputs drive the FETs. You should see the output go high every 4th time you click the up or down arrow.

If this all makes sense so far it's time to get the motor running. The common wire or wires of the motor which are the center tap of the windings should be connected to the light bulb. The other four wires should go to the four FETs on the circuit. If you are really lucky you will get the combination just right in the first couple of trys. Other wise just keep switching the wires arround until the motor steps in the same direction each time you click the arrows.

Watch the video in the next step. It may give you a better idea what to do.

Step 5: Let's Watch It on TV

I just like watching a video better than doing a bunch of reading. Hope this is helpfull. Good luck with your projects. If the movie doesn't show past this link into your browser.

Step 6: Linux Users

Picture of Linux Users

I'm not a Linux user yet but I have played with it enough to be dangerous. But for you Linux users Chaddcurtis has contributed some setup files and information to help you use Linux CNC with the parallel port and this circuit board layout. Thanks a lot Chad and more power to you.


dhanushkanit (author)2017-08-21

please help to solve our problem, this PCB is not workig 4028 output not give as testing vedio, 4516 input is ok out puts is ok (clock signal come to pin 15)

dhanushkanit (author)2017-08-21

hi,we made your PCB as you did, but unfortunately driver motors not working properly, 4028 IC out puts are not came like your testing vedio , Pin 1 output showed, one click (IN A KCAM ) LED light blink twoie, why was the problem ?

Pader (author)2017-05-29

I have been theorising on building a numerical position display on my CNC machine using an up/down counter. Could you enlighten me as to whether the DIR+ and DIR- signals to the stepper drivers are at the same potential or is one signal the absence of a 'high' level?

HieuB5 (author)2017-04-04

please teach to me how i can connect sensor wire limit axis circuit above i don't know connect to where?

sanjaysy (author)2013-05-06

I built using PDF files from your instructable. it looks like +ve & -ve terminals have been connected using 1K resister, where are circuit says +ve & +ve terminals are connected with Zener & capacitor in parallel with 1K series resister. do i looking at the right bottom.pdf. i'm a mechanical engineer & limited knowledge of electronics, your help will be highly appreciated.

Attached a sketch with markups.

Thanks in advance.


Jimw1 (author)sanjaysy2017-01-15

I know this is an old post, but Could/Would some one please correct ALL incorrect drawings of this PCB - and remove the short circuiting trace. Thank you

dirver (author)sanjaysy2013-05-16


You mixed up the R1 (1K resistor) with C6 (capacitor 220uF).

i can't find any bc4516 ic in my county.. is there any other ic i can use as a replace of it?

it's CD4516 not bc4516 may be this the problem why you can't find them as it's a very popular IC

DimitriD13 (author)2016-08-28

hi everyone . sorry for my bad english . i want to build driver using l297 and uln2003 chips so can somebody to give me full circuit schematic for 4 axis cnc machine ? i am using mach 3 and 5 volt unipolar stepper motors

fhmazm (author)2016-06-01

thanks for your nice post

MatijaZ4 (author)2015-11-30

Hi, please advise... is your cnc mill stepper motor of any equivalent to this one

moseba (author)2015-11-21

I made one axis driver and one stepper motor and test it on a test board ... and it worked like charm. " i didn't use the light bulbs"

I will build the 3-axis board with three stepper motors soon and i will post images after testing it. " i will build a new layout"

Thanks Tom for sharing this experience.

moseba (author)moseba2015-11-22

Note: 1. make the Enable pin in port setup in KCAM to True inverted

2. pins numbers in the schematic is not like the connection to the D-sub 25 Connector, Beware....

mamadeeshadi (author)2015-10-02

good job

mahdancnc (author)2015-09-08

ChristianB18 (author)2015-08-08

I/m linking

dollarseed (author)2015-06-25

I've cheated a bit in making my CNC Engraver. I used the Arduino UNO with a CNC Shield and run everything with a free program called EFL CNC. That part of the work was super easy to complete. The machine on the other hand, built slightly different from yours, has been a 5 month project getting everything to work perfect. Mainly, it had to be pretty :) The design difference is due to the use difference. This will be engraving glass inside a water bath tank., which can't be allowed to slosh back and forth with the movements.

carben.dallas (author)2015-06-22

Hi, I'm using L298n instead of MOSFETS. The stepper seems to react but doesn't move, it's just growling. Is it because of L298n?

HoytKelley (author)2015-06-13

I've got something I'm working on and need 10 or more accessible drives.

Can this be paralleled to incorporate more axis?

Also if it is possible ... am I going to need a special program for an application like that?

Thank you

zurek22 (author)2015-05-18

Is this motor compatible with this driver???

John Webb (author)2015-04-20

I am almost done with this project, a few things on the way from farnell/element14, looking good so far, and with a little hard work and care I have added a few professional touches, such as solder mask, though I handled it a bit too much after it cured (Used a spray paint version). Some components aren't soldered in as I am not sure about their values, the resistors for example. Can anyone provide a complete list of the parts? as the list Tom has provided doesn't seem to match, is a few parts short and it seems he is rather busy. I did look at the schematic ofcourse, however seems like a different revision. Thanks Tom for this valuable instructable, when it's made I'll test it and mark this as "I made it!".

AnthonyL5 (author)2014-12-24


If you are trying to use a simple parallel port to USB adapter it will not work. Parallel ports were not designed to provide power while USBs do. This means that the stepper motor will always receive a signal even when it shouldn't be. If your pins recieve power ONLY when connected to the computer, this is the problem.

AminA1 (author)2014-11-25

i made it and not workiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiing

cutdact (author)2014-10-11

Hi! I'm making this driver for my CNC, but when i step in KCAM the motor vibrates back and forth and then stops, any idea what the problem is?



mahmoud asem (author)2012-03-24

please guys what are the values of c3-c6 i just need that to finish :)

woodspinner (author)mahmoud asem2012-03-29


mahmoud asem (author)woodspinner2012-04-04

and how about c6 is it imortant ?

maikeru86 (author)mahmoud asem2014-05-12

Sorry to bring up an old thread but I have the same question. did you manage to get and answer?

mahmoud asem (author)woodspinner2014-03-05

thanks buddy and sorry for being late :)

mahmoud asem (author)woodspinner2012-04-04

thank you buddy i will finish it and post some pics :)

aozgen90 (author)2014-05-02

if i was to make changes to the design where it connects to the stepper can i make this circuit able to drive a 4 wire bipolar stepper motor

aozgen90 (author)2014-05-02

if i was to make changes to the design where it connects to the stepper can i make this circuit able to drive a 4 wire bipolar stepper motor

asad1111 (author)2014-04-12

I also have similar problem as "descartable" has. Any solution?

Thanks in advance.

descartable (author)2014-04-04

Hi , I just finished building a single motor drive but I have a problem, when I plug in the 12V the motor start moving erratically back and forward, vibrate a lot and that disappear when I disconnect the enable pin of the CD 4028, control via parallel port isn't working fine either.I build it using a perforated board,I check all the connections and are as per the diagram.Any suggestions???Thanks

Hasersys (author)2013-10-12

So I am having a hard time. My motor will hardly step once, and back once. The motor heats up pretty hot. I have the pm55l-048 motor to test with. runnning 16v. any suggestions?

bhadresh (author)Hasersys2014-03-05

Yes, Motor gets too hot. I've the same motor pm55l-048 and running on 12 V with driver IC UCN5804B, tested on Kcam.

I think it might be be too small for load (800ma). Have you solved your problem ? I'm planning for bigger motors.

jatinbatra (author)2013-12-20

Hi, After making the circuit (I'll be breadboarding it ) can I expect it to run with Arduino.Rather how I can make it run for an uno. I'm trying to do this for a 3d printer ?

Is it for unipolar (AS IT SEEMS TO BE CENTRE-TAPPED )? How can i make it run for a bipolar stepper ?

dirver (author)jatinbatra2013-12-20

Hi, I'm not a motorspecialist so I cannot give you an answer on that. Perhaps other users ?
With Arduino UNO you could better use Polulu-drivers.

jatinbatra (author)dirver2013-12-20

Thanks dirver for replying :)
Can you just let me know some details that how it is programmed , do you use a micro controller to run the three steppers or do you program it with some software.?
I'm just curious how I will program it for the 3d printer.Thanks : and sorry for trouble

mahmoud asem (author)jatinbatra2014-03-04

hi jatin

I have tried to drive this controller through arduino uno and it works !

you should use something called grbl you will upload a sketch to your arduino and connect your wires (step and direction) for each motor and run it with a software compatible with grbl I used grbl controller .

and when I used the enable pin It didn't work

so good luck and let me know what you achieve :)

use the following link to download the library and put it in it's directory the open examples in arduino software >GRBL>GRBLtoArduino then upload it

some guides :

dirver (author)jatinbatra2013-12-20

Hi Jatinbatra,
For my cnc-router I use Mach 3, but I'm designing a 3D printer and then I use this Arduino-unit (including temperature controller, stepperdrivers, ....).
If you make a 3D printer with the driver here described, you will still need 2x temperature controller and the 4th stepperdriver.
I first wanted to change my router for also 3D-printing but the 3th axis would not go high enough so I decited to make a 3D printer from scratch.

jatinbatra (author)dirver2013-12-20

Actually I'm only a novice and I don't know how to layout PCB, so it is pretty much cumbersome work to connect a sub25 connector .
What i'M doing is that I'm making everything on a generic (protoboard or breadboard ) kinda thing , so I wanted to know can you help me figuring out what should I do ?

dirver (author)jatinbatra2013-12-21

Hi Jatinbatra,
Depends on what you mean with "figuring out".
Do you want to make Tom's pcb or are you making a new design ?

jatinbatra (author)dirver2013-12-22

i just simply want to make the driver to run the steppers with computer control i.e the torque, speed (micro-steping) and direction via a pc for 3 motors.It doesn't matter to me whether it be CNC or 3D printer, All I want to do is run the motors .
I'm bit unaware about programming part ,.

dirver (author)jatinbatra2013-12-22

The programming can be done with Mach3.
Look at the picture of Tom for this.
Have you already bought the components ?

jatinbatra (author)dirver2013-12-26

No , I haven't bought the components but i have stepper motors which are all 4 wired , can't I use this circuit with four wires ?

dirver (author)jatinbatra2013-12-27

No, I don't think this pcb will work with less than 5-wires.
I only use this pcb with 5-wire-motors.
For 4-wire-motors I use the china-driver-boards (3x motor for my router).
Regards and Merry Christmas,


jatinbatra (author)dirver2013-12-27

Ho,ho,ho , Happy Holidays Dirk.You are really a very helpful person :)

I have four wire steppers and Tom has a six wire motor , of which two wires are connected to the bulb (which is actually for testing the circuit the circuit ) so I think if I skip these two wires , then I think I can do that right.Please fell free to correct me.

lxsedov (author)2014-02-02

I'd like to know how to choose resistors or light bulbs? I have built this circuit and tried different bulbs/resistors, but could not understand how to make my motors run at full power

About This Instructable




More by Tom McGuire:Easy to build CNC Mill Stepper Motor and Driver circuitsEasy to Build Desk Top 3 Axis CNC Milling Machine
Add instructable to: