1 / 7
External Touchscreen Upgrade for Klipper — zdjęcie 1
1 / 7

External Touchscreen Upgrade for Klipper

Zamów wydruk tego modelu

Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.

Zapisane na tym urządzeniu.

Informacje o modelu

Źródło
Printables
Licencja
Creative Commons — Attribution — Noncommercial — Share Alike

External Control Case for Klipper 3D Printer with Fan Cooling

 

This was a project I made for myself after I had to move my printer to my garage. I needed a way to keep my Pi cool even in the hot summer. This external case was what I came up with and it worked well even through 90F+ days. The two fans built into the case dynamically speed up/down to keep the Pi around 50C. Even on the hottest days, it didn't get over 60F for me. 

Below is step by step instructions that Grok and I came up with that should walk you through every step. 

If you have any issues, message me and I'll help as much as I can.

Project Summary: Custom 3D-printed case for a Klipper-controlled 3D printer, featuring a 7-inch touchscreen and fan-cooled Raspberry Pi to keep it cool outside a hot enclosure!

Time Estimate: ~10-15 hours (depending on printer speed and filament).
Difficulty: Intermediate (basic soldering and Pi setup required).

Bill of Materials

Note: Power supply must handle ~2.1A at 5V load.

Hardware Setup

Print Preparation

Bezel: No supports needed.

Main Case: Supports on build plate only.

2x Fan Grates: No supports needed.

Air Intake Grill: No supports needed.

Back Panel: No supports needed.

Settings: Recommend 20% infill, 0.2mm layer height, based on standard practice (adjust per your printer).

Assembly Steps

1. Mount the Raspberry Pi to the Touchscreen:

Use the touchscreen’s standoffs/screws to attach the Pi. Align HDMI/USB ports.

 

2. Solder the USB Pigtail to the Buck Converter:

Solder the pigtail (USB-C or Micro-B) to the buck converter’s 5V output (red to +, black to -).

 

3. Wire and Install the Barrel Jack:

Solder wires to the buck converter input, slide the nut over, feed through the case hole, solder to the barrel jack, and secure with the nut.

 

4. Adjust Buck Converter Voltage:

Connect a 12V power supply, use a multimeter to set the buck output to 5V via the trim pot.

 

5. Mount the Buck Converter:

Secure to the case bottom using offsets (adhesive or screws).

 

6. Install the Air Inlet Grate:

Secure with 4 M3x6 screws.

 

7. Install Fans and Grates:

Place 4010 fans in top ports (air outward), secure with grates using 8 M3x16 screws (4 per fan).

 

8. Connect Fan Signal Wires:

Link first fan to GPIO 12, second to GPIO 13 with jumper wires.

 

9. Solder Fan Power Wires:

Solder fan 5V/ground wires to the buck converter output.

 

10. Connect Pi Power Pigtail:

Plug the pigtail into the Pi (ensure power off).

 

11. Install Touchscreen and Bezel:

Insert screen, snap bezel with tabs, align volume cutout.

 

12. Connect USB Peripherals:

Route printer cable/webcam through the side hole.

 

13. Secure Back Panel:

Screw on with 4 M3x6 screws.

 

14. (Optional) Add Rubber Feet:

Attach adhesive rubber feet to the support feet.

 

Notes: Check solder joints, ensure 2A 12V supply.

Software Installation

Fan Control Script and Service Setup Manages PWM fans for Pi cooling. Assumes Klipper with Mainsail/Fluidd on Raspberry Pi OS.

  • Step 0: Access via SSH:
    • Find Pi IP (e.g., hostname -I or router).
    • SSH: ssh pi@<IP> (default password: raspberry, change with passwd).
    • Enable SSH via sudo raspi-config if needed.
  • Prerequisites: Raspberry Pi OS with Mainsail/Fluidd, pigpio installed.
  • Step 1: Install Software:
    • Update: sudo apt update && sudo apt upgrade.
    • Install: sudo apt install pigpio python3-pigpio.
    • Start daemon: sudo systemctl start pigpiod && sudo systemctl enable pigpiod.
    • Check: sudo systemctl status pigpiod (look for active).
  • Step 2: Create Fan Script:
    • Edit: nano /home/pi/fancontrol.py.
    • Code:

python

import time
import subprocess
import pigpio

pi = pigpio.pi() if not pi.connected: print("Failed to connect to pigpio daemon! Is pigpiod running?") exit()

PWM_FREQ = 25000 FAN1_PIN = 12 FAN2_PIN = 13

def get_temp(): try: output = subprocess.check_output(["vcgencmd", "measure_temp"]) temp_str = output.decode().split("=")[1].split("'")[0] return float(temp_str) except Exception as e: print(f"Error reading temperature: {e}") return 0

def cleanup(): pi.hardware_PWM(FAN1_PIN, PWM_FREQ, 0) pi.hardware_PWM(FAN2_PIN, PWM_FREQ, 0) pi.stop()

try: while True: temp = get_temp() if temp == 0: time.sleep(5) continue if temp < 50: duty_cycle = 0 elif temp >= 70: duty_cycle = 1000000 else: duty_cycle = int(300000 + (temp - 50) * 35000) pi.hardware_PWM(FAN1_PIN, PWM_FREQ, duty_cycle) pi.hardware_PWM(FAN2_PIN, PWM_FREQ, duty_cycle) print(f"Temperature: {temp}°C, Duty Cycle: {duty_cycle / 10000:.1f}%") time.sleep(5) except KeyboardInterrupt: print("Script stopped by user") cleanup() except Exception as e: print(f"Unexpected error: {e}") cleanup()

  • Save: Ctrl+O, Enter, Ctrl+X.
  • Note: Fans off <50°C, 30%-100% from 50°C-70°C, 100% >70°C, via pigpio at 25kHz.
  • Step 3: Test Script:
    • Run: python3 /home/pi/fancontrol.py.
    • Check output and fan response.
    • Stress test: sudo apt install stress; stress --cpu 4.
    • Stop: Ctrl+C.
  • Step 4: Create Service:
    • Edit: sudo nano /etc/systemd/system/fancontrol.service.
    • Config:

ini

[Unit]
Description=Raspberry Pi Fan Control Service
After=network.target pigpiod.service
[Service]
ExecStart=/usr/bin/python3 /home/pi/fancontrol.py
WorkingDirectory=/home/pi
Restart=always
RestartSec=5
User=pi
Environment="PYTHONUNBUFFERED=1"
[Install]
WantedBy=multi-user.target
  • Save: Ctrl+O, Enter, Ctrl+X.
  • Reload: sudo systemctl daemon-reload.
  • Enable: sudo systemctl enable fancontrol.service.
  • Start: sudo systemctl start fancontrol.service.
  • Check: sudo systemctl status fancontrol.service (look for active).
  • Step 5: Monitor:
    • Logs: journalctl -u fancontrol.service -f.
    • Restart if failed: sudo systemctl restart fancontrol.service.
    • Check pigpiod: sudo systemctl status pigpiod.
Usage

Power On: Plug in the 12V supply. Screen shows Mainsail/Fluidd; fans off <50°C.

Touchscreen Control: Use Mainsail/Fluidd to manage prints. Access volume via side cutout if applicable.

Monitor Fans: Auto-adjusts (off <50°C, 30%-100% 50°C-70°C, 100% >70°C). Check via journalctl -u fancontrol.service -f.

Stress Test: sudo apt install stress; stress --cpu 4 to test cooling.

Tip: Ventilate the enclosure and use Mainsail/Fluidd temp monitoring.

Troubleshooting

Fans Not Spinning: Check pigpiod (sudo systemctl status pigpiod, restart if needed), GPIO 12/13, 5V output.

 

Service Fails: Check logs (journalctl -u fancontrol.service), restart (sudo systemctl restart).

Touchscreen Blank: Secure HDMI/USB, verify 2A 12V supply.

 

Overheating: Check fancontrol.py thresholds, clean grates, improve ventilation.

Note: Reboot or recheck connections if persistent.

Conclusion

Moves Klipper controls outside a hot enclosure with a touchscreen and fan-cooled Pi. The pinout lesson highlights GPIO checks, while cooling keeps the Pi <70°C. Benefits: easy access, heat management. Future: Add a camera or larger screen. Share remixes or questions—happy printing!
 

Note: Links to products (e.g., Amazon) are affiliate links, which may earn a small commission at no extra cost to you, supporting future projects.

Tagi