LED 3D Printer Bed Leveling Tool




About: Crazy about technology and the possibilities it can bring. I love the challenge of building unique things. My goal is to make technology fun, relevant to everyday life and help people succeed in building coo...

Being new to 3D printing I found leveling the print bed a challenge, particularly on printers without auto bed leveling. This 3D Printer Bed Leveling Tool uses a Pulse Induction Metal Detection Sensor and a LED Bar Graph to show the relative distance from the Print Head to the hotbed. This is an independent add-on that does not require any code changes to printer firmware or wiring. It is easy to quickly attach to check and tune bed levels then remove.

The sensitivity and stability of the device are illustrated in the video by applying downward or upward finger pressure on the hotbed to see the effect on the LED bar graph. The calibration button on the top of the unit is used to reset the baseline height and recenter the LED indicator to the center of the bar graph.

Step 1: How It Works

The LED 3D Printer Bed Leveling Tool uses a Pulse Induction Sensor Coil powered by an Arduino Nano. The Sensor Coil is made up of a separate TX and RX coil where a pulse is induced into the TX coil which creates an electromagnetic field around the RX coil. The changing field induces a voltage into the RX coil which is detected and amplified before the pulse width of the signal is read by the Arduino.

A smoothing algorithm in the Arduino code is used to remove noise from valid pulses making it very stable. A calibration algorithm in the code takes an average of readings over a short period of startup and sets a threshold to compare the signal against. When a metal object comes within range of the electromagnetic field the field is disrupted and some of the energy is diverted from the RX coil into "Eddy currents" that form in the target object. This parasitic effect of the target object results in the pulse width detected in the RX coil reducing. Essentially we are measuring the loss of power into the target object.

An algorithm is used to translate the pulse width variation into an LED Bar Graph to show the relative distance between the coil and the printer bed.

A calibration button is provided to reset the Bar Graph to the current height so it can be used as a reference for the rest of the unit.

This circuit for this has evolved over the past 18 months into a very stable and reliably performing detector. The coil configuration and orientation have been deliberately designed to maximize stability.

Step 2: Gather the Materials

Parts List

  1. Arduino Nano with USB Cable and header pins
  2. Lm339 Integrated Circuit
  3. BC548 Transistor
  4. 2N7000 FET
  5. WS2812 LEDs X 10
  6. 10nF polyester capacitor
  7. 18nF polyester capacitor
  8. 150pF ceramic capacitor
  9. 0.3mm Diameter Enamel Copper Wire (approx 3M length)
  10. Resistors 2.2k, 47R, 1M, 1K
  11. Vero Board 21x7 holes
  12. Hookup Wire
  13. External USB power bank

Step 3: 3D Print the Case

The 3D printed case can be done using a single print and the dimensions and 3D files can be found here on Thingiverse.

Note: This unit has been specifically designed for Creality Ender 3 printers however the shape could be modified for other units. The only prerequisite would be that the printer bed is made of metal.

Step 4: Build the Sensor Coil

Take the inner and outer coil formers and wind 20 turns of copper wire around each former ensuring there is a good 15 cm of additional wire at the end for connecting to the PCB. Use the two holes provided in each former to provide an entry and exit point for the copper wire as per the photograph.

Use hot glue to tack the coils into place so they do not unwind.

Gently push the inner coil into the outer coil and ensure the four 15cm ends are oriented as per the diagram.

Thread the four wire ends through the main body of the unit through the four wire guide holes provided in the print as per the diagram.

Gently push the coils into the head of the unit as per the photograph provided. Ensure you can identify which wire corresponds to which coil so you can connect to the PCB in a later step. (Don't glue these in place until the last step as the LEDs need to be added and tested first)

Step 5: Build the Circuit

I recommend using a BreadBoard to test the circuit with your coils to ensure you have the coils wound correctly and the circuit components assembled correctly before transferring to Vero Board.

I have provided a picture of the Oscilloscope traces you should see on D2, D3 and the Transistor RXR Output for troubleshooting purposes.

The Arduino Nano requires header pins to be installed to connect to the Vero Board.

Check the position of the Vero board and Arduino Nano as indicated in the photographs. These are oriented by the guides in the 3D print however were tacked into place using hot glue to ensure minimal movement.

The LED bar graph is made from 10 WS2812 LEDs connected via 3 wires then ho glued into the main chassis and aligned to the holes.

Once this is in place and the circuit tested you can glue in the coil formers.

Step 6: Assembling and Testing the Unit

Final Assembly and Testing

Connect the search coils to the PCB and connect to your Desktop device with the Arduino IDE to load the code. Included in this step is the Arduino INO code file that will be needed to test and operate the unit. Before loading the Arduino code you will need to add the Library "FastLED.h" as a library to drive the WS2182 LEDs.

You can easily test by turning on the IDE Plotter function that will provide a pulse width graph of approximately 480uS for this circuit.


1.The polarity of the search coils does make a difference to performance. My advice is once you are connected, if there are issues try reversing the polarity of the TX or RX coil as this changes the phase of the signal. See optimal output on oscilloscope traces provided.

2. Breadboard testing yields lower pulse width outputs (Approx 250uS) than the final assembled unit (Approx 480uS). This is likely due to the 3D Housing introducing some stray capacitance into the overall circuit, nothing to be concerned about as the difference is improvement to sensitivity.

Once tested you are ready to put into position on the printer.

Final Testing on your 3D Printer

The sensitivity and stability of the device are illustrated in the video by applying downward or upward finger pressure on the hotbed to see the effect on the LED bar graph.

The calibration button on the top of the unit is used to reset the baseline height and recenter the LED indicator to the center of the bar graph.

Operation instructions for the Ender 3
1. Attach the Bed Leveling unit to the print head by pushing onto the stock housing. Connect the USB power to the unit. You should see a power-up sequence on the LEDs.

2. Adjust Z axis manually down by turning the Z-Axis drive thread until you just hear the microswitch activate with a click.

3. Push the calibrate button (gently so as not to move the carriage down or up). Once calibrated a LED should be somewhere in the center of the bar graph.

4. Shift the head across the X and Y axis as in the video to determine the relative height of each part of the bed.

5. Print the Test Print with the test print file provided and use the Bed Leveler and test print to quickly validate heights. If the LED on the Bar Graph goes down below the reference then the Bed is lower so needs moving upwards. As you adjust the bed level you will see the LED move up to the correct height.

You are now ready to go and use for ongoing leveling of your 3D printer bed!!



    • Faux-Real Contest

      Faux-Real Contest
    • Cardboard Challenge

      Cardboard Challenge
    • Toys Contest

      Toys Contest

    30 Discussions


    Question 1 day ago

    Unless I've missed seeing it you don't give much detail of the layout of the LM339 board. You do give a hint with a picture of the copper side of the 7x21 hole strip board with tracks cut and you must correctly assume that anyone skilled enough to tackle this project will be able to figure it out.
    What did you do about the three unused comparators on the LM339? It's a question that often arises regarding unused op-amps and comparators because of the possibility of stray coupling between output and inputs inducing oscillation with attendant high current drain and HF noise that can be induced into the active unit(s) on the chip. The answers to the possible problem range all the way from biasing all unused inputs to a known state through to grounding all unused inputs and sometimes grounding the unused outputs as well. From my limited understanding the scheme adopted depends on the design parameters of the particular type of chip.
    You report that your design is satisfactorily stable and I'm just wondering what you did about the unused pins or whether its not really a worry in this design.
    The National Semiconductor LM339 datasheet suggests "ALL pins of any unused comparators should be tied to the negative supply."
    OnSemi suggests "It is good design practice to ground all unused INPUT pins." (capitalization is mine)
    I believe it is okay to tie the LM339 outputs to ground because it is an open collector design.
    I will probably tie all unused pins to ground. No trouble to run a shorting jumper from pin to pin.
    I'm still waiting for my LED array to arrive in the mail so I will probably breadboard the LM339 circuit as you suggest while I'm waiting and look for any spurious oscillations with a 'scope and then verify that a grounding scheme does no harm. Then I'll build it onto my bit of stripboard.
    You could either disregard the issue if you are satisfied that floating pins do no harm or you could add a note about it to the Instructable text.

    Great idea. I bought the Cobblebot from Kickstarter and it's a pain to level. With a metal bed, this could do the trick - at least faster than using a dial, provided it's calibrated and each LED means something relevant.

    3 replies

    Reply 3 days ago

    No. Cobblebot is one of the worst products I purchased. The company ended up being super hostile to users, the instructional manual was made by a 3rd grader, and the company is now in default, so you are on your own. The v-bearing concept should be discarded for screws. In the positive, it was a good price and 80/20 is very sturdy. you get what you pay for. bed leveling is non-existent, so this idea may be of value. If it's faster and more/at least as accurate as other methods, then it's worth it.


    4 days ago on Step 6

    sorry to be picky, but you said "Tool" rather than "Sensor" so I assumed !=) it was attached to some screw/small motor config to actually _l e v e l_ the heat platform (small things what I see in eBay...should mount on a base platform... I mean, nowhere have I seen hard degrees vs. hmmm.... size... material...I mean what are the parameters when "imbalanced" becomes meaningful??
    ((On second thought, I guess I'm asking - ungratefully - what can I 3D produce before I need something like this?? Thanks.))

    1 reply

    Reply 4 days ago

    Hey, no problems. This instructable is relevant to individuals who have a 3D printer with manual leveling controls that are adjusted by hand. e.g like the Creality Ender 3
    My experience is if the bed is not level by more than half a layer then there will be bed adhesion and print quality issues.
    It is not mandatory to have a bed leveling tool/device as there is normally a stock procedure you follow to do so.
    The objective of this instructable is to make this process less onerous.


    7 days ago

    This is interesting for more than just leveling my 3d printer bed and will be very useful.

    Question though, for the 3d printer, how is this superior to using a good quality dial indicator? Even an average quality dial indicator has .01mm resolution with the better test indicator giving you .0005 inch.

    2 replies

    Reply 7 days ago

    Hi Im just in the process of trying to accurately measure the incremental change detected for each LED. I’ll post here once I have. What I would say is that I am using with an Ender 3 and it shifts after about 75% turn of a bed nut turn in the cornersof the bed. When you combine this with a test print provided it significantly speeds up the process of leveling om scratch.

    Also forgot to add one advantage is there is no physical contact required with the bed so this bed can be moving at any speed.


    Question 6 days ago

    I presume, that this cannot be used when printing on glass attached on the aluminium base plate of the bed.

    1 answer

    Answer 6 days ago

    Yes it can be used as that is what my Ender 3 prints on


    6 days ago on Step 6

    Had not heard of the ws2812 LED array before but I have now! Your project looks intriguing and for the price of the LED array it looks well worth trying. Everything else is in my junk box and my own Ender 3 is looking for a print job to perform. Will post again to say how my build went.

    1 reply

    Question 7 days ago

    Nice idea for detecting distance.
    I have a few questions for you on this.
    1) Did you 3D print the coil formers?
    I didn't see these in the Thingiverse parts.
    2) Is the inner coil the Tx or the outer?
    3) How did you determine the number of turns to make up the coils?
    Was it trial and error, or did you calculate the req. inductance etc?

    1 answer

    Answer 6 days ago

    Hi thanks for the questions
    1. Yes the formers were printed and are in the master STL. I have had this feedback so I think its because the formers are on the other side of the print obscured from vision by the main body. Ive put a separate STL file up for the formers for this reason.
    2. Yes the inner coil is TX this is noted on the circuit diagram.
    3. Initially number of coils was trial and error combined with capacitance value. The performance changed when assembked due to stray capacitance. So at this stage I settled on the current number of turns and cap values for consistency. The biggest challenge was getting the PulseIn function to work reliably detcting the pulse as timi is critical. Another reason for publishing the values.


    7 days ago on Introduction

    I would add a comment in the main body that if you have a glass bed this will NOT work. They are growing increasingly common and wont work with this type of sensor.

    1 reply

    Reply 6 days ago

    Hi thanks for the feedback. I have mentioned in the instructable it needs to be a metal bed. Some glass beds have metal underneath like the Ender 3 I use.

    Brian Schreiber

    7 days ago

    Wondering what the relationship is between the LED level and actual vertical distance? What is the total range of the device, 10 LED's equates to what? 0.1 inches?? resolution?

    1 reply

    Hi thanks for the question. Im just in the process of trying to accurately measure the incremental change detected for each LED. I’ll post here once I have. What I would say is that I am using with an Ender 3 and it shifts after about 75% turn of a bed nut turn in the cornersof the bed. When you combine this with a test print provided it significantly speeds up the process of leveling om scratch.