r/raspberry_pi • u/jpotter124 • 3h ago
Show-and-Tell My Raspberry Pi Camera Final Build (R1 Mini)
This will be a super long read so to those who get to the bottom then thank you!
Over the past month I have been working on this design and I now feel like it’s in a position where I can share how it was built, firstly I want to say that this is not a tutorial, there are a couple of things with the design that work ok after some tweaks but could be redesigned to work right after printing, therefore I want to treat this as a “how it was built” vs “how to build” post.
Exact specifications of the camera are as follows:
Case size: 100mm x 100mm x 100mm
Battery: 10,000mAh Mophie Powerstation
Camera module: Arducam IMX477 HQ
Mount: C/CS
Power output: 5V USB-C
Buttons: Sleep/Shutdown, FPS, ISO, W/B
Mainboard: Raspberry Pi 5 - 4GB RAM
Storage: 16GB SanDisk Micro SD
Ext Storage: Over 100mbps USB3.0 drive
Display: Waveshare 4” 720x720 HDMI
Battery life: Approx 8-9hrs idle - 5-6hrs Rec
Tilt sensor: MPU6050 accelerometer
Cooling: Raspberry Pi 5 Active Cooler
General design:
All parts were modelled in Autodesk Fusion with parts I mostly had on hand, I had to take extra care in adding ventilation to the correct places as I found the plastic to warp slightly if it got above 60 degrees, with the active cooler it now sits at no higher than 50-55 which is just on the limit but I haven’t encountered any issues so far. The battery sits on a “shelf” that is connected to the left side panel for easy access if disassembly is needed, a small cutout for the flat USB-C cable was also made so it also firmly holds the cable in place when removing or reinserting it. All side panels were made with a -1mm tolerance again for easier access when removing and M2 threaded heat inserts were used for all screws except the camera module. The Pi 5 and displays motherboard sit on another shelf at the bottom of the case which should allow for I2C usage for the screen (I couldn’t get mine to work for some reason but the pins align perfectly so I believe my unit may be defective for I2C), this allows for a cleaner design and lets the Pi sit higher for better cooling and IO access.
Assembly:
After all parts were printed, I installed M2 threaded heat inserts into the mounting points for the front, left, right and rear panels, also adding an additional 4 inserts for the display board and Pi 5 to screw into the case. The order of assembly was preparing the panels with their correct components such as for the front panel, screwing in the camera module and soldering the Dupont wires to the 3.3V Filament LED and press fitting it into the cutout at the top. I added a small drop of superglue to the wires to prevent them from pulling on the LED just in case. There is room to store any excess cable underneath the shelf that the Pi is mounted to so nothing should pinch against the case, I also made sure to connect both the USB-C power cable and HDMI to Micro HDMI adapter to the Pi (the adapter comes with the waveshare display and also fits perfectly as you can use the standoffs from the screen) and attached the displays USB-C power cable and routed it under the shelf at the bottom. The front panel was then able to be mounted using the 4 M2 screws.
I then moved to the rear panel as I needed as much access as possible for the GPIO pins so I left the side panels and display till last, I attached the 4 buttons and the USB-C output to the rear panel, for easier assembly I used a 60mm x 10mm magnet and attached all ground wires to it leaving one Dupont cable ground wire for the GPIO to prevent having too many cables in the system, all other cables were then routed to their correct GPIO pins, the USB-C output jack simply uses the 5V and any GND GPIO pin. Just for fun I also added a small vibration motor from an Xbox controller trigger to create a small haptic when a button is pressed or when a USB drive is inserted but this does need to be mounted to a part of the case and not a side panel. I then routed the cables as neat as possible in front of the GPIO (Making sure no wires come into contact with the active coolers fan) and mounted the panel to the case exactly the same as the front panel.
I then moved onto installing the display, out of the box the display and driver board are attached with very strong adhesive, I removed this from my unit so they were separate as it now sits under the pi, this is an EXTREMELY difficult task and I advise to take extra caution if you are to try this as you do run the risk of destroying the screen, the display also doesn’t use the typical DSI ribbon cable that connects to the pi, so you will need a 51-pin extension cable with a 0.3mm pitch followed by an adapter to reattach it to the screen. The extension cable can be routed again under the display board through the shelf so it comes out of the front of the unit and behind the camera module. For easier assembly I attached the extension cable to the driver board and then left the adapter attached to the screen. I then peeled the adhesive backing off and seated the screen into the top of the unit making sure to attach the cables in their correct orientation.
The left side panel was now ready to be installed making sure to insert the 90 degree USB ribbon cable from the display board into the lower USB2.0 Port on the Pi and flat USB-C cable from the Pi through the hole on the side of the battery shelf, this way the battery can be installed from the right side ensuring a snug fit once assembled, I left a very short amount of cable before sliding the battery in to make sure it had a cleaner look. (When sliding in the panel I had to make sure not to snag any cables including the display ribbon cable, I went through the right side of the unit to lift the display cable above the battery so it wouldn’t pull on them when it was slid into place. (I printed a small cover as seen on the left side of the unit to cover the USB plug for the screen)
Finally the right side panel needed to be prepared, this has a cutout for an extension button that connects to the Pi’s power button, this is where my design was slightly flawed, under load the Pi will sit at anywhere from 50-55 degrees, so as I printed my parts with PLA, I started to see the button warping and no longer making contact, I chose to print the button from ABS although I could have tweaked the design to make the button baseplate thicker as it is quite thin, however I haven’t seen any warping since using a different material. Since the button pivots up towards the Pi’s button, there is a small plastic block that holds the button in place at the very top of the button baseplate, this was mounted in the centre but again the button did not work correctly, since moving the block it works perfect every time.
Software:
The system runs ApertarOS which allows for easy external button management and also rotary encoders if you want to add any other accessories, it also features a Web GUI, WiFi management, multiple camera module support including IMX477, IMX585, IMX294 etc… and a magnitude of other features, to see everything related to the software check out their GitHub page as there has been so much development and time spent on making the software what it is now. There is great support for it too, any issues I encountered during setup or making adjustments were always solved by the community. The software is also updated fairly frequently to bring even more new features and bug fixes runs very smoothly on a 4GB Pi, Apertar do say you can potentially use a 2GB Pi but this is best used as a photo only camera.
https://github.com/Apertar-Studio
I made some tweaks to the software to map the buttons to their correct functions and GPIO pins, added a custom splash screen for the logo of my camera on startup and shutdown and also added the cameras name in the metadata of the images.
As mentioned above, there is a small vibration motor attached to the unit, this was made as a separate service on the Pi to detect button presses and emits a small 130ms pulse when a button is pressed, holding the ISO button for 2 seconds will send it back to “Auto” and subsequently the vibration motor will emit a 230ms pulse to indicate it is complete. When inserting a USB drive into the Pi again the motor will emit 2 400ms pulses. (Of course during recording the motor is disabled to prevent any frame shakes)
The status light also has a few functions such as blinking during recording and turning on and off when pressing the power button at the back. I removed the blinking during photo capture as it made no sense to have it anymore.
The power button at the back runs on a separate script, pressing once will make the display go into a “sleep mode” and pressing again will wake it up, as mentioned above the LED also turns on and off with the display, pressing and holding for 3 seconds will perform a safe shutdown on the Pi.
The supported resolutions for the IMX477 are 1332x990, 2028x1080 and 2028x1520, this is a limitation of that certain module, the IMX585 and IMX294 are both to my knowledge capable of 4K output. In 1332x990 and 2028x1080 modes you can select from 24,25,30,50 and 60 FPS however in 2028x1520 you can only select 24,25 and 30 FPS, again better modules will support higher framerates.
You also get the option to take still images as RAW DNG, PNG, TIFF, JPEG or to add a RAW DNG to any other file type. Video mode records in cDNG stills which can be compiled and edited through Davinci Resolve.
The camera also supports input and output devices although I have not tested them yet, I believe on my camera they will work through the USB3.0 ports.
As a final touch I added button labels to the back of the unit and a serial plate to the side with the Pi information, mount type, build date and revision number, then installed the Smallrig cheese plate to the bottom of the case, this is attached by 2 1/4-20 screws.
Again I would like to say I don’t class this as a tutorial but rather how I built it, if you decide to build one for yourself please DM me and I will be more than happy to send over the STEP files but please keep in mind that I have made some changes to the parts post printing so there are some things that may fit different or need tweaking. Also if I have missed out anything in this post please ask away in the comments and thank you for the positive feedback from my previous two builds! I will add pictures from the camera in the comments soon.
