Introduction: LED 3D Printer Bed Leveling Tool
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
- Arduino Nano with USB Cable and header pins
- Lm339 Integrated Circuit
- BC548 Transistor
- 2N7000 FET
- WS2812 LEDs X 10
- 10nF polyester capacitor
- 18nF polyester capacitor
- 150pF ceramic capacitor
- 0.3mm Diameter Enamel Copper Wire (approx 3M length)
- Resistors 2.2k, 47R, 1M, 1K
- Vero Board 21x7 holes
- 6mm SPST Micro Tactile Push Switch
- Hookup Wire
- 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.
Note:
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!!