ProjectsBambu Conveyor

Bambu Conveyor for ESP32

Overview

The Bambu Conveyor is an application designed to manage the waste output of a Bambu Labs 3D printer. It utilizes the MQTT protocol (or Motion detection) to monitor the printer’s status and control a motor that moves waste material away from the printing area.

image

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 (Change Filament status and Clean nozzle status) and automatically activates the conveyor when needed.
  • 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.

image

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

image

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

image

image

image

image

image

image

image

LED Insert before/after assembly

image

Insert LED

image

LED Insert - fully assembled

image

Flashing the ESP32

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

Method 1: Web installer (Easiest Method)

Go here to install via the web (must be on chrome or edge): Bambu ESP32 Installer

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 Bambu-Poop-Conveyor.v1.3.4-final.bin

  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.py --chip esp32 --port /dev/tty.usbserial-1 --baud 460800 write_flash \
        0x0 Bambu-Poop-Conveyor.v1.3.4-final.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 latest version introduces AP Mode, making configuration easier. Now, after flashing the ESP32, it will start in Access Point (AP) Mode.

  1. Power on your ESP32.
  2. Connect your computer/phone to the BambuConveyor WiFi network. Password: 12345678
  3. Open a browser and go to 192.168.4.1/config.
  4. Enter all your settings including Bambu printer settings.
  5. Click Save, and the ESP32 will reboot into the configured WiFi network.

Usage

Web Server

The application hosts a web server to provide manual control and configuration. Access the following URLs for different functionalities:

  • Root URL: Opens config page (/)
  • Control URL: Manual motor control page (/control)
  • Config URL: Configuration page to update settings (/config)
  • Logs URL: Log history page (/logs)
  • Manual Run URL: Opening this URL runs the motor manually (/run)

Configuration Screen

image

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

Log screen

image

Motor Control Timings

Optioal - Configure the motor run time and wait time:

int motorRunTime = 10000; // 10 seconds by default / I prefer 5000 as the poop doesnt come out fast enough for you to need anymore than that, but 10 seconds is just more exciting
int motorWaitTime = 5000; // The time to wait to run the motor. / We dont want the conveyor to run right when the status is detected, 5 seconds is just right in my case
int delayAfterRun = 120000; // Delay after motor run / We dont want it to run again anytime soon

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 you are not in AP mode, when in AP mode, the motor will not run, it must be connected to wifi to work

What do the flashing lights mean when its first turned on?

  • Flashing yellow only = Connecting to WiFi
  • Solid Green = We are connected to Wifi and MQTT printer
  • Red Light on bootup = No Wifi / No MQTT (Solid red also when conveyor is running)
  • Green light / Yellow flashing = Wifi connected / Attempting to connect to printer
  • Green light / Yellow solid = Wifi connected / Issue connecting to printer via MQTT / Will reattempt connection after 5 seconds

The ESP32 doesnt connect to the printer

  • Double check that your printer is setup with Access Code and LAN only mode is OFF See Bambu Wiki
  • Double check your SN matches the settings you put in
  • Make sure your printer has good Wifi signal
  • Make sure the ESP32 has good Wifi signal
  • Reach out to me if you still have issues

Motion dection mode not working

  • Verify the wires are properly configured, the 3v should be connected to the bottom left of the motion sensor.

License

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

image