DIY Raspberry PI 5 Case

by philipmp744547 in Design > 3D Design

110 Views, 0 Favorites, 0 Comments

DIY Raspberry PI 5 Case

IMG_8428.JPG

I love the raspberry pi 5. I use mine every day. The official case wasn't keeping my pi cool with my workflows that I do on my pi. Sooooo I made my own.

Supplies

Raspberry pi 5

raspberry pi m.2 hat

Raspberry pi 5 active cooler

HDMI/power delivery board

.96" I2c display

80mm fan

leds

m3 brass knurled threaded inserts

m3 bolts

screws that fit the raspberry pi's mounting holes

The Official Case

For a year I used the official pi case. Its alright but when I got my m.2 and put that in the case I soon found that I would easily overheat my pi. The fan on the active cooler gets very annoying around 7000rpm so when it runs hot you hear the fan wine. For a while I had my m.2 hat outside of the case so that my pi wouldn't over heat. I did some baseline testing with the official case. I ran a geekbench 6 test in the case, during this case the cpu hit 80 degrees Celsius, the fan was spinning at 9683 rpms. That's what I had to beat.

My Design

I wanted some future-proofing in this case. I also wanted a large intake fan to keep my pi cool. This case features a plate that the pi and the 2 hats screw to. this will allow me to in the future unscrew that plate and make a new one if i ever want to change my hardware. The case is deep for 2 reasons. the first is the 80mm fan in the top. the second reason why this case is this deep is a future upgrade I want to do is adding an ice tower cooler so i wanted to accommodate room for that. Another upgradeable feature of this case is the io sheild. that pops in so if i need another port or i change something i can remake that not the entire case. To make my designs I used Fusion 360 and Autodesk Inventor.


Downloading

For downloading this case go to https://makerworld.com/en/models/2726823-raspberry-pi-5-case

you will need all 12 files to make this.

3D Printing

for most of the case i used PLA 3d printer filament. For the "motherboard" plate i used ABS, since the pi is right on top of that i figured the extra heat might cause it to warp a bit. For the highlights I had some transparent PETG and i used that. Feel free to use whatever filament you have. for my printer settings I did 15% infill.

Assembly

IMG_8300.JPG
IMG_8308.JPG
IMG_8313.JPG

Once you have all of the peaces printed off its time for assembly. I washed mine before i put it together but again do as you think best

There is 13 brass threaded inserts in this case. There is 5 in the back plate, 6 in the top plate, and 2 in the base plate. to insert them I used my soldering iron

To hold the peaces together i used hot glue and my soldering iron. make sure that they are square, if they aren't then the edges wont line up correctly and it wont look good.

Don't fuse in the "pains" or the io shield. They are meant to be removable for upgrades. The hole in the smaller "pain" is for a power button. I don't have it installed on mine but its there as an option.

For the bezel, don't fuse it to the case. There is a peace of acrylic in it. it will be a peace that is 5" by 7". slide the acrylic in before the last side goes on then fuse the last side in and the acrylic will look nice with a frame around it. the side you just made gets 4 m3 bolts and it will bolt tight onto the case when you are ready for it to go on.

The motherboard plate gets 5, m3 bolts to hold it to the back

the fan goes in a intake position. you will only be able to get 3 bolts in but that is plenty to hold it.

the I2c display needs to have its pins on the bottom, not the top.

Behind the highlights in the front of the case there is 10 holes. They are for leds. on mine the shine nicely through the purple highlights while lighting up the inside of the case.

Code

This case has a spot for an I2c .96" oled display, lets go over the code for it. This code is for Ubuntu 25.10, to put it on raspberry pi os, you will have to make it your self. On my display i'm running a btop like interface so that i can watch my system status with out an app taking up my main monitor.

The first step is to check if I2c is inabled, do so with ls /dev/i2c-*

Once I2c is enabled we are going to install some tools and permissions so that the display can talk with the pi. run this code to do so. sudo apt update

sudo apt install -y i2c-tools python3-pip python3-dev python3-pil python3-smbus

You will also need to add your user to the I2c group, do so with sudo usermod -aG i2c $USER

This is when you will plug in your display. on your display it should have 4 pins, they should be labled vcc, gnd,sda,scl. The sda will go to GPIO pin 2 and the scl will go to gpio pin 5

Check to make sure it is connected with i2cdetect -y 1. you should see 0x3C (most common)

now its time to install packages. pip3 install --break-system-packages luma.oled psutil

after everything is installed it is time to make your python script. in terminal run nano i2c_stats.py

this will take you to the new file that are going to make.

the next step is to past in the code:

from luma.core.interface.serial import i2c

from luma.oled.device import ssd1306

from luma.core.render import canvas

import psutil

import socket

import time


serial = i2c(port=1, address=0x3C)

device = ssd1306(serial, rotate=2) # 180° flip


def get_ip():

try:

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

s.connect(("8.8.8.8", 80))

ip = s.getsockname()[0]

s.close()

except:

ip = "No Net"

return ip


def get_temp():

try:

with open("/sys/class/thermal/thermal_zone0/temp") as f:

return f"{int(f.read())/1000:.1f}C"

except:

return "N/A"


while True:

cpu = psutil.cpu_percent()

mem = psutil.virtual_memory().percent

net = psutil.net_io_counters()

ip = get_ip()

temp = get_temp()


with canvas(device) as draw:

draw.text((0, 0), f"CPU: {cpu}%", fill=255)

draw.text((0, 10), f"TEMP: {temp}", fill=255)

draw.text((0, 20), f"RAM: {mem}%", fill=255)

draw.text((0, 30), f"TX: {net.bytes_sent//1024}K", fill=255)

draw.text((0, 40), f"RX: {net.bytes_recv//1024}K", fill=255)

draw.text((0, 50), f"IP: {ip}", fill=255)


time.sleep(1)


once you have pasted this in use ctrl x to exit, hit y to save and enter to exit.

now it is time to start the program, sudo python3 i2c_stats.py

you should see your cpu usage, cpu temp, memory, network usage, and ip

you can make the display show what ever you want this is just what i did.

Conclusion

IMG_8428.JPG

I have used my case for about a month now and i haven't had any issues with my pi over heating. the hottest I've had it get was 73 degrees c. I enjoyed making this case and i hope you enjoy using your case!