This is a project that my son and I did. It was inspired by:
(the io shield is actually just his brought over ... no need to redesign that part.)
However, we wanted the Pi to control the fans as well as the printer power.
I'd love to say we carefully measured the hole in the case, but reality is that we placed the mounted pi in place, marked one corner (above the USB port) on the inside, cut through, then used that as a reference to cut the 54x20mm hole on the outside. Likewise, once the hole was cut we put epoxy on the mount and placed it where it needed to be (using the pi itself as a reference). We epoxied the buck converter mount to a sidewall out of the way.
Once you have your parts, connect the Buck Converter to a 12v DC powersource and connect the output to a multimeter and adjust the power to be 5.0v DC to power both the Pi and the Relay board.
Then hook the rest up as described in the wiring diagram. Connect the main power line from the CR-10 to relay 1 center post and use 16 guage wire to connect relay 1 to the main power on the motherboard. Then use the smaller wires to connect everything else.
We used the following parts:
Raspberry Pi 3b:
4 channel relay:
While we were in there, we swapped out the 40mm case fan and the 50mm cooling fan with quieter ones (specifically these):
Between everything that used to be hardwired (the fans, the buck converter, etc) we installed disconnects:
to jump from the raspberry pi to the relay we used these:
(those last two can be bought in less bulk but my son is studying electronics so we bought lots)
Motherboard connections are explained in this video:
The relay with the pi (and some starter scripts) are explained in this video:
I used #4 machine screws as I could not get 2.5mm screws long enough to go through the spacers.
Get confident with the relay board
Watch the video in the summary. Connect the Pi to a powersource, wire up the relay as shown in the video ... Make sure it all makes sense.
Design the mounting brackets
We measured boltholes in the boards. We made sparse mounting plates to epoxy to the inside of the CR-10. We designed standoffs to raise the realy above the pi. We cut out a section of the relay mounting board to expose the GPIO pins.
Wire everything up
This is the scary part. Be sure to disconnect power. Be sure to reconnect everything carefully when you're done.