Projects2025Bambu Conveyor

Bambu Conveyor for ESP32

Overview

The Bambu Conveyor is an application designed to manage the waste output of a Bambu Lab 3D printer. It uses MQTT or motion detection to monitor the printer and control a motor that moves purge waste away from the printing area.

Bambu Conveyor moving purge waste away from the printer

v1.5.0 control center

Version 1.5.0 replaces the separate utility pages with one responsive control center while preserving the established conveyor and status-light timing from v1.4.2.

  • Live printer, MQTT, conveyor, physical LED, Wi-Fi, memory, and CPU status
  • Manual run, emergency stop, smooth countdowns, and a cooldown-only override
  • Configurable printer-stage, substage, and print-state trigger rules with independent timing
  • Device logs, safe settings that never return saved secrets, and verified OTA updates
  • A friendly BambuConveyor-ESP32 network name and bambuconveyor-esp32.local address

Bambu Poop Conveyor v1.5.0 overview

Features

Two Modes of Operation: MQTT or Motion Detection

The Bambu Poop Conveyor supports two methods for triggering the conveyor, depending on your printer model and preference.

  • Best suited for X1C printers due to their more powerful CPU, which handles MQTT updates more efficiently.
  • Listens for printer status changes and automatically activates the conveyor using your saved event rules. Defaults retain the established nozzle-cleaning and optional filament-change behavior.
  • Requires a stable network connection and correct MQTT setup.

2. IR Motion Detection Mode (Better for P1 & A1 Series)

  • Ideal for P1 and A1 series printers, where MQTT performance can be inconsistent.
  • Uses the HiLetgo AM312 PIR sensor to detect movement and trigger the conveyor.
  • Works independently of network conditions, making it a more reliable option for some setups.

You can configure which mode to use in the settings. If Motion Sensor Mode is active, MQTT Mode is disabled, and vice versa.

Bambu Conveyor configured with a motion sensor

Conveyor Makerworld files (Print these)

Optional prints

Required parts used for this build:

Optional parts:

Setup

GPIO Pins

The application uses the following GPIO pins for motor and LED control:

const int greenLight = 19;
const int yellowLight = 18;
const int redLight = 4;
 
int motor1Pin1 = 23;
int motor1Pin2 = 21;
int enable1Pin = 15;
 
const int motionSensorPin = 22; 

Wiring diagram

ESP32, L298N motor controller, status-light, and motion-sensor wiring diagram

Note:

  1. The wire color in the diagram will not exactly match my project wires that you will see in the next few images.
  2. Be sure to use resistors on your LED positive terminals or they will burn out eventually.
  3. FAQ: How does the ESP32 get power? On the L298N motor controller there is a 12v IN and an optional 5V OUT. The 5V out runs to the ESP32 > VIN (Voltage In) line, which can handle 3-5v. This solution allows us to use one power source (12V) to power our entire project.
  4. Do not remove any of the jumper pins on the L298N Motor Controller. 5V out is required for the ESP32 as mentioned. See this photo for reference.
  5. Having issues figuring out GPIO port 15? Here is a reference photo of my setup, I’ve been able to remove the jumper on the motor 1 enable pin and use the first pin to connect.

After hooking everything up it should look something like this

Fully assembled

Fully assembled Bambu Conveyor and electronics enclosure

Cutaway view of the Bambu Conveyor electronics enclosure

Rendered view of the conveyor and electronics enclosure

Alternate rendered view of the conveyor enclosure

Assembled conveyor beside the Bambu Lab printer

Open electronics enclosure showing the installed components

Close-up of the assembled conveyor enclosure

LED Insert before/after assembly

Status-light insert before and after assembly

Insert LED

Status LED being inserted into its printed holder

LED Insert - fully assembled

Fully assembled status-light insert

Flashing the ESP32

To install the firmware, use one of the following methods:

Use the Bambu ESP32 Installer in desktop Chrome, Edge, or another Web Serial-capable browser.

Method 2: Manual installation (Expert)
  1. Download and Install ESPTool

    • Install esptool using pip:
      pip install esptool
    • Alternatively, download the precompiled ESPTool from the official Espressif GitHub.
  2. Download the Firmware File

  3. Connect Your ESP32

    • Plug your ESP32 into your computer using a USB cable.
    • Ensure drivers for the USB-to-serial adapter are installed (CH340, CP210x, etc.).
  4. Find the Serial Port

    • On macOS/Linux, run:
      ls /dev/tty.*
      Look for something like /dev/tty.usbserial-1.
    • On Windows, open Device Manager and check under Ports (COM & LPT).
  5. Flash the Firmware

    • Replace <PORT> with your ESP32’s serial port (e.g., /dev/tty.usbserial-1):
      esptool --chip esp32 --port /dev/tty.usbserial-1 --baud 460800 write-flash \
        0x0 Bambu-Poop-Conveyor-v1.5.0-merged.bin
  6. Verify Flashing and Restart

    • Once flashing completes, restart your ESP32 by unplugging/replugging it or pressing the EN or RST button.

Your ESP32 should now be running the updated firmware.

Once firmware is installed

The HTTPS installer stays open while it flashes the ESP32, collects Wi-Fi details through Improv Serial, and returns the new device address. The ESP32 control center itself then runs locally over HTTP.

If serial Wi-Fi setup is skipped, the ESP32 starts in Access Point (AP) Mode:

  1. Power on your ESP32.
  2. Connect your computer or phone to the BambuConveyor Wi-Fi network using password 12345678.
  3. Open a browser and go to 192.168.4.1.
  4. Enter the network, printer, and conveyor settings.
  5. Click Save, and the ESP32 will reboot into the configured Wi-Fi network.

Usage

Web Server

The ESP32 now hosts one responsive interface for status, manual control, configuration, event rules, logs, and updates:

  • Control center: /
  • Detailed device status: /api/status
  • Manual run: POST /api/motor/run
  • Emergency stop: POST /api/motor/stop
  • Clear cooldown: POST /api/motor/clear-cooldown
  • Settings: GET /api/config or POST /api/config
  • Trigger rules: GET /api/triggers or POST /api/triggers
  • Logs: GET /api/logs

Legacy /config, /control, /logs, /update, /run, and /status URLs remain available for existing bookmarks and integrations.

Overview and live cooldown

Bambu Poop Conveyor v1.5.0 cooldown countdown

Configuration screen

Bambu Poop Conveyor v1.5.0 settings

Note: If in Motion Detection mode, be sure to lower the “Delay After Run”. Recommended time is 3000 (3 seconds).

Log screen

Bambu Poop Conveyor v1.5.0 device logs

Printer event rules

Bambu Poop Conveyor v1.5.0 trigger rules

Firmware updates

The Update screen can download a published release directly from the Developer Site or an available GitHub mirror, then upload, reboot, reconnect, and verify without requiring the user to select a file. The next maintenance build adds a separate rollback card that keeps the checksum-verified v1.4.2 release available without mixing it into the public or beta channels.

The public web installer includes two recovery choices now: an OTA file for a working v1.5.0 device and a clean USB installation for an unreachable device. OTA rollback retains stored settings; a clean USB recovery can erase them.

Updated Bambu Poop Conveyor firmware screen with the upcoming v1.4.2 rollback option

Motor Control Timings

Optional — configure the motor run time, wait time, and cooldown:

int motorRunTime = 10000; // Run for 10 seconds by default
int motorWaitTime = 5000; // Wait 5 seconds after detecting the event
int delayAfterRun = 120000; // Prevent another automatic run for 2 minutes

Note: If in Motion Detection mode, be sure to lower the “Delay After Run”. Recommended time is 3000 (3 seconds).

PWM Configuration

Optional - set the PWM properties for motor control:

const int freq = 5000;
const int pwmChannel = 0;
const int resolution = 8;
int dutyCycle = 220; // Motors power level (255 for full power) / I run just under that for no reason other than my own preference 

FAQ / Troubleshooting

Before troubleshooting, make sure the device is not in AP mode. The motor will not run until the ESP32 is connected to Wi-Fi.

What do the status lights mean when it is first turned on?

  • Flashing yellow only = Connecting to Wi-Fi
  • Solid green = Connected to Wi-Fi and the printer through MQTT
  • Red on startup = No Wi-Fi or MQTT connection (red also illuminates while the conveyor is running)
  • Green with flashing yellow = Wi-Fi connected; attempting to connect to the printer
  • Green with solid yellow = Wi-Fi connected; unable to connect to the printer through MQTT; retrying after 5 seconds

The ESP32 does not connect to the printer

  • Double-check that your printer has an access code configured and LAN Only Mode is off. See the Bambu Lab Wiki.
  • Double-check that the printer serial number matches the value entered in Settings.
  • Make sure both the printer and ESP32 have a strong Wi-Fi signal.
  • Reach out to me if you still have issues.

Motion detection mode is not working

  • Verify the wiring. The 3.3 V connection should run to the lower-left pin of the motion sensor.

License

This project is licensed under the MIT License. See the LICENSE file for details.