I personally did not want to leave on my Raspberry Pi 4, running an instance of OctoPrint, all the time. Therefore, I decided to create a power button to attach to my i3 frame. While designing and testing I also realised that I did not want the fan to be turned on all the time either, so I included a NPN transistor as well!
The resistor and transistor can of course be switched out for something similar, depending on what you have laying around. I have also added a wiring schematic. As you can seem only 4 out of 5 pins are connected.
To get everything to work, you have to add the following lines of code to /boot/config.txt:
dtoverlay=gpio-shutdown,gpio_pin=3,active_low=1,gpio_pull=up
dtoverlay=gpio-fan,gpiopin=4,temp=55000
The first line configures the power button. The second line turns the CPU-fan on when the CPU reaches a temperature of 55°C. The temperature and GPIO-pins can be adapted, depending on your configuration.
All models were printed in PETG at 0.2 mm layer height and 15% infill, oriented according to the 3mf-file.
For my Raspberry Pi 4 case, I have used a model from Thingiverse by brawfx. I have removed some of the honeycomb pattern to fit the larger Dupont-connector.
The camera mount I used was modelled by TinkrMakr.
I hope this print can be useful for others the way it has been for me. Any remarks or ideas for improvement are always welcome!
The author remixed this model.