<p>Don't forget to add</p>
<pre><code>M420 S0
</code></pre>
<p>after the <code>G28</code> command in the G-code, else you have to level bed before every print.</p>

CC BY-SA 4.0
2023-06-01T13:11:41.873Z
Technically the use of `M420 S` for Marlin firmware to turn leveling on is based on whether in firmware the definition of `RESTORE_LEVELING_AFTER_G28` is set or not.
0scar
CC BY-SA 4.0
2023-05-21T18:45:01.947Z
2023-05-21T23:12:26.883Z
2023-05-21T23:12:26.883Z
Eric Barber
<p>The BLTouch now comes with a standard 5-pin connector.</p>
<p><a href="https://i.sstatic.net/Ov5bV.png" rel="nofollow noreferrer" title="BL Touch Wires"><img src="https://i.sstatic.net/Ov5bV.png" alt="BL Touch Wires" title="BL Touch Wires" /></a></p>
<p>and that connector is supported on the board that seems to be shipping with Ender 3s these days, the Creality 4.2.2 board (Notice it's in the bottom right and says BL_T next to it)</p>
<p><a href="https://i.sstatic.net/fVU6W.jpg" rel="nofollow noreferrer" title="Creality 4.2.2 Board"><img src="https://i.sstatic.net/fVU6W.jpg" alt="Creality 4.2.2 Board" title="Creality 4.2.2 Board" /></a></p>
<p>This is intended to make installing things easier. Since I also had a new hotend I was installing, I needed to go the route of configuring my own firmware. If you don't need that, you can be lazy and snag the pre-built firmware from <a href="https://www.creality.com/pages/download-ender-3" rel="nofollow noreferrer">Creality's website</a>.</p>
<p>If you, like me, go the route of building your own firmware, there's a lot of steps, and I'm sharing the results of 2 days of effort. To do this, you get to become a software developer for the next few minutes. Follow along carefully, as any misstep could be really really annoying.</p>
<ol>
<li><p>Download the latest <a href="https://marlinfw.org" rel="nofollow noreferrer">Marlin</a> firmware. Creality already uses Marlin as a base for their firmware, so this is going to be the best choice.</p>
</li>
<li><p>Marlin is not preconfigured for your Ender 3, but we can snag the example configurations for an Ender 3 from the Marlin Configuration repository. I went ahead and found you <a href="https://github.com/MarlinFirmware/Configurations/tree/import-2.1.x/config/examples/Creality/Ender-3/CrealityV422" rel="nofollow noreferrer">the version for the Ender 3 with a 4.2.2 board</a>. You're going to want to download all of the files in that directory.</p>
</li>
<li><p>Unzip the Marlin firmware to a folder, and in that folder you'll see ANOTHER folder named Marlin. You'll want to copy your configuration files downloaded in STEP 2 into that inner Marlin folder.</p>
</li>
<li><p>Now we need <a href="https://code.visualstudio.com/" rel="nofollow noreferrer">Visual Studio Code</a> (told you you get to be a developer). Once you open it, you'll need to install an extension Marlin made for VSCode to allow you to easily build your firmware. <a href="https://marlinfw.org/docs/basics/auto_build_marlin.html" rel="nofollow noreferrer">The instructions on installing Auto Build Marlin</a>.</p>
</li>
<li><p>Now you have a neat little button in VSCode to do stuff with Marlin.</p>
<p><a href="https://i.sstatic.net/hJbkU.png" rel="nofollow noreferrer" title="Auto Build Marlin in VSCode"><img src="https://i.sstatic.net/hJbkU.png" alt="Auto Build Marlin in VSCode" title="Auto Build Marlin in VSCode" /></a></p>
<p>But wait!  We're not ready to click that yet. First we need to modify those configuration files you downloaded.</p>
</li>
<li><p>First let's update the <code>Configuration.h</code> file. There are a lot of important settings here, many you should change, and many that are nice to change, but I'm only going to list the ones that are absolutely necessary to get the BLTouch working.</p>
<ol>
<li><p>you need to comment out the <code>Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN</code> setting, because the your BLTouch is using a different pin.</p>
</li>
<li><p>So that we don't lose our Z Homing, we need to then uncomment the setting for <code>USE_PROBE_FOR_Z_HOMING</code>.</p>
</li>
<li><p>And here's the one that I only found on the <a href="https://forums.creality3dofficial.com/community/ender-3-series/bl-touch-problems-w-4-2-2/" rel="nofollow noreferrer">Creality forums with a lucky search</a>.  You need to uncomment <code>Z_MIN_PROBE_PIN</code> and set it to <code>PB1</code> which is your BLTouch's connection point.</p>
</li>
<li><p>Naturally, you'll need to uncomment the setting for <code>BLTOUCH</code>.</p>
</li>
<li><p>You'll want to adjust the <code>NOZZLE_TO_PROBE_OFFSET</code> to account for the position the BLTouch mounts in. The standard bracket should match close the values I have set below. Notice I didn't set the Z value at all.  You should do that on the printer by hand.</p>
</li>
<li><p>If you're going to use the BLTouch, you should configure some sort of auto bed leveling.  I picked UBL so I uncommented the setting: <code>AUTO_BED_LEVELING_UBL</code></p>
</li>
<li><p>Since you're doing auto bed leveling, you need to turn it on, which you do by uncommenting the setting <code>ENABLE_LEVELING_AFTER_G28</code></p>
</li>
<li><p>Consider Nice-To-Have values, like <code>Z_SAFE_HOMING</code>, <code>LCD_BED_LEVELING</code>, <code>PREHEAT_BEFORE_LEVELING</code>, <code>INDIVIDUAL_AXIS_HOMING_MENU</code> or <code>PROBE_OFFSET_WIZARD</code> in <code>Configuration_adv.h</code></p>
</li>
</ol>
<pre><code>// #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

// Force the use of the probe for Z-axis homing
#define USE_PROBE_FOR_Z_HOMING
...
#define Z_MIN_PROBE_PIN PB1 // Pin 32 is the RAMPS default
...
#define BLTOUCH
...
#define NOZZLE_TO_PROBE_OFFSET { -44, -9, 0}
...
#define AUTO_BED_LEVELING_UBL
...
#define ENABLE_LEVELING_AFTER_G28
</code></pre>
</li>
<li><p>Finally, you're ready to build. Click on the &quot;Auto Marlin Build&quot; extension, then click &quot;Show ABM Panel&quot;.</p>
<p><a href="https://i.sstatic.net/QMiHM.png" rel="nofollow noreferrer" title="Show ABM Panel Button"><img src="https://i.sstatic.net/QMiHM.png" alt="Show ABM Panel Button" title="Show ABM Panel Button" /></a></p>
<p>Marlin should have figured out that you're trying to build for an Ender 3.  I honestly don't know what the different environments are for, but the first one seems to work just fine.</p>
<p><a href="https://i.sstatic.net/tftdU.png" rel="nofollow noreferrer" title="Marlin Builds"><img src="https://i.sstatic.net/tftdU.png" alt="Marlin Builds" title="Marlin Builds" /></a></p>
</li>
<li><p>Once the build completes, there will be a link which will open the folder where the build is. You'll want to get the SD card from your Ender 3 and copy the <code>.bin</code> file from that folder onto the root of the SD card. Then stick the SD card in your Ender 3 and power it up and you should see your new Marlin Firmware start up. Then you can start configuring your BLTouch for auto bed leveling.</p>
</li>
</ol>

CC BY-SA 4.0
2022-07-02T05:48:07.020Z
Hi and welcome to SE.3DP... Nice long answer... maybe fix the images' positioning in the list formatting..?
Greenonline
CC BY-SA 4.0
2023-02-18T18:44:59.633Z
Thanks for this guide! I'm going to be flashing my printer later. One note I found while going through this (at least for my Ender 3 Pro with BLTtouch and Marlin 2.1.2, ymmv) - the compiler refused to compile unless I enabled `Z_SAFE_HOMING` which is listed on your "nice to have" section. Appears that may be required now.
tmountjr
CC BY-SA 4.0
2023-09-28T17:30:58.713Z
Thanks so much for posting. The "uncomment `Z_MIN_PROBE_PIN` and set it to `PB1`" was the missing piece I haven't seen anywhere else.
dlehman
CC BY-SA 4.0
2022-07-02T05:08:49.173Z
2024-07-06T02:48:43.397Z
2024-07-06T02:48:43.397Z
deltree
<p>I bought an Ender 3 recently and it has the 4.2.2 Creality board.  Then I bought a BLTouch to upgrade it with bed leveling. It turns out that the BLTouch now comes with a standard 5-pin connector instead of the separate wires that all the tutorials talk about.  How do I install the thing?</p>

<creality-ender-3><marlin><firmware><bltouch>
Configuring Marlin 2.x with Ender 3 4.2.2 and BLTouch
deltree
# Configuring Marlin 2.x with Ender 3 4.2.2 and BLTouch

(Asked by: username_0 on 2022-07-02)

I bought an Ender 3 recently and it has the 4.2.2 Creality board. Then I bought a BLTouch to upgrade it with bed leveling. It turns out that the BLTouch now comes with a standard 5-pin connector instead of the separate wires that all the tutorials talk about. How do I install the thing?

**Tags:** creality-ender-3, marlin, firmware, bltouch

---

## 2 answers

### Answer by username_0 on 2022-07-02. Score: 16 | Accepted answer

The BLTouch now comes with a standard 5-pin connector.

and that connector is supported on the board that seems to be shipping with Ender 3s these days, the Creality 4.2.2 board (Notice it's in the bottom right and says BL_T next to it)

This is intended to make installing things easier. Since I also had a new hotend I was installing, I needed to go the route of configuring my own firmware. If you don't need that, you can be lazy and snag the pre-built firmware from Creality's website.
If you, like me, go the route of building your own firmware, there's a lot of steps, and I'm sharing the results of 2 days of effort. To do this, you get to become a software developer for the next few minutes. Follow along carefully, as any misstep could be really really annoying.

Download the latest Marlin firmware. Creality already uses Marlin as a base for their firmware, so this is going to be the best choice.

Marlin is not preconfigured for your Ender 3, but we can snag the example configurations for an Ender 3 from the Marlin Configuration repository. I went ahead and found you the version for the Ender 3 with a 4.2.2 board. You're going to want to download all of the files in that directory.

Unzip the Marlin firmware to a folder, and in that folder you'll see ANOTHER folder named Marlin. You'll want to copy your configuration files downloaded in STEP 2 into that inner Marlin folder.

Now we need Visual Studio Code (told you you get to be a developer). Once you open it, you'll need to install an extension Marlin made for VSCode to allow you to easily build your firmware. The instructions on installing Auto Build Marlin.

Now you have a neat little button in VSCode to do stuff with Marlin.

But wait!  We're not ready to click that yet. First we need to modify those configuration files you downloaded.

First let's update the Configuration.h file. There are a lot of important settings here, many you should change, and many that are nice to change, but I'm only going to list the ones that are absolutely necessary to get the BLTouch working.

you need to comment out the Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN setting, because the your BLTouch is using a different pin.

So that we don't lose our Z Homing, we need to then uncomment the setting for USE_PROBE_FOR_Z_HOMING.

And here's the one that I only found on the Creality forums with a lucky search.  You need to uncomment Z_MIN_PROBE_PIN and set it to PB1 which is your BLTouch's connection point.

Naturally, you'll need to uncomment the setting for BLTOUCH.

You'll want to adjust the NOZZLE_TO_PROBE_OFFSET to account for the position the BLTouch mounts in. The standard bracket should match close the values I have set below. Notice I didn't set the Z value at all.  You should do that on the printer by hand.

If you're going to use the BLTouch, you should configure some sort of auto bed leveling.  I picked UBL so I uncommented the setting: AUTO_BED_LEVELING_UBL

Since you're doing auto bed leveling, you need to turn it on, which you do by uncommenting the setting ENABLE_LEVELING_AFTER_G28

Consider Nice-To-Have values, like Z_SAFE_HOMING, LCD_BED_LEVELING, PREHEAT_BEFORE_LEVELING, INDIVIDUAL_AXIS_HOMING_MENU or PROBE_OFFSET_WIZARD in Configuration_adv.h


// #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

// Force the use of the probe for Z-axis homing
#define USE_PROBE_FOR_Z_HOMING
...
#define Z_MIN_PROBE_PIN PB1 // Pin 32 is the RAMPS default
...
#define BLTOUCH
...
#define NOZZLE_TO_PROBE_OFFSET { -44, -9, 0}
...
#define AUTO_BED_LEVELING_UBL
...
#define ENABLE_LEVELING_AFTER_G28


Finally, you're ready to build. Click on the "Auto Marlin Build" extension, then click "Show ABM Panel".

Marlin should have figured out that you're trying to build for an Ender 3.  I honestly don't know what the different environments are for, but the first one seems to work just fine.


Once the build completes, there will be a link which will open the folder where the build is. You'll want to get the SD card from your Ender 3 and copy the .bin file from that folder onto the root of the SD card. Then stick the SD card in your Ender 3 and power it up and you should see your new Marlin Firmware start up. Then you can start configuring your BLTouch for auto bed leveling.

> **Comments:**
> **username_3**: Hi and welcome to SE.3DP... Nice long answer... maybe fix the images' positioning in the list formatting..?  
> **username_4**: Thanks for this guide! I'm going to be flashing my printer later. One note I found while going through this (at least for my Ender 3 Pro with BLTtouch and Marlin 2.1.2, ymmv) - the compiler refused to compile unless I enabled `Z_SAFE_HOMING` which is listed on your "nice to have" section. Appears that may be required now.  
> **username_5**: Thanks so much for posting. The "uncomment `Z_MIN_PROBE_PIN` and set it to `PB1`" was the missing piece I haven't seen anywhere else.  

---

### Answer by username_1 on 2023-05-21. Score: 2

Don't forget to add
M420 S0

after the G28 command in the G-code, else you have to level bed before every print.

> **Comments:**
> **username_2**: Technically the use of `M420 S` for Marlin firmware to turn leveling on is based on whether in firmware the definition of `RESTORE_LEVELING_AFTER_G28` is set or not.  

---

