Alternatives to Limit Switches

So, I have been trying to think up new ideas for means of detecting when the axes have approached the extent of their range. One attractive quality of an alternative to the existing switches is a non-mechanical solution, such as an infrared proximity sensor.

Similarly, using a simple photoresistor and LED could work as well, provided that you place a tiny black tube around the photoresistor to shield it from stray light as much as possible. They would then be fixed at the extent of each axis. It’s also rather simple to add a resistor and transistor to each photoresistor adjust the sensitivity of the photoresistor so that it only ‘triggers’ when the LED (which would be mounted on the moving part where the limit switches go) is practically touching it.

Has anybody tried using something like this yet?

There are a few users here that have installed proximity switches as home/limit switches. As far as I know, these are inductive or capacitive sensors, not optical.
There are lots of optical limit switches designed for 3d printers which should work well with an Ardunino.

1 Like

Optical switches are vulnerable to false triggering by dust.

Perhaps you meant to say “Alternatives to mechanical limit switches”?

1 Like

Well, admittedly, “Alternatives to The Mechanical Switches” would have been clearer. It would take quite a thick cloud of dust to trigger an optical switch of the interruptive variety. Not to mention the fact that in the case of my machine there is a zero-stray-dust policy enforced by an extensive collection mechanism. Thanks for your contribution though :wink: EDIT If dust were to accumulate on the sensor that would definitely be an issue, and just the problems arising from dust in the function of the machine is what prompted my dust collection solution.

Why replace something as simple, cheap and reliable as a mechanical switch with something more complicated and expensive?

Could use a small “prox switch” most work between 9vdc to 32vdc…

1 Like

I fear the stray rapids that would leave them resting in pieces.

How about a non contacting Magnetically Actuated Switch?

1 Like

hi CharesVanNoland… I work @ the USPS as an ET and all of fast moving equipment uses them or photo eyes

1 Like

Why whould changing the type of switch change this? Even worse: an optical, inductive or capacitive switch is more expensive and easier to damage.

There are 2 ways to prevent damaged switches:

If your machine gets to the point where a limit switch will activate you are already deep into “Oh, Sh*t” territory and saving a $0.50 switch is probably not the primary goal.

Although, for the perfectionists in our group (maybe me sometimes), a swtich which can be located out of the line of fire could be attractive.

1 Like

There’s a third way - Don’t go there in the first place. Soft limits are your friend. :smiley:

Something that doesn’t require contact can be positioned to detect from the side, not directly in the path of. I suppose even the existing switches could be as well.

These are $0.60, that’s hardly expensive:

Since the unit runs on arduino you could use Hall Effect sensors. Hall Effect sensors use magnets and the great thing about them is you can set how sensitive they are, That way you “shouldn’t” have issues with them triggering falsely. Just go into the code and replace the line of code for the limit switches with the few lines of code for the Hall Effect switches. There are plenty of examples online to show how to do this.


I just discovered them while googling limit sensors! I think I might investigate further what it would take to get them going. The reason I want limit switches is more to serve for zeroing the machine for homing purposes. Personally, I could go without limit switches entirely but it seems like it would be more convenient if I could use the homing functionality of GRBL, and would prefer to do so without mechanical switches. This is purely a personal preferential issue, not a black-and-white cost/benefit analysis conclusion, similar to how I have blue zip ties and cable shielding on my machine :wink:

  • If you have step losses soft limits will not help.
  • And a machinist not being aware that his CNC program exceeds the machines travel and workpiece size is… well… a shitty machinist :wink:

(I totally agree with you that avoiding collisions is the best strategy.)

However I don’t see too much need for limit switches on machines like the X-Carve or Shapeoko anyways - there is little risk to damage the machine if it just hits the end stops occasionally (and you should never ever leave a machine running unattended anyways - we’ve had a case of a burnt down shed here in Germany just a few months ago because someone left his CNC machine just a few minutes unattended. The result: a high five figures damage that no limit switch could have prevented.)

I just want to use the homing feature of GRBL

I find that having the ability to home the machine is quite useful and I’m a big supporter of soft limits.

One technique that I use is a feature of grbl which works well with soft limits. If I get a questionable G-code file from someone I will crank up UGCS and use the $C grbl command to get grbl to interpret the file without moving the machine. With soft limits on and $C active I can run the G-code to test it to see if the file sends the machine out of bounds without having to risk my machine or damage material.


Yep, if your machine doesn’t work, it doesn’t work. No way around that.

1 Like

If the switch is used for precise homing instead of “just preventing a crash” - and if home is used for more than just roughly establishing a reference for the soft limits (e.g. to return to fixed positions or workpieces after losing coordinates) you also need to keep its repeatability in mind.

A lot of contactless methods and also many mechanical switches will trigger at quite varying positions each time - so home will not always be exactly at the same spot.

Mechanical microswitches are quite good - also most inductive sensors. Switches with levers like the one I’ve posted previously are quite bad for example.

1 Like