Introduction: Parallel Port 3 Axis CNC Driver, Opto-Isolated, Unipolar Steppers

Picture of Parallel Port 3 Axis CNC Driver, Opto-Isolated, Unipolar Steppers

Controls 3 Unipolar Stepper Motors, for use with CNC Machines. Simple driver with automatic coil  shutdown, to ensure efficient operation.  Opto-isolated for protection of the P.C. Supports most parallel
port based CNC software, such as KCAM.

Supports up to 20 watts per Phase. Or 2 Amps per phase.

Full Kits with all the parts needed to recreate this Instructable can be purchased on my Website

Get a Full 3 Axis CNC Kit with Driver, Stepper Motors, Power Resistors, all the electronics and wire needed, excluding a PSU.

3 Axis CNC Driver KitAssembly and Testing can be added.

Printed Circuit Boards are Available with Free Shipping

and Programmed PIC Microcontrollers can be purchased

or Grab the a combined PCB & programmed PIC Microcontroller

Included in the ZIP below are the files for the Copper-side, the Top-Side layer, Datasheet and the drill files.

The source code is written in Assembly and can be purchased Here

Those who purchase Kits or programmed PIC will receive the source code for Free.

*UPDATE: Added the HEX files that use the PIC16F876A instead of the 16F870.

Disclaimer: Even though this is opto-isolated there still is a danger to your parallel port if a short were to occur. Recreate this project at your own Risk.

Step 1: Parts & Supplies

Picture of Parts & Supplies

Notice 6/21/12: Get A free 3-Month Instructables Membership Code with the purchase of a  CNC Kit with a driver, motors, wire, and resistors. Limited Codes Available. Find it Here

Layout all the Parts:
- PIC16f870 - DIP or a PIC16F876A(must use a different firmware)
- Printed Circuit Board or strip board
- 20 mhz series oscillator, a regular one could be subed, just need to add 2x 22pf caps to gnd
- 12x logic level MOSFETs TO-220 package, i chose IRL630A or RFP12N10L or FDP8878
- 12x 1kohm 1/4w resistors - Brown - Black - Red
- 8x 10k ohm 1/4w resistors - Brown - Black - Orange
- 6x 500 ohm 1/4 resistors
- 12x 1n4004 or better
- Right-Angle Male DB-25
- 1x 7805 Voltage Regulator
- 2x 10uF Capacitor
- 1x 1uF Capacitor
- 3x LTV-827 OptoCoupler or Equiv.
- 1x 28 pin DIP socket
- 1x 8 pin DIP Socket
- 1x 16 pin DIP socket

A Full kit with all the Components, PIC Micro, and PCB Can Be Purchased

or Get a CNC Machine Kit with Driver, Motors, Power Resistors and Wire, It can Be found Here

- 4x 4 Pin header
- 4x 4 pin housing
- 1x 2 pin header
- 1x 2 pin housing
- 18 crimps

Notes: Male and
Female DB-25 have different pin outs, and can not be substituted.

- Soldering Iron
- Volt Meter/Continuity Tester
- Needle Nose Pliers

Check Info

Additionally, a power supply will be required. To calculate power supply requirements: Motor Voltage/Motor Coil Resistance = amperage per coil. When full stepping each motor will have 2 coils/phases on at a time so minimum requirement is 6 * amp per coil. Then always use a power supply rated for %150 - %200 higher than the minimum. Switched mode PSUs will work, but will perform extremely bad compared to a capable linear power supply. Linear power supply's can be identified by a large transformer and capacitor probably along with some circuitry, they are more expensive but worth it if you want a nice machine.

Step 2: Resistors and Diodes

Picture of Resistors and Diodes

R1 - R12 are 1kohm 1/4w

R13 - R19 are 10kohm 1/4w

R20 - R25 are ~500 ohm 1/4w

TOG is a 10kohm 1/4w

D1 - D12 are 1n4004 or better

Place all the resistors and solder them in. Diagram Below
TOG is a 10kohm 1/4w resistor, mounted vertically.

Diodes D1 - D12 are next. Save the extra lead clippings for the jumpers.
These clamp the back EMF, protecting the PSU and logic.

Step 3: Jumpers, Oscillator and Sockets

Picture of Jumpers, Oscillator and Sockets

Jumper points A - P need to be jumped.
( there is no jumpers O, I forgot about it)

Points labeled 1 are jumped to points labeled 2.
A1 goes to A2
B1 goes to B2

Take a look at the diagrams below.

Take a lead clipping from the diodes (which is plenty thick)
Using a needle nose pliers bend the wire into a U shape large enough to bridge the gap.

When placing the jumpers ensure that you keep them away from any other holes or components.

Next Place the Oscillator in the XTAL, it goes in either way.
Make sure this gets a good shiny solder joint.

Sockets are Next

The 14 and 16 pin socket go in as pictured, line the notch on the socket up with the notch on the illustration.

Its not completely necessary but pin 6 on the 28-pin socket (RA4 on the PIC) (see image) should be removed, as there is a positive supply rail routed through it. And make sure to fill in its solder pad and hole with solder.

Then carefully line up all the pins into the holes and push down gently, watching to make sure no pins get flattened.

Step 4: Capacitors, Headers, DB-25

Picture of Capacitors, Headers, DB-25

C1 & C2 are 10uF Electrolytic

C3 is a 1uF Electrolytic

Capacitors first, these are polarized so they need to go in correctly.
The white stripe down one side of the capacitor is the negative pin.
In the top-side illustration the black half is the negative side.
*also shown in the image notes below.

Headers SV1 - SV5 are next.
If you are using locking headers consider what way you need the lock part facing.
Otherwise they can go in however.

SV1 is the Y axis motor
SV2 is the X axis motor
SV3 is the Z axis motor
SV4, pin 1&2 is Negative Supply
SV4, pin 3&4 is Positive Supply
SV5 is positive supply for the motors

The right angle, male, DB-25 port is last for this step.
*note: A female port will not work as the pinout is different. If you want to use a female port or a panel mount port, use some solid strand wire to run from the port to the PCB.

A right angle port can be kinda of tricky to get in, but get a thin piece of metal, a tweezers or nail, to pry and direct pins into their holes. Only pins 2-7 and 18-25 are used, so the other ones could be clipped off to make the placement easier.

Keep it flush with the PCB, nice and tight or later plugging and unplugging will damage on the connections. Then solder a few pins to keep it in place.

Flare out the mounting pins as pictured below, and solder.

Finish up the rest of the pins, remembering only pins 2-7 and 18-25 need to be soldered, the rest don't.

Step 5: MOSFETs and 7805

Picture of MOSFETs and 7805

Find the 7805, its in the same package as the MOSFETs but is labeled "7805"

Its place is labeled IC2 in the illustration. The metal tab lines up with the black part in the illustration.
Solder in securely, and make sure that the center pin has a really good solder joint.

Then starting from one end, place and solder the MOSFETs. See the top-side illustration and align the tabs on the MOSFETs with the black part in the illustration.

note: The tabs on the MOSFETs must not touch, as the tab is probably tied to the drain and it will not function correctly. There should be no need to heat sink the FETs.

Step 6: Plug in the ICs, Interconnects

Picture of Plug in the ICs, Interconnects

Opto-Coupler's are labeled LTV827

The 16-pin socket., labeled OPTO2, is shared by 2 8-pin opto-couplers.
The dots on the ICs go on the same end as the notch in the sockets.

The other 8-pin opto-coupler goes into the socket labeled OPTO

If you purchased a programmed and tested chip from my Store.
Carefully plug it into the socket, aligning the notch on the socket and the dot on the IC.

Otherwise, program a 16F870 with the HEX file in the .ZIP in step 1.
Check the readme for fuses or the image below.

Step 7: Auto Coil Shutdown

Picture of Auto Coil Shutdown

As discussed earlier RA5 is used to toggle the use of the automatic shutdown function.

By default, after a motor has stepped, a timer is started, and about 50 ms after all coils for that motor are shut off. And it will resume normal function the next time it is stepped.

If you do not want the motors to shut off, RA5 must be jumped to GND. See diagrams below.

Also the function can be easily turned off in software, if the source code is Purchased

Step 8: Motors and Power Supply

Picture of Motors and Power Supply

I am not going to cover motors here there is plenty of great info around on the net and here on Instructables.

Below(the image with blue background) is the the setup for the motors that are included in my Full CNC Kit with Motors, Power Resistors, Wire

All Axis' are have the same pinout, if a motor works on one it will function the same on the others.
A full step means 2 coils are on at once.

Example each bit represents Header 1 - 2 - 3 - 4
1100 - 0110 - 0011 - 1001

This driver does not have any on board resistors or chopping circuitry to regulate current for the motors.

I prefer to place high wattage resistors in line with each motor's V+. Hopefully you can find the datasheet for your motors and find out the required current and voltage for the motor. Then by using a web resistor calculator, you can find the correct ohm and wattage values for your motor.

Each motor needs its own resistor, otherwise it will force multiple motors to share current when multiple are on at the same time.

A 24 volt stepper motor will end up drawing a lot of wattage, be sure you have properly rated resistors to avoid damage.

Some Good Links on Current Limiting:

I have tested this driver with 5 different unipolar motors, they all worked great.

To calculate power supply requirements: Motor Voltage/Motor Coil Resistance = amperage per coil. When full stepping each motor will have 2 coils/phases on at a time so minimum requirement is 6 * amp per coil. Then always use a power supply rated for %150 - %200 higher than the minimum. Switched mode PSUs will work, but will perform extremely bad compared to a capable linear power supply. Linear power supply's can be identified by a large transformer and capacitor probably along with some circuitry, they are more expensive but worth it if you want a nice machine.

Step 9: Limit Switches

While the driver does not use any external inputs from limit switches, they are easy to add without any more components other than the switch.

Take a Look at This PDF, page 6 shows schematics for both active low and active high method. 

The switch connections can be soldered from the bottom of the PCB to its input pin on the DB-25.

Step 10: Interconncts and Crimps

Picture of Interconncts and Crimps

If you are using headers and housings to attach your motors to your driver board. You'll have to select some suitable wire and attach crimps to the ends.

After you've selected and cut your wire attach a crimp to the ends. The crimps then slide into the housings, which attach neatly to the locking headers on the PCB.

Follow my Tutorial for more Info

Step 11: Software & BIOS Setup

Picture of Software & BIOS Setup

This driver has been tested and works great with KCam. But most CNC programs (Mach3) work in a similar way and should also work fine.

Parallel Port is set up as follows, pins referenced are on the DB-25 port.

X Step - Pin 4
X Direction - Pin 5
Y Step - Pin 6
Y Direction - Pin 7
Z Step - Pin 2
Z Direction - Pin 3

Ensure in the BIOS that the parallel port is enabled, address set ( 0x378 is default ), and mode set to EPP or EPP/ECP

A short Tutorial on Setting the Home Point and Eagle CAM Processor Info and more KCAM setup info.

Step 12: Enjoy

Picture of Enjoy

This driver was designed for a CNC Machine but it could be used in anything that requires a PC to control 3 unipolar stepper motors.

*UPDATE: New CNC Machine I have built utilizing this Driver.

*UPDATE: Unplugging the PSU from the Driver while the motors are on may cause the PIC to become damaged.

Please ask questions, PM's are best.

Thanks for reading.

If you found this information useful please support current and future projects by shopping at my Store or Donating

Please check out My Profile to view my other projects.


MohamedR90 (author)2016-07-11

Hi Thx for this instructable

have a question. Is pin 18-25 joined by weld cuz in diagram pin 25 is not joined

with 18-24

MohamedR90 (author)MohamedR902017-05-26

Sorry for that question . i should do what in schematic

AndersunO (author)2016-12-19


ShahzaibS7 (author)2016-08-09

Can it do Milling of PCB's???

oasards. (author)2016-07-03

hello , y make it this driver board with pic 16f876a , y put it the code on pic and

with kcam work just in one sens even i change direction, where is the problem?

in hex?

sanjaya456 (author)2016-03-26

sir i have made your cnc driver and it works fine with it support to mach3 ? i tried but didn't success. i used 6v 5amp power motors are 6volts so is it needs to connect power resistors? thank you for helping me.

farmandf made it! (author)2015-07-08


sanjaya456 (author)farmandf2016-02-21

how did you burn hex to pic ??

You will need a PIC programmer, such as PICKIT or any of the numerous others. It is the only way to burn a HEX onto a new PIC.

thank you very much for your quick reply.

sanjaya456 (author)2016-02-21

sir i already built this circuit using pic16f870. how can i burn hex files to pic ? is it possible to burn hex to pic through this circuit.waiting for an answer...

farmandf (author)2015-10-16

!داداشای گلم همین عکسی که گذاشتم پی سی بیه دیگه

09193453996 (author)farmandf2015-10-23

اقا فرزین میتونی این برد رو برای من بسازی هزینه و دست مزدش هم به رو چشمام تقدیم میکنم

farmandf (author)091934539962015-10-29

بله عزیز با ایمیلم در تماس باشید

farmandf (author)2015-10-15

سلام عزیز نقشش همینه که بالا هست دیگه

09193453996 (author)farmandf2015-10-16

سلام اقا فرزاد اگه شماتیک و pcb print رو دارید برای منم تو تلگرام بفرستید ممنون

mamadeeshadi (author)2015-09-27

فرزین جان سلام
اگه ممکنه نقشه ی ساخت کنترلری ک ساختی رو توی نت آپ کن و لینکشو واسم بفرست.
کارم لنگه ممنون میشم کمکم کنی.

farmandf (author)2015-07-05


please put setting for mach3

Thank you very much for awesome your driver this work excellent

andycuba (author)2015-06-23

farmandf (author)2015-06-13


farmandf (author)2015-06-09

Hello I am build this board it work with 'kcam' very good but not work by mach3 please help me...sos... kind regard.

Mr.Farzin from iran

ŽygimantasM (author)2015-05-04

Hello I am trying to build this project and I want to save money as much as I could and I have a lot of salvaged mosfets bo none of your list. So I want to ask what mosfets can I use what the main properties should be ? Can I use different ones from what you have suggested?

Bowtie41 (author)2014-12-23

All kits are gone and will not be restocked.

Well that sucks!!?!

abdelmajidask (author)2014-12-14

Nice board plz did u make a hex for half & micro steep it will be great if u did ? we really likes your i work.& i need it so can you tell us where to find it i m newbie on programing pic

simo.wenseslavo (author)2014-08-18

hola saludos desde venezuela, he conseguido uno de estas tarjetas, quisiera saber si es posible conectar 2 motores a una sola salida en esta tarjeta para en mi caso manejar un solo eje,(eje x) en una cnc fresadora que estoy construyendo, mucha gracias

Hello greetings from Venezuela, I've got one of these cards, I wonder if you can connect 2 motors to a single output this card in my case drive a single axis (x axis) in cnc milling machine that I'm building, many thanks

senanayeka (author)2014-08-09

Ohoo nice CNC

ability control the Corel DRAW software?

my email :-

conchomania (author)2014-04-03

hola soy de venezuela esta tarjeta sirve para motor bipolar?

hi am from Venezuela this driver is for bipolar steppers?

thelife91 (author)2013-07-12

i have a step motor.1.8˚/step and input < 5VDC.
my ATX power produce both +5V for step motor driver and +12V for stepper motor, but , now , i don't have any step motor 12 V
please help me to use my step motor ! ( power supply , ? ohm and wwat resistors )

quangphuc91 (author)2013-07-12

Thank you for your answer !, I had 2 pair PC817A to get LTV-827 :D, i hope it work

quangphuc91 (author)2013-07-10

i don't found any OPTO LTV-827 in my city, can i replace another one , please !

Check the datasheet for LTV-827, it has a functional diagram image, compare it to other types of dual Optocouplers. They must have the same pinout and similar electrical characteristics.

TzarIgor (author)2013-01-25

Great idea and its realization!
I suggest to use an old ATX power supply. It would work perfect because it produce both +5V for processor and +12V for stepper motor and you dont need to bye external power supply!

markitosb (author)2013-01-14

Thank you for your answer then proves the mosfet IRFZ44

markitosb (author)2013-01-14

hello I have such a good project and the best that is affordable but I have a small query if I could not use mosfet IRFZ44 N-type is here in Peru is difficult to find the model that is listed with repect to hexa code works with the one in the instructables page or just a demo grasias por time

I checked the datasheet and it seems they will work, though they are not specified as Logic Level. I also found: which seems to confirm they will work. Good Luck,

GJ.Hoogeveen (author)2012-12-06

Can someone make a CNC driver schematic and PCB design for 4 axis?
I want to make a CNC foam cutter.

saad_3122000 (author)2012-10-08


Tutorial Master (author)2012-09-12

can you mail me a PCB :D

tgferreira184 (author)2012-04-17

does it hold 24v?

tgferreira184 (author)2012-04-17

does it hold 24v?

treflip (author)2011-08-18

Have you had any problems with this running all three axis at the same time? I can run x and y but if I try to run z (it's usually generated in the gcode file with all three on one line) with them it won't work.

reco3141 (author)2011-05-03


Binnukuttan (author)2011-01-18

How can i modify the driver board to 3A PER phase version?

bikersambo (author)Binnukuttan2011-01-24

Uprate the Mosfets And feedback/cutoff diodes to a higher wattage... Hope that helps

alexis_4315 (author)2010-12-01

why the source code are not open? it is just a common program...

funlw65 (author)alexis_43152010-12-26

Hi Alexis,

It is not just a common program because have a rare feature:
- it produces $2 per unit.

Oldrunk (author)2010-12-16

Just put together the kit now testing and I can confirm that this 3axis CNC Driver works with linux EMC2.

Renietsnurb (author)2010-12-04

I'm planning to buy one of your drivers. Assuming that i have three 24V, 140 Ohm, 160 mA motors what resistors do i need. And beside these what else do i need to drive my motors?

Oldrunk (author)2010-11-16

Awesome work and thank you, I've been wanting for a long time to put together a small hobby CNC for some time and never got to the controller since there are many designs out there. Just bought a kit from your site and thank you again for supporting the hobbyists! And thank you for the instructable.
Just a couple of questions. Since the source comes with a full kit , just wondering if its possible to add limit switches to your design?
Other question is I bought a full kit with the steppers and I know I need a 12v PSU but what power rating do I need? If I'm doing my math right even a 200watt PSU should more then handle it.

For limit switches I use the active low method, Shown Here. Just attach a wire from the proper pin on the DB-25(Parallel Port) from the bottom side of the PCB, and run it to your switch.

For PSUs, calculate its Voltage / Phase Resistance,  the kit includes 12v @ 60 ohms = 200ma, since the motors full step, there is always 2 phases on per motor, with possible of all 3 motors on at the same time = 200ma x 6 = 1.2A. Then always use at least 150% of calculated current so about 1.8A @ 12v.

About This Instructable




Bio: Designing electronic creations from microcontrollers, LEDs and anything else I can pull out of a dumpster and make use of. Check my Profile
More by ChromationSystems:Basic Roller Straightener For Light Gauge MetalMake a Rug With Carpet Remnants And Duct TapeAcrylic Bender From Laser Printer With Relay Timer Box
Add instructable to: