I have seen mechanical (micro switch), optical and magnetic(magnet + hall sensor) end stops.

Are there any differences in how exact they switch at the right location? If so which are the most precise?


6 Answers 6


There are some different criteria that we should use to select a switch type:

  • Precision / repeatability: does the switch trigger at the same place every time? How much spread is there in the trigger position? Do environmental changes or machine setting changes affect the trigger position?
  • Contact distance: does the switch register with enough clearance to its hard-stop that the homing axis can stop before colliding with something?
  • Noise-rejection: does the switch ONLY trigger when it is supposed to?

It's important to ask, how much switch precision do we actually need? A typical 3d printer drivetrain using a microstepping stepper motor can only accurately position the moving load within +/- one 1/16th microstep (even if using finer microstepping than that) due to error-inducing effects like friction torque and magnetic detent angle error. That's around +/-0.01mm for most printers. The homing switch only needs to be as precise as the motor's positioning! Nothing is gained by having, say, 0.001mm precision endstops.

This precision of +/-0.01mm is achievable for all types of endstop switches, with proper switch selection and configuration.

Then there are three "standard" switching types in use in consumer/hobbyist 3d printers:

  • Mechanical switches, typically dual NO/NC limit switches, which either pull up or pull down a signal pin by connecting an electrical circuit when triggered
  • Optical switches, which use transistors to detect when an obstacle ("flag") is blocking the window between the emitter and sensor
  • Hall effect switches, which use transistors to detect when a magnetic field exceeds a particular field strength cutoff

Mechanical Switches

Precision/repeatability depends on the switch quality, length of lever arm attached (longer increases contact distance but is worse for precision), and impact speed of the carriage with the switch. It's possible to have a good mechanical switch or a bad mechanical switch. This is typically a reasonable default choice because it is simple and cheap.

A small mechanical switch with a short lever arm (or the lever arm removed) will generally achieve the required +/-0.01mm switching precision. Very cheap switches, high contact speeds, and long lever arms may provide inadequate resolution for Z homing or probing, but will still be adequate for low-precision X and Y homing purposes.

Where mechanical switches tend to cause issues is in noise rejection. Different controller boards use different ways of wiring the switch: some use two wires and only send a signal when triggered. When not triggered, the signal wire is left floating or weakly pulled up by the microcontroller, while attached to a long wire that acts as an antenna to pick up EM noise. It is VERY common for heater or stepper wiring to emit nasty EMR due to the PWM current control. Two-wire endstop cables should always be run away from stepper and heater wiring. Shielding and twisting the conductors is a good idea too.

A more robust approach is to use three-wire switches that actively pull the signal line high or low depending on the switch position. These will tend to reject noise better.

Very cheap mechanical switches may fail within the life of the printer. However, most limit switches are rated for millions of cycles, which is unlikely to occur over any normal printer's lifespan.

Mechanical switches are easy to align and easy to trigger by hand during troubleshooting.

Optical Switches

These rely on a flag blocking a window between a light emitter and a detector. This is non-contact and can be quite reliable, but introduces some challenges. The exact trigger position (and thus precision) may depend on ambient light levels in the room, because the sensor is monitoring for light to decrease below a specific intensity. So it may be very repeatable/precise in the short term but have some drift if the sensor moves in and out of the sun through the day.

Switching tends to be more consistent and reliable if the flag enters the window from the side, rather than the top.

Optical switches will actively pull the signal line high or low, and thus have good electrical noise rejection.

Hall Effect Switches

These measure the intensity of the nearby magnetic field and trigger when it exceeds a certain amount in a certain polarity. This is highly precise/repeatable (better than +/-0.01mm) and extremely resistant to noise and environmental conditions. (Unless your printer is next to something that emits large magnetic fields, anyway.)

The hall switches I've seen have an adjustable trim pot to tune the trigger distance. That's a nice feature when trying to manually calibrate a Delta or a Z-bed for first layer height.

The primary downside to hall switches is that they need a magnet to trigger the switch. This can be difficult to trigger by hand during troubleshooting, and requires attaching a magnet somewhere on the moving carriage. Glue works fine... but don't glue the magnet in place backwards!

  • 2
    $\begingroup$ I don't see the "Precision / repeatability" answered for the different switch types. You name the effects that have influence though. I think the question is if a good mechanic switch is more precise as an Hall Effect switch. Or if ambient light makes an optic switch less precise than bad mechanical switch. And what are the variations anyway. Are we talking millimeters in difference or µm? Some ball park values of the achievable precision would be needed to compare the three end stop types. $\endgroup$ May 6, 2016 at 11:35
  • $\begingroup$ It simply depends too much on the specific switch used to give a concrete answer. In particular, two different mechanical switches can have very different precision. A cheap limit switch with a very long lever arm might be +/-0.5mm with a speed-dependent trigger position, but that's unusually bad. My experience is that all the "typical" endstop switches (hall, optical, short-throw mechanical) are equal or greater precision than the positioning resolution of a typical stepper motor drivetrain (+/- a 1/16 microstep or thereabouts) and thus the exact trigger position repeatability is irrelevant. $\endgroup$ May 9, 2016 at 15:14
  • $\begingroup$ Let me add some detail to the answer to clarify this a bit. $\endgroup$ May 9, 2016 at 15:15
  • 1
    $\begingroup$ Nice answer, however, do you have any source for the precision of (common) switches being this high? The statement "use transistors to detect" is a bit superfluous since just about everything uses transistors and transistors aren't really key to their operation. RE large magnetic fields; have you considered that the stepper motors themselves emit quite a bit of magnetism. I found that once triggered, my hall endstops stayed triggered due to the magnetic field of the motors, and that to get them to "untrigger", I had to add a magnet of the opposing polarity close to them. $\endgroup$ May 9, 2016 at 19:57
  • 1
    $\begingroup$ Repeatability is far more important than precision. The word "precision" indicates, roughly, how small a distance difference can be determined, and you'd think there's no point in exceeding the stepper motor limit -- except that the bed itself can be adjusted far more precisely w/ the four corner bolts. So if you can get super-tight repeatability, you can "home" the bed itself to that position. $\endgroup$ Nov 25, 2016 at 3:16

Thomas Sanladerer performed exactly the comparison you ask. Check the whole video.

The result is that inductive sensors are the most accurate, but they are highly dependent on the bed material chosen.

Mechanical switches (bare, no metallic arm) are about as accurate and keep the same accuracy with every bed material (however you need a mechanism to retract them, which may or may not decrease the accuracy).

Other sensors are less accurate.

In any case, most of them are already far better than required, since anything below 50 microns is fine and basically all of them reach that accuracy.

Choose based on other factors such as weight, installation, price. Inductive, after a calibration based on your specific bed, may be the easiest since they need no retraction, but they are bulky. BLtouch is probably the second choice, mechanical microswitches the third one.

  • $\begingroup$ Good find of an old question and a good summary of Tom's tests. He did not test an optical breaker circuit though - where a light always hits a photodetector and the moving part pushes a wall inbetween. This setup is very precise. $\endgroup$
    – Trish
    Oct 16, 2019 at 15:56
  • $\begingroup$ I'm not sure it can beat the other ones: as written in another answer, that kind of endstop is based on the light reaching the sensor dropping below a certain threshold. Since it's a measurement based on (infrared) light, the ambient light will impact it. It can be accurate in a specific environment but not immune to various changes to the environment. $\endgroup$
    – FarO
    Oct 16, 2019 at 16:22
  • $\begingroup$ I am talking about light barrier type optical sensors. An LED sends full bright power into a sensor and a "wing" moves in. Such endstops were not tested by Tom but are used extensively in heavy machinery as they are rather foolproof and a broken light source or any item falling into the sensor trips an emergency halt. $\endgroup$
    – Trish
    Oct 16, 2019 at 19:08
  • $\begingroup$ @Trish to explain better: in those sensors the light is converted to voltage, then when the voltage crosses a threshold, the output is triggered. However the threshold will depend slightly on the environment temperature, and since a small change in the threshold translates in a much larger change of trigger height, they may not be better/much better than the other systems. Oh, and you still need retracting them when not in use, which add an additional mechanical component which will decrease accuracy. For example, a 4 cm ABS holder will expand by 80 microns over a 30°C temperature difference. $\endgroup$
    – FarO
    Jun 3, 2021 at 16:20
  • $\begingroup$ Thomas' video was about bed levelling rather than the OP's question about end stops. however it did show the accuracy of microswitch without lever vs relevant alternatives. $\endgroup$
    – Nick
    Dec 7, 2021 at 17:25

I don't think there is a simple answer.

In my opinion, for a home sensor accuracy doesn't matter. Firmware usually allows setting an offset between the indicated position and the actual position. What really matters is repeatability. Every time the sensor indicates position, the position is the same.

Mechanical Switches

I have found through testing several mechanical switches that the "make" event is less repeatable than the "break" event. For best results, I move toward the position that closes the switch, then move in the opposite direction until the switch opens. If I remember correctly, I got "make" repeatability of about 0.02" (0.5 mm), and "break" repeatability of about 0.005" (0.13 mm).

Optical Switches

For a delta 3D printer, I use optical sensors. Optical sensors have a built-in illumination and sensor, usually on opposite sides of a forked structure. The sensor side has a slot which masks the light being received, helping to shroud it from ambient light. The slot is along an axis which is either aligned with the fork or normal to it. The flag you use for the interrupter should completely cover the slot, and for good repeatability edge of the flag must be parallel with the slot. In other words, some sensors expect the flag to enter from the side while other expect the flag to enter from the top. Either will work, but you need to choose the right sensor for the configuration of your machine.

Ambient Light with Optical Switches

Perhaps ambient light could be a problem. If so, it could be addressed by shading the sensor.

Let's assume that the LEDs in the sensor are the same efficiency as the ambient LED lights. For reference, here is a spec sheet for a typical optical interrupter used in optical sensors: http://www.isocom.com/images/stories/isocom/isocom_new_pdfs/H21A.pdf The package of the optical sensor is designed to reduce susceptibility to ambient light.

Light intensity falls off as distance^2, and the illuminators in the sensor are very close. How much effect does room light have on the sensor?

In my shop, I use 8-foot LED replacement bulbs for the fluorescent bulbs. With this, I have 72 watts of LED lighting, which, let's say, illuminate evenly the semi-sphere below the ceiling. A full sphere is 12.56 sr (steradians, or stereo-radians), so the half sphere is 6.28 steradians, for a power of 11.46 W/sr. At the sensor, this must be divided by the square of the distance, let's say 8 feet. This gives us (11.46 W/sr)/(96in^2) = 0.119 W/area.

The illuminating LED has a power (typically) of 1.2 V * 0.05 A, or 0.06 W. The light cone from a typical LED is about 30 degrees, which is 1 sr, for a power of 0.06 W/sr. Scaled for an estimate of the distance between the emitter and sensor of 4 mm or 0.157", is (0.06 W/sr)/(0.157in^2) = 2.43 W/area.

It seems unlikely that general ambient light will be a problem. If it were, the sensor mounting could be designed to shield the sensor from direct exposure to ambient light.

It is important with optical sensors to be sure the interrupting flag is actually opaque to the illuminator light. As I found, red PLA is not especially opaque to infrared light, so I needed to paint the flags with a black pigmented paint.

Hall Effect Switches

I have no experience with Hall effect magnetic limit switches. Other answers here have praised them because they have an adjustment which can be used to set the precise detection point. I don' t like adjustments because they drift. Pots are subject to wear, oxidation, and both slow and fast variation in their resistance. I would prefer to have something unadjustable and repeatable in hardware and use software to hold the calibration.

Example of Hybrid Choice

On a 6-axis delta architecture CNC machine I build, I use a hybrid approach to sensing home position. Mechanical switches indicate a position that is close to home, and the index pulse of a rotary encoder defines the precise home position. The homing firmware moves toward home until the mechanical switch closes, then away until it opens, then back toward home until it detects the index pulse. As there are six axes, there are six sets of these switches and encoders. Using a mechanical switch for the rough homing made sense for this machine because the index sensor is hit once per revolution, so it is not a unique indicator of home, and this machine creates a lot of dust and chips, which could block an optical sensor.

So, without an absolute answer, my preference is for optical switches for repeatability.

  • $\begingroup$ The precision values you got for mechanical switches appear to be extremely high. Granted, they are not perfect, but if mechanical switches only had a repeatability of around 0.5 or 0.13mm, then nearly every print on those well-known cheap Chinese 3D printer kits would fail, which is clearly not the case. $\endgroup$
    – Fritz
    Oct 23, 2018 at 12:48
  • $\begingroup$ The link has unfortunately died... do you happen to know the title of the document, so that we could search/google for it? $\endgroup$
    – Greenonline
    Oct 16, 2019 at 15:58
  • $\begingroup$ This link may serve: pdf.datasheetcatalog.com/datasheets/105/55275_DS.pdf $\endgroup$
    – cmm
    Oct 17, 2019 at 11:59
  • $\begingroup$ The video in YouTube youtu.be/QicY68BOml0 is taking your answer without giving you credit. You can submit request for removal. $\endgroup$
    – FarO
    Apr 17 at 5:45

I think there are several factors involved in which sensors are best, but the general ordering for me would be Hall, Optical followed by mechanical. All of the types will be subject to some drift due to vibrations and changes in the printer over usage. Therefore it's the ease of adjustment as well as the accuracy of the stop which counts in the assessment.

In my experience the hall effect sensors are the most accurate and easiest. They don't rely on physical switching (as with the mechanical) meaning there is no "wear and tear" on the component and the point of switching will remain fixed. They have a potentiometer which can be adjusted to make the position of the stop change without any mechanical intervention allowing very fine tuning. They can be very accurate.

Optical are similarly accurate but usually have a fixed component that cuts the beam to switch on/off the sensor. The adjustment of the stop will usually be mechanical because the mount points will need to be adjusted - this reduces their accuracy. There are various adjustable mounts to alleviate this on thingyverse or the like.

Mechanical switches are similar to optical in terms of adjustment with the added inaccuracy of the actual switch mechanism which may degrade over time.

  • $\begingroup$ The video in YouTube youtu.be/QicY68BOml0 is taking your answer without giving you credit. You can submit request for removal. $\endgroup$
    – FarO
    Apr 17 at 5:45

If you take a look at the RepRap Wiki, they briefly explain these three switches:

  • Mechanical

    "Mechanical Endstops are the most basic form of endstops, made of an ordinary switch, two wires. Changing the switch state signals the electronics.

  • Optical

    "These Optical Endstops observe the light level and reacts to sudden changes."

  • Magnetic

    "These endstops; Hall effect sensors is a transducer that varies its output voltage in response to a magnetic field. Hall effect sensors are used for proximity switching, positioning, speed detection, and current sensing applications."

In regards to your question, it's dependent upon your circumstance. However, most of the time a good 'ol Mechanical Switch is repeatable and serves its purpose well.

I, personally, would place both optical and magnetic switches in the category of a multifunction component. Meaning, both of these types of switches (generally) provide a valuable range for object detection. This can potentially lead (depending on your machine) to a pushed command that tells your machine to slow down when it comes close to the soft stop.

Again, personally, I would be wary of using an optical endstop with potential white light noise from ambient room lighting or other sources. I could be wrong in my concern for some modules that address these kind of issues.

So, if we narrow down between mechanical and magnetic: - Magnetic would provide a gentler approach, reducing (potentially) the amount of wear - However, I'm assuming, magnetic switches require "dialing in" depending on the components used in the sensor. This could lead to an undesired range that the sensor is triggered. - Mechanical switches are simple. They're either touching or not touching (on or off) - A possible pro (or con) is the ability to manipulate the trigger manually, more easily. I've run into a situation a few times where I needed to manually trigger the endstop as part of a troubleshooting step. But, if you accidentally bump your endstop while the machine is running, no good.

  • $\begingroup$ Do you know if this "pushed command that tells your machine to slow down" is used on any machine? $\endgroup$ May 5, 2016 at 14:37
  • $\begingroup$ I don't know of a real world use for 3D printing, that's why I said it's a potential option. I have seen similar setups in traditional CNC machining with a third party sensor. The sensor does its thing and essentially pushes a G-Code command to the machine's controller. Typically the command is a subroutine that performs multiple functions like moving the machine to a safe distance, stopping, and notifying the operator. Look up Caron Engineering for an example with their TMAC setup. $\endgroup$
    – tbm0115
    May 5, 2016 at 15:00
  • $\begingroup$ This doesn't answer the question, which asks "which endstops are the most precise?". There's nothing in here that addresses that - this answer mainly seems to be theorizing about a "gentler approach" which isn't even supported by any firmware. $\endgroup$ May 5, 2016 at 17:45
  • $\begingroup$ @TomvanderZanden I'm purposely staying away from answering that part of the question as it is primarily opinion based. $\endgroup$
    – tbm0115
    May 5, 2016 at 17:49
  • $\begingroup$ You could answer that part pretty objectively if you looked in some datasheets for the repeatability characteristics of various endstops. $\endgroup$ May 5, 2016 at 17:54

A separate issue not addressed in other answers is that the end stops for X/Y axes have different requirements than those for the Z axis.

X/Y Axes

When the printer offers XYZ calibration (like Prusa i3 MK2), the properties of the X and Y switches play a role, since for the Z probing the probe should be centered above the fiducials (copper circles) in the bed. The XY part of the calibration measures the position of the fiducials relative to the end-stop trigger point. Then the Z calibration measures the height of each fiducial.

When the XYZ calibration is not offered, there's usually no need for very repeatable positioning relative to the X and Y travel ends, and on most printers you could simply move the motors until they start skipping steps and call that a day - it will be accurate to within a few steps.

Z Axis

The Z axis always has a high requirement on accuracy and repeatability, and there are two general approaches to determining its position:

  1. No end-stops on the Z-axis drive system, a probe is mounted on the print head and is used to detect when the head is a certain distance above the print bed. This can be used for 9-point calibration of the bed shape and thus removes the need for bed levelling.

  2. End-stops used on the Z-axis drive system. No sensor on the print head. The bed needs to be separately leveled in reference to the nozzle - thus the bed leveling screws.

Delta Z

For Delta, you essentially have three Z axis drivers, and similar to the Cartesian XYZ drive, you don't need any end-stops if you have a probe on the print head. You can also perform multi-point bed leveling with such a probe.

Other Approaches

X and Y endstops become unnecessary once you use closed-loop stepper control, such as Mechaduino or linear digital position sensors (e.g. as used in CNC machines).

The Z probe is still useful if you don't want to perform bed leveling manually.

  • $\begingroup$ While these are interesting points about endstops, it doesn't address the actual question at all. $\endgroup$ Aug 16, 2017 at 20:42
  • $\begingroup$ Do you have any references to a delta running without endstops? I'm fairly certain endstops are required to establish axis position otherwise the motion gets screwed up. $\endgroup$
    – tjb1
    Aug 17, 2017 at 11:18
  • $\begingroup$ Kinematically they are not required. Similar to a double-Z-axis Prusa mount, you start with a "fairly" middle-of-the-bed position, then all three Z axes move down until the probe detects the first fiducial. It's a large circle (e.g. 1 inch dia) and establishes the Z and radial origin (think of the bed in polar coordinates). Second fiducial is a narrow sector and establishes the angular origin. Now you can find further small fiducials to perform full Z calibration (or full XYZ calibration after assembly). For XYZ cal you need a Prusa-like custom bed. For Z only a circular metal plate will do. $\endgroup$ Aug 17, 2017 at 14:52
  • $\begingroup$ @KubaOber Could you please explain how you would decide where "fairly middle-of-the-bed" is on a delta without any sensors? The initial position could be literally anywhere... $\endgroup$
    – piit79
    Apr 3, 2018 at 15:11
  • $\begingroup$ You can't. You do it manually, or you use a mostly metal bed where the fiducials are negative, i.e. gaps. The inductive sensors are good at detecting those. This would also help detect the edge of the bed so you don't need any additional sensors at all other than the inductive one. I run a delta like that. $\endgroup$ Apr 4, 2018 at 13:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .