Thursday, April 28, 2011

Z-axis homing & opto-isolation board

It is always uncomfortable bringing logic-level signals outside of the "box" and into the real world.  Any excess voltage can wipe-out your stepper controller board - and since the inputs are fairly high impedance, these lines are very susceptible to induced noise - especially from the nasty spikes caused during the driving of the stepper motors.
I designed a 5-channel opto-isolator board to keep the ugly outside world away from my HobbyCNC controller board.  I designed the board to run from around 12 volts, but I added a constant-current source to each input line.  This ensures 20ma flowing through the opto isolator LED.  The added benefit is I can add extra LED's to the 'chain' without affecting the signal and I can safely run the limit switch wiring through the same wiring harness as the stepper motor cables with no fear of interference.
I added a yellow LED on the board for each of the 5 inputs - this allows me to verify an input is working without needing to grab a voltmeter.  The constant current source also allows me to put another LED out where the work is done.
To complete the board is a green power LED and a fuse.  In the images, the opto chips are actually surface-mounted on the underside of the board - the one lit yellow LED is for the limit switches - this tells me all 6 limit switches are closed (good).

I created a special rig to set the z-axis home.  It uses an alligator clip and a precision brass 1/2" square bar.  I added an LED in the bar so I can confirm all is good before I press "home".  Any problem with this setup and the system will drive the tool into the workpiece - a real big issue if using small drills for PCBs.  The short video shows the Z axis home setup being tested to confirm continuity, then the video shows the opto board during the same test.


  1. nice work. Do you have home switches in each end of axis?How your paralel port does look ? How many free pins do you left?

  2. I have limit switches (not home switches) at the end of all 3 axis - these are far more important than I originally thought. Currently, I only use the software to home the z axis. I am noodling on a way to home all 3 axis'. It is super-sweet to hit "home" and the system does all the work. There are 5 input pins on the HobbyCNC board, so far I am using 2 - one for limit switches (all wired in series) and one for the z-home jig.

  3. And how did you configure it in emc?

  4. I posted the details here: