Picture - the 3D Printed Raspberry Pi Camera.
by Greg_The_Maker in Circuits > Raspberry Pi
18989 Views, 151 Favorites, 0 Comments
Picture - the 3D Printed Raspberry Pi Camera.
Way back at the beginning of 2014 I published an Instructable camera called the SnapPiCam. The camera was designed in response to the newly released Adafruit PiTFT.
It's been well over a year now and with my recent foray into 3D printing I thought now was a good time to revisit the SnapPiCam and reinvent it as a 3D printable camera using newer and better parts ;)
I have called the new camera the Picture.
The Picture Camera won Second Prize in the Raspberry Pi Contest! Thanks for all your votes and a well done to all the entrants :)
Please help support my work, your donations really do make a difference.
http://ko-fi.com/gregthemaker
Camera Components.
You'll need to gather up the following parts and equipment before beginning your Picture Camera...
Electronics.
- Raspberry Pi Model A+
- Adafruit PiTFT 2.8" TFT 320x240 + Capacitive Touchscreen
- Adafruit PowerBoost 1000 Charger
- Adafruit Lithium Ion Polymer Battery - 3.7v 2500mAh
- Raspberry Pi Camera & FFC (I used an alternative Omnivision OV5647 based compatible camera board).
- Adafruit Miniature WiFi (802.11b/g/n) Module
- 8gb or more MicroSD Card
- Miniture 19mm Slide Switch
- 1/4-20 UNC Brass Insert (optional).
- Adafruit Tactile Switch Buttons (optional)
Hardware.
- 4 x M3 16mm Screws (silver)
- 8 x M3 16mm Screws (black)
- 4 x M4 Half Nuts
- 4 x M3 20mm Female-Female Brass Spacers
General.
- 2 x Female DuPont Pins
- Cable
- Heat-Shrink
3D Printed Parts.
- Attached are STLs of the seven printable parts orientated for printing and with a 0.5mm chamfer on the lower edges to help reduce elephants foot (picture_STL.zip).
- The original 123D Design file is attached (picture.123dx).
- Along with STEP files for the entire model (picture_STEP.stp).
Tools & Equipment.
- BigBox 3d Printer
- Multibox PC
- 123D Design
- Soldering Iron
- Crimps
- Allen Keys
- Small Hammer
- Pliers
- Ruler
- Craft Knife
- A suitable work|space
Once you're sure you have everything you need, we can begin.....
Please help support my work here on Instructables and on Thingiverse
by using the following affiliate links when making purchases. Thanks :)
Equipment Test.
I learnt a long time ago now that it is best to check the electronics before starting on any design work.
It can be very disheartening if you go through all the motions of design and assembly to find that when it comes time to turn things on nothing works!
Firstly solder in the GPIO header and tactile switches to the LCD's PCB. I have removed the LCD panel itself to make things a little easier.
Next you'll need to run through Adafruit's DIY WiFi Raspberry Pi Touchscreen Camera Tutorial to setup the software. I had the advantage of having a Multibox PC with a Raspberry Pi 2 fitted enabling me to install and configure all the software on it rather than fighting with the Model A+ limitations. I setup the optional Power Switch and the DropBox functions for the camera. I recommend the auto load function too.
While the software is doing it's thing we can solder some wires.
The PowerBoost 1000 has an enable pin on the PCB cunningly labelled EN. Connecting a wire to EN and the other end to a switch and then back to GND on the PowerBoost means that we can control the power output and turn the camera on and off.
Next we need to take power from the PowerBoost to the Raspberry Pi. We're going to put the power into the Pi via the GPIO and not with the usual MicroUSB power socket. We don't want a cable sticking out the side of the camera all the time.
We need to choose the correct pins into which we can supply power, there is a helpful GPIO Cheat Sheet available from RasPi.Tv and checking the sheet we can connect +5v to Pin-4 and GND to Pin-6.
Now we solder things together. EN & GND from the PowerBoost to the switch, +5v & GND from the PowerBoost to the Raspberry Pi GPIO.
Plug in the LiPo battery to the PowerBoost, plug in a MicroUSB charger to the PowerBoost and let the battery charge a little while you sort out the software.
Once the MicroSD card is ready you can plug it into the Model A+ and turn it on. If everything went well you should see things on the little LCD.
If you're happy everything is working as it should we can move on.....
To Begin | 3D Modelling.
I'm going to be using 123D Design to model all the 3D printable parts. If you don't already have it grab it for free from their website at http://www.123dapp.com/design I'll try to explain my methods but if you need to run through the basics there are plenty of tutorials to get you started.
The first thing I always do is find a suitable datum, the point from which all other measurements are made and the starting point for this project. In this case as we are using the Raspberry Pi Model A+ I have chosen the four M2.5 mounting holes are my first point of reference; the datum.
I measured the distance between the mounting holes and made a rectangle in 123D Design from those measurements. On each corner of the rectangle I put a 1.25 radii cylinder. We now have the datum we need to work from.
Next measure the board dimensions of the Model A+ and create a rectangle to represent it. You can align the PCB shape to the mounting-hole reference rectangle using the snap tool. From there go around the RPI and measure all the major components adding them to the model as you go along. I plugged in and included the WiFi dongle as part of the Model A+ model.
Repeat this process for each of the electronic components until you have them all modeled in 123D Design.
I did a rough mock up of where I wanted all the components to be in the camera.
Building the Case | the LCD.
Firstly to make things a little easier I've given each component a colour using the material tools. Play around with the layout positioning each component in the orientation you want them. I added in four pillars to represent where I wanted the case screws to go.
Mechanical Sculpting.
I use the square solid in 123D Design to sculpt a case for the LCD. Place a basic 20x20x20 solid onto a face of the LCD model. Using the Pull function move the edges to encompass the LCD PCB, the LCD, the LCD's buttons and the four proposed case screws.
Create a copy of the LCD and move it away from the assembly for the moment.
With the remaining LCD increase the length of the LCD and the buttons so they protrude through the solid. You can use the Pull tool to do this.
Now using the subtract tool, subtract the LCD from the solid you just created. This should leave an indent of the LCD in the solid and leave cut-out for the LCD & Buttons.
Move the copied LCD back into place.
You can move the new solid away from the assembly a little so you can get a better look. I added a 1mm x 1mm ridge around the inside of the LCD cut-out which will keep the LCD from falling out.
Optional Tripod Mount.
I have a spare 1/4-20 UNC Brass Insert knocking around from another project. It just so happens to be the correct thread for standard tripod mounts. Seeing a great opportunity I added in a section for the brass insert on the base of the camera.
The Next Level.
Using the same method of adjusting a basic 20x20x20 solid we can build the next layer.
The PCBs are held into slots in the layers so there is no need for any screws apart from the four case screws.
There are only two pairs of cables too so the system is very simple and great to work with. You'll just have to spend some time making space for all the components and checking PCB thicknesses.
Surgery.
Remember to make a channel for the camera's FFC.
I went with 1mm thick and 1mm on each side.
More Layers.
Keep building up the case to enclose all the components. Remember to make space for the components on the layers above them as well as under them.
The Front.
The front of the camera is open to some artistic interpretation of what a camera should look like. I wanted the lens cover to be removeable so I put four M3 half nuts into one of the layers and made space for some matching M3 screws to hold the lens cap.
The final touch was adding the Picture name to the front and rounding off the cameras corners.
Final Touches.
I've used a small cylinder to create a little opening for fingers to insert and remove the MicroSD Card from the Model A+.
I started to create holes for the PowerBoost LEDs to shine through so it would be easy to see the power and charge status, but midway through doing the necessary work, mostly because I didn't like the cut-out idea, I hit on the other possibility of printing the case in a transparent material instead. That way I could just leave the case as it was :)
I must admit I was a little stuck about how to screw the case together. I didn't want threads poking out of nuts on the back and I really liked the recessed cap screw look at the front. Naturally I wanted the same on the back.
After a little bit of pondering I had a thought of how to tackle it...
The idea stemmed from an area I was looking at in the design of the BigBox's electronics mounting where we use PCB stand-offs to raise the Rumba board off the printer's base plate. I had seen stand-offs with female thread at both ends and though I could put a stand-off in each corner and just screw into them from the front and the rear. That would mean there would be no nasty nuts or bare threads poking out!
I made hexagon holes in a few of the inner layers where I would put in a 20mm M3 female-female brass stand off. Lastly I set the material for the case to glass so it would be transparent.
First Print & Test Fitting.
Print.
123D Design can export STL files for use with slicers. I use Simplify3D but there are many others including Cura and Repetier.
Once the STLs have been exported we can import them into our slicer. Slice the files and generate the G-Code for printing. I've used Natural PLA for the first test print. It took about 10 hours to print all the parts.
Test Fit.
Go through the assembly process and check all the holes conform to the components, that the camera FFC fits through the slot and that the LCD and buttons align correctly.
I found that the cut out for the tripod mount didn't work very well so we'll fix that and a few other issues in the next step.
Corrections.
The bump in the LCD layer for the brass insert needs altering. The plan is to move it to the largest section into a suitable space where it won't interrupt with anything.
The first step is to remove the old housing. It is a simple process of subtracting the unwanted section.
Next move the model off the brass insert to where it is wanted and create a new slot with the subtract tool.
I had to play around a little with the holes for the LCD buttons to get things nicely aligned.
Final Assembly.
I've reprinted the parts in transparent Natural PLA with the exception of the front cover which been made with transparent red M-ABS and the lens cover is in black PLA.
Now it is time to put the camera together!
To the power cable from the PowerBoost I crimped Female DuPont connectors. I didn't fit the usual plastic housing on then as they are too long to go in the space between the LCD & Raspberry Pi. Covering them with a length of heat-shrink will stop them shorting on anything should they move around a little.
I found giving the FFC a little bit of a curve made it much easier to feed through the slots.
You can reduce the length of the battery cable if you like but make sure you either keep the old kapton tape or ideally replace it with new tape.
Fit the screws and brass stand-offs to finish the camera. Next we'll power it up.
Power On!
Slot in the MicroSD Card, give it some juice for a bit if you think the battery might be low, then when you're ready, slide on the power switch.
The screen will go white for a few seconds while the system boots up, the boot sequence should come on screen pretty quick.
After it has loaded up navigate through the menus and set the Storage option to DropBox, or where ever you like!
Go take some photos!
You can turn the camera off by exiting the software (via the settings menu), then press the power button on the LCD. Finally when Power Down comes on the LCD you can kill the power with the slide switch. Alternatively while in the software press the power button on the LCD and wait until the camera screen is unresponsive. Give it a few seconds longer and then turn off the power with the slide switch.
Mounting to a Tripod & Sample Images.
Remove the detachable tripod bracket from your tripod, screw it to the base of your Picture camera and pop it onto the tripod.
Enjoy :)