Autoleveling on 3D printers: 9 myths and 12 sensors tested!

There are many options for a 3D printer’s bed sensor and even more misconceptions about what they can and should do. So after a ton of testing with a custom-built precision test apparatus (TM), 9 myths about these sensors have been examined – and we got a ton of data about how precise each one can be!

Twelve options to sense the surface of a 3D printer’s bed. Twelve solutions to the same problem. Twelve sensors that are all different. But there can only be one! Well, actually, each one of these has an upside, so let’s see what they can and can’t do. Myth busting 3D-printer style!

Essentially these should all do the same thing: When using autoleveling on a 3D printer or even on other machines that need their tool to be at a perfect distance from a workpiece, like a PCB router, these sensors probe a few different points on the surface and then compensate for any misalignment of the bed or workpiece. Since the sensor itself is the only input the machine gets about how the surface is aligned or deformed, it’s kinda critical that it senses stuff reliably and can even detect your surface. The easiest option are inductive sensors, but those only detect metals and are useless for glass, then you’ve got optical ones, which can detect any surface as long as it’s not totally transparent, mechanical ones that physically extend to the surface and touch it, and lastly capacitive sensors that will detect every surface and then some.

To test their repeatability, I built this assembly that should provide a near-perfect linear motion for testing the sensors. Essentially, it’s an IGUS W rail, which as a sliding mate, should have a better repeatability than ball bearings, and the backlash these typically have doesn’t matter much since gravity is essentially pre-tensioning things here, then we’ve got another IGUS part, a 2mm pitch trapezoid spindle attached to a 0.9° stepper motor the two shafts here are touching inside the coupling, so we’re not getting any springiness. Again, to take care of any tipping effects on the rail, it’s mounted off-center. The entire thing is driven with an MKS Gen board that was literally sitting in the “scraps” bin, and a few lines of Arduino code. And yes, you can still run standard Arduino code by itself on any 3D printer board that would otherwise run the Marlin firmware or similar. All it does is to run the sensor into the surface, backs up by a bit and then does that again 41 more times. In the end, it reports the standard deviation of all measurements, which essentially tells us what sort of precision we can expect from each sensor.

To check that this construction even worked as intended, I mounted a steel rod to the carriage and let it close a circuit as it touched the aluminum block, and that came in with a repeatability much better than one micron, and basically, it was never further off than a single microstep. Yes, the microstepping might not be perfect, but it’s still an indicator that this apparatus works pretty well for these measurements.

So the units I’ve got lined up here are four different industrial inductive sensors, the smaller 2mm trigger distance, 5V type, a 4 and 8mm type and the Prusa PINDA probe, and yes, Prusa definitely has the smallest and shortest one of them all. Also in the category of inductive sensors is the one from the BQ Hephestos 2, but that one turned out to be defective, so I couldn’t include it. The capacitive ones are also industrial types, with 8 and 20mm sensing distances, this huge guy was actually pretty expensive in comparison at around 8 bucks, and even worse, it also didn’t work. Bummer. Mechanical probes are the BLTouch and a standard microswitch with and without the lever, the BLTouch retracts on its own, while a switch like this will need some sort of servo to lift it up, which will introduce inaccuracies on top of what the sensor itself can do. And lastly, the optical sensors are David Crocker’s (DV42) infrared probe I got from Think3DPrint3D and a Sharp sensor that outputs an analog voltage according to how far away it senses an object, which is really cool, but needs a comparator to generate that on/off signal the board requires.

So that’s how we’re going to do it, let’s get to mythbusting!

#1 Optical Sensors can sense plain glass.

That’s actually one that’s a bit more complex than it might look like at first sight. Glass is transparent, obviously, at least to the naked eye. But because these sensors work with infrared light, what they see could be completely different to what we see. These sensors work based on reflected light, so having a surface that is glossy like this could throw them off as well. Now, the simple answer is yes, both the optical sensors can detect that sheet of glass. David Crocker’s sensor easily detects the glass, but the Sharp sensor gets thrown off track quite a bit. First off all, it requires a much larger distance to trigger at all, and even then it started drifting and eventually smashed into the glass. The custom sensor did trigger reliably against glass, but still came with a huge penalty in precision: The readings onto glass had a tolerance fifteen times as large as the ones onto an opaque block. So while it works, it’s not something that is really advisable.

#2 You can just run a standard 6 to 36V probe from 5V

Ok, this one is actually easy to test. Out of all the 6 to 36V probes, none worked on 5V except the 8mm capacitive one. And even then, it was much less sensitive than on 12V and only triggered against metal parts, while with the higher supply voltage and a voltage divider on the output, it reliably also triggered against printed parts and had a larger trigger distance than on 5V.

So that one is busted.

#3 Capacitive probes are unreliable

So the theory with capacitive probes is that they sense pretty much anything – Plastic, glass, wood, metal, humans, etc. The problem is, things like moisture in the air also influence the readings – in theory. So as a really simple test, I let the system do 21 measurements and then just started breathing over the sensor. And oh boy, did that throw it off. Almost instantly, it started triggering about 200µm earlier – that’s 0.2mm, so basically a full layer height off target. So even if you had a less extreme humidity change, it would still throw the sensor off by a significant amount. I also did the same with the inductive sensors and while they did show a marginal change, it was always in the single-digit micron range, which might as well have been from thermal expansion. Speaking of the topic, the capacitive sensor also showed, by far, the greatest deviation when blasted with a hairdryer on low.

So are capacitive sensor unreliable and imprecise? Well, if you look at the base reading in a consistent environment, they aren’t that bad, but as soon as anything changes, you will run into issues.

#4 Probing slower gets you better readings

There are a few things that go into this – first off, some sensors, like the Sharp optical one only take a reading a few times per second, so by the time they trigger, you might already be past the point that would be the perfect spot. The same thing might be true for the printer’s firmware, which only reads values every now and then. The code I’m using is checking the sensor after every microstep, so that shouldn’t be an issue. But still, sensor delay etc still are. So every sensor was tested at two different speeds – 1.35mm/s and twice as fast, so 2.7mm/s, which is about the range you would expect a normal Z-axis to move at. And basically every single sensor was less precise when run at the faster speed. They all showed about 20% better repeatability at the slower speed, some a bit less, some a bit more, so while that’s not going turn a great sensor into an unusable one, or vice-versa, it’s still a considerable improvement if you just need that extra bit of precision.

#5 Sensors drift with heat

So you might have noticed the effect that when you run the autoleveling cycle with the bed cold, the nozzle height will end up slightly different than when probed hot. And this is very real effect, but after testing all the relevant sensors, I’m not quite sure that the sensors themselves are actually the problem there. It looks like the larger the trigger distance is, the larger the temperature drift is going to be.The inductive and optical ones were all decent, maybe not the 8mm inductive one, but the others are all at least usable when heated up. Though what also played into this was the apparatus simply heated and expanded, too, so the measured trigger point unavoidably moved back, too. What could also play into this is that at higher temperatures, copper and aluminum are less conductive, so for the sensor, it’s as if there was a thinner sheet of material, which shortens the trigger distance.

#6 Just use aluminum tape for inductive sensors

So the myth is that if you want the advantages of an inductive sensor, you can simply use some aluminum tape, even on the bottom of a glass sheet and the sensor will still trigger. So I used some standard aluminum tape, and the 4 and 8mm inductive sensors do trigger against just the roll of material, but none of the inductive sensors actually triggered against a layer of tape, even on the top surface of a glass sheet. So while multiple layers might work, they are going to add some thickness, and even then, you’re only going to get a fraction of the nominal trigger distance.

Update: It looks like there are different types of adhesive aluminum tape available. Some types with a thicker aluminum layer seem to work much more reliably according to feedback from viewers.

And that leads us into…

#7 Larger trigger distance sensors are less precise

While none of the industrial sensors are actually made to detect a set distance precisely each time, they can still be incredibly good at it. For the inductive sensors, I had 2, 4 and 8mm types, and they all performed virtually identical. They all achieved sub-micron repeatibilities, except for the 5V, 2mm type, and even that one was better than 2µm. So that’s busted.

#8 Inductive sensors trigger much closer when sensing aluminum

Before I try and explain why this is the case and end up with half the viewers and getting bored and the other half getting ready to roast me, let’s just stick to the facts: Yes, inductive sensors do lose quite a bit of their trigger distance, even against a solid block of aluminum. The distance the sensor says is against iron or steel, and with aluminum, you get about half of that. Capacitive sensors aren’t affected by this.

And lastly,

#9 Any sensor with a standard deviation better than 50µ is probably good enough

And this one is from the BLTouch kickstarter campaign – the sensor measured in with a standard deviation of about 2.5µ. Let’s take a step back and look at what the standard deviation means. Say you have a bunch of measurements and you plot out how many of them are how far off. Typically, noisy sensors like show a normal distribution, which looks like this. All the standard deviation says is that about ⅔ of the measurements are better than that standard deviation range. So with a bed leveling approach that uses just three points, on average, two of them will be measured more precisely than the standard deviation, and one of them will be worse. In turn, this point then, again, has about a ⅔ chance of falling within the range of two standard deviations, which means that, statistically, every three prints, that 50µ sensor is going to have be off by more than + – 100µ  or 0.1mm. And if you’ve ever played around and experienced the difference 100µ can make to the first layer of a print, you’ll probably agree that that’s too much.

Now, of course, a more precise sensor can still have those measurements that are far off, but it’s much less likely to happen.

So if you look at the measured standard deviations of the sensors I’ve tested, I’d say they are all very usable, maybe with the exception of the SHARP optical sensor and the capacitive one, everything else is, like, really good. Out of those, the BLTouch performed the worst, but if you take it a bit slower, it’s still way more than good enough.

So yeah, that’s the story behind all the different sensor options. What surprised me was how precise the inductive sensors turned out to be, I was expecting them to be much noisier. What I’d also like to retest is the Sharp sensor, this one is the analog type, but they are also making ones just trigger at a set distance, and I think that might make it a bit less noisy.


🛒 M8, 2mm inductive sensor (5V)
🛒 M12, 4mm inductive sensor
🛒 M16, 8mm inductive sensor
🛒 M16, adjustable capacitive sensor
🛒 M16, 20mm capacitive sensor
🛒 David Crocker’s IR sensor
🛒 SHARP analog sensor
🛒 Microswiches
🛒 BLTouch

You can support me without spending a single penny!