• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PC Parallel port opto isolation board

Not open for further replies.


New Member
I am on with the conversion of an old Denford CNC milling machine from the 1980's electronics to be controlled by Mach3 from a PC.
Whilst all circuit boards can nowadays be bought off ebay to learn more about electronics I have decided to design ;) and build them myself. I have already done boards for step & direction of the axis and a board with 5-off relays to control stuff like coolant, spindle motor run, spindle direction etc.
I am now building a circuit board for homing datums, overtravels, and spindle speed monitoring with optoisolation to protect the PC.
It will have seperate X, Y, Z homing inputs but a single overtravel input daisy-chained around the 6-off mechanical switches.
See attached drawing of planned circuit.
CN1 = 24v taken from 250mA supply off one of my drive cards.
CN6 = 5v taken from PC parallel port
CN8 = loop to X++, X--, Y++, Y--, Z++, Z-- overtravels
CN2, CN3, & CN4 = X, Y, & Z home switches which are 2 wire type Baluff proximity switches
CN5 = Spindle speed monitor which is also 2 wire Baluff proximity switch
CN7 = Inputs to Mach3 via parallel port
Circuits for X, Y, & Z home, and spindle speed are copied from original Denford drawings but modified to accept my 24v supply.

PC on, Mach3 running, parallel port cable connected, input ports assigned, 5V supply to CN6 present, 24v supply to CN1 present.
Mach3 set to display 'diagnostics' screen. Test circuit built on breadboard.
I have tested the circuit on a simulator progam and everything seems to works fine!

When only the overtravel loop is connected, the osilloscope shows a very clean switching of input pin on CN7 (pin1) from 0v when in safe working area, and a good 5V when Overtravel switch is thrown.
When only Z home is connected, osilloscope shows switching of input on CN7 (pin2) from 0v whilst in 'working area' and a good 5v when the Proximity switch is triggered when homed.
When I connect both Z home and Overtravels (haven't built breadboard with Y & X homes yet), and monitor on 2 channels of oscilloscope, both traces show 0v whilst in the safe working area, but when I move the Z axis towards home I only get 1v when the proximity switch is triggered until I continue moving the Z axis to trigger the Overtravel at which point both traces hit 5v. Obviously 1v isn't enough to trigger an input to Mach3, so what have I done wrong or need to do to fix it?
As I have plenty room on my standard 100mm x 160mm blank circuit boards i'd prefer to keep all these functions on the same board.
I would also prefer not to use another 5v ouput if that is the problem as I am running out of pins and I plan a 4th axis in future.
I could duplicate inputs and use the Overtravels as homes but that's admitting defeat and I ain't doing that, besides I am trying to learn and understand more.

Your guidance would be appreciated.

Thanks ...Achillies



New Member
Sorry for bumping this post but come on guys & girls, someone must be able to comment on my problem.



Well-Known Member
Hi Achillies,
Although I can't help with your circuit what I have done on my home made cnc is on limit switch's use rocker switch's that will close to ground and be open circuit when not engaged. Using this method doesn't use any power when the limit isn't engaged and for stepper drivers I'm currently using single step drivers from Oatley Electronics
which have proved purfect in testing and calibration. I do intend to build a microstepping board and fool my uni polar steppers into bi polar using PICStep | fromorbit.com
Now as I reckon it would be good do a circuit for motor on, etc a low level 16f pic can monitor all the inputs and send a pulse to the parallel port input when required.

As far as Mach3 is concerned I did try it but after it crashed everytime after about 5 minutes I went for Kcam for testing. I'm now on learning EMC2 and I do need a better computer to run the cnc.

Anyway you haven't stated whether your cnc is run from steppers or servo's if it's run from servo's then this post was a waste........

Regards Bryan


New Member
Hi Brian. I appreciate that you took the time to pen a reply.
I think i've sussed the problem. By only putting 470ohm resistors on the 5v supply from the PC i was creating the possibility of just one input to draw a whole 10mA which wasn't allowing anything for the other inputs, when needed, and making the other inputs unstable, hence why they would all work together but not individually.
Thanks for your comments.

Not open for further replies.

Latest threads

EE World Online Articles