Inline fan for 3D Printer Ventilation - 100mm / 4 inch ducting (No glue version) + automation with HomeAssistant and Klipper.
Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.
Zapisane na tym urządzeniu.
Fans go brrr
- Ocena
- 0 / 5
- Polubienia
- 8
- Pobrania
- 30
- Wydruki
- 0
- Wyświetlenia
- 264
- Oceny
- 0
Aktualizacja u źródła:
Informacje o modelu
- Źródło
- Printables
- Kategoria
- Accessories
- Licencja
- Creative Commons — Attribution — Noncommercial
I made this for my Voron 2.4 printer since I did not want to be poisoned by fumes. My printer sits in the same room I am working, so this is the solution I settled on:
I build a cabinet (from furniture panels) with slide out printer drawer where the printer sits. At the top of the cabinet is the cabinet air extraction outlet that is used to suck the air through the extraction system and to the outside.
I know I know... I haven't got round to making a proper container for the control module... But it's fire-proof... Kinda.
Print:
PETG would probably suite best.
I used 4 walls and 20% infill.
Supports needed (or you might get away without any) only on the middle section. Use slim tree supports - it should hold only the screw hole flat areas.
IMPORTANT:
I managed to to a whoupsee and forgot about ~2mm lengthening of the middle section resulting in a ~2mm free real-estate in the middle section between the fans and the stator. If you would like to fill it, you will need to remix the stator.
Hardware:
2x 120 PC fans with 4 pins. I used Thermalright since they are cheap and quiet;
ESP32 with wifi;
12v 1.5A (or more Amp) power supply;
Female connector to the 12v power supply;
Fixed and stable step-down converter from 12v to 5v or 3v (i had a 3v laying around so I will be focusing on that);
Multicolored 20awg wires (preferably silicone insulated for easier management);
10k ohm resistors;
220 ohm resistors;
0.1µF ceramic capacitor;
IRLZ44N MOSFET;
Flyback diode (1N4001 or 1N4148);
Schottky diode 1N5817;
Some crimp pins (to connect to the ESP32 and elsewhere), so you would not need to solder everything together (optional);
Wiring:
IMPORTANT DISCLAIMER!
I am no electrician nor a specialist - this is a story what worked for me. If you decide to do this and it burns down your house - it is on you.
12v input negative => Step-down converter IN-;
12v input negative => MOSFET Source;
12v input positive=> Step-down converter IN+;
12v input negative => Fan possitive input pin;
Step-down converter OUT- => ESP32 GND;
Step-down converter OUT+ => ESP32 3v3 (!IMPORTANT! ONLY IF YOUR STEP DOWN CONVERTER IS CONVERTING TO STABLE 3V);
MOSFET Drain => Fan negative input pin;
MOSFET Gate => 220 ohm resistor => ESP32 power cut pin (in my case GPIO10);
ESP32 power cut pin (in my case GPIO10) => 10k ohm resistor => ESP32 GND (to ensure the fan stays OFF when the ESP32 is booting);
MOSFET Gate => 10k ohm resistor => MOSFET Source (you can place the resistor directly on the MOSFET);
ESP32 RPM monitor pin (my case GPIO5) => Schottky diode 1N5817 (Cathode (side with the stripe) goes to the Fan Tachometer pin side) => Fan Tachometer pin;
ESP32 RPM monitor pin (my case GPIO5) => Fan Tachometer pin;
ESP32 3v3 => 10k ohm resistor => ESP32 RPM monitor pin (my case GPIO5);
ESP32 RPM monitor pin (my case GPIO5) => 0.1µF ceramic capacitor => ESP32 GND;
Fan possitive input pin => Flyback diode (1N4001 or 1N4148) (Cathode (side with the stripe) goes to the Fan possitive input pin side) => Fan negative input pin;
Control:
In Home Assistant install ESPHome Builder.
Flash your ESP32 with ESPHome Builder. Use the example ESPHome.yaml. You will need to tweak it - variant might be different, pins might be different and so on...
Test the ability to control the system via the HA (Home Assistant).
Create long lasting API access token in HA.
SSH into your printer and create the set_fan.sh script in a place where your printer user can reach it (you can use nano to do so). Remember to change the access token and your HA IP (I got stuck on IP, so try using ping command ("ping 192.168.x.x") from your terminal or from ssh session to confirm the IP is reachable).
Alter the printer.cfg using the example provided.
If you can not access the klipper or ssh into your printer (if it is closed source) you can still use the fan control via home assistant and perhaps find other ways to integrate it to your print start (perhaps via slicer custom macros?).
Example ESPHome.yaml:
esphome:
name: esphome-web-ebbcb0
friendly_name: Printer_Assistant
min_version: 2025.11.0
name_add_mac_suffix: falseesp32:
variant: esp32c3
framework:
type: esp-idf
logger:
api:
ota:
- platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
1. The MOSFET Power Switch
switch:
- platform: gpio
pin: GPIO10
id: fan_power_gate
internal: true # Hides this switch from the HA UI (it's handled by the fan component)
restore_mode: ALWAYS_OFF
2. PWM Output
output:
- platform: ledc
pin: GPIO4
id: fan_pwm
frequency: 25000Hz
3. The Fan Component
fan:
- platform: speed
output: fan_pwm
name: "Printer Ventilation Fan"
id: vent_fan
restore_mode: ALWAYS_OFF
speed_count: 100
Automated logic to flip the MOSFET
on_turn_on:
- switch.turn_on: fan_power_gate
on_turn_off:
- switch.turn_off: fan_power_gate
4. RPM Sensor (Improved Filtering)
sensor:
- platform: pulse_counter
pin:
number: GPIO5
mode: INPUT_PULLUP
name: "Vent Fan RPM"
id: vent_fan_rpm
unit_of_measurement: 'RPM'
update_interval: 2s # Faster update makes it feel more responsive
internal_filter: 13us # Ignores high-frequency noise spikes
filters:
- multiply: 0.5
- lambda: |-
if (id(fan_power_gate).state) {
return (x > 3500) ? 0 : x; // Filter 11k nonsense
} else {
return 0; // Force 0 when MOSFET is off
}
Example Printer.cfg script snippet:
[gcode_macro PRINT_START]
gcode:
Your print start macro
...
UPDATE_DELAYED_GCODE ID=vent_off_timer DURATION=0 # Cancel any active shutdown timer
SET_FAN_SPEED FAN=Exhaust SPEED=1.0 # Turn fan to 100%
[gcode_macro PRINT_END]
gcode:
Your print end macro
...
UPDATE_DELAYED_GCODE ID=vent_off_timer DURATION=1200 # Start 20 min (1200s) countdown
[gcode_shell_command set_exhaust_fan]
command: sh /home/biqu/set_fan.sh
timeout: 5.0
verbose: True
[fan_generic Exhaust]
pin: !PA1 # Point this to any UNUSED pin on your Voron controller board
max_power: 1.0
[gcode_macro SET_FAN_SPEED]
rename_existing: SET_FAN_SPEED_BASE
gcode:
{% set fan = params.FAN|default("Exhaust") %}
{% set speed = params.SPEED|default(0)|float %}
{% if fan == "Exhaust" %}
{% set percentage = (speed * 100)|int %}
RUN_SHELL_COMMAND CMD=set_exhaust_fan PARAMS={percentage}
{% endif %}
SET_FAN_SPEED_BASE FAN={fan} SPEED={speed}
[delayed_gcode vent_off_timer]
gcode:
SET_FAN_SPEED FAN=Exhaust SPEED=0
M118 Exhaust fan turned off automatically.
[delayed_gcode sync_fan_on_boot]
initial_duration: 1
gcode:
SET_FAN_SPEED FAN=Exhaust SPEED=0
set_fan.sh
#!/bin/bash
PERCENTAGE=${1:-0}
TOKEN="YOUR_TOKEN_FROM_HA"
HA_IP="YOUR_HA_LOCAL_IP"
curl --location --request POST "http://$HA_IP:8123/api/services/fan/set_percentage"
--header "Authorization: Bearer $TOKEN"
--header "Content-Type: application/json"
--data "{"entity_id": "fan.printer_assistant_printer_ventilation_fan", "percentage": $PERCENTAGE}"
--silent --output /dev/null