Picture - the 3D Printed Raspberry Pi Camera.

by Greg_The_Maker in Circuits > Raspberry Pi

19015 Views, 151 Favorites, 0 Comments

Picture - the 3D Printed Raspberry Pi Camera.

IMG_7212.JPG
IMG_7213.JPG
IMG_7150.JPG
camera.jpg
snappicam.jpg

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.

IMG_7136.JPG
IMG_7143.JPG
IMG_7135.JPG
IMG_7139.JPG
IMG_7137.JPG
IMG_7141.JPG
IMG_7142.JPG
IMG_7138.JPG
IMG_7144.JPG
IMG_7145.JPG

You'll need to gather up the following parts and equipment before beginning your Picture Camera...


Electronics.


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.

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 :)

eBay.com | eBay.co.uk | eBay.fr | Amazon.co.uk

Equipment Test.

IMG_7116.JPG
IMG_7117.JPG
IMG_7119.JPG
IMG_7121.JPG
Raspberry-Pi-GPIO-pinouts.png
IMG_7130.JPG
IMG_7124.JPG
IMG_7129.JPG

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.

grabs_0000_Layer 1.jpg
grabs_0001_Layer 3.jpg
grabs_0002_Layer 4.jpg
grabs_0003_Layer 5.jpg
grabs_0004_Layer 6.jpg
grabs_0005_Layer 7.jpg
grabs_0006_Layer 8.jpg
grabs_0007_Layer 9.jpg
grabs_0008_Layer 10.jpg
grabs_0009_Layer 11.jpg
grabs_0010_Layer 12.jpg

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.

grabs_0011_Layer 13.jpg
grabs_0012_Layer 14.jpg
grabs_0013_Layer 15.jpg
grabs_0015_Layer 17.jpg
grabs_0017_Layer 20.jpg
grabs_0014_Layer 16.jpg
grabs_0020_Layer 23.jpg
grabs_0022_Layer 25.jpg
grabs_0023_Layer 26.jpg
grabs_0024_Layer 27.jpg
grabs_0025_Layer 28.jpg
grabs_0026_Layer 29.jpg

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.

grabs_0027_Layer 30.jpg
grabs_0028_Layer 31.jpg
grabs_0029_Layer 32.jpg
grabs_0030_Layer 33.jpg
grabs_0031_Layer 34.jpg
grabs_0032_Layer 35.jpg
grabs_0033_Layer 36.jpg
grabs_0034_Layer 37.jpg
grabs_0035_Layer 38.jpg
grabs_0036_Layer 39.jpg
grabs_0037_Layer 40.jpg
grabs_0038_Layer 41.jpg

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.

grabs_0038_Layer 41.jpg
grabs_0039_Layer 42.jpg
grabs_0040_Layer 43.jpg
grabs_0041_Layer 44.jpg
grabs_0042_Layer 45.jpg
grabs_0043_Layer 46.jpg
grabs_0044_Layer 47.jpg
grabs_0045_Layer 48.jpg
grabs_0046_Layer 49.jpg
grabs_0047_Layer 50.jpg
grabs_0048_Layer 51.jpg
grabs_0049_Layer 52.jpg
grabs_0050_Layer 53.jpg
grabs_0051_Layer 54.jpg
grabs_0052_Layer 55.jpg
grabs_0053_Layer 56.jpg
grabs_0054_Layer 57.jpg
grabs_0055_Layer 58.jpg
grabs_0056_Layer 60.jpg
grabs_0057_Layer 59.jpg
grabs_0058_Layer 61.jpg
grabs_0059_Layer 62.jpg
grabs_0060_Layer 63.jpg
grabs_0061_Layer 64.jpg

Remember to make a channel for the camera's FFC.

I went with 1mm thick and 1mm on each side.

More Layers.

grabs_0061_Layer 64.jpg
grabs_0064_Layer 67.jpg
grabs_0065_Layer 68.jpg
grabs_0068_Layer 70.jpg
grabs_0069_Layer 74.jpg
grabs_0071_Layer 75.jpg
grabs_0073_Layer 77.jpg
grabs_0075_Layer 79.jpg
grabs_0081_Layer 85.jpg
grabs_0083_Layer 88.jpg
grabs_0085_Layer 89.jpg
grabs_0087_Layer 91.jpg
grabs_0089_Layer 93.jpg
grabs_0091_Layer 95.jpg
grabs_0092_Layer 96.jpg

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.

grabs_0093_Layer 97.jpg
grabs_0095_Layer 99.jpg
grabs_0098_Layer 102.jpg
grabs_0101_Layer 105.jpg
grabs_0103_Layer 107.jpg
grabs_0104_Layer 108.jpg
grabs_0105_Layer 109.jpg
grabs2_0000_Layer 1.jpg
grabs2_0001_Layer 2.jpg
grabs2_0002_Layer 3.jpg
grabs2_0003_Layer 4.jpg
grabs2_0004_Layer 5.jpg

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.

grabs2_0005_Layer 6.jpg
grabs2_0006_Layer 7.jpg
grabs2_0007_Layer 8.jpg
grabs2_0009_Layer 10.jpg
grabs2_0010_Layer 11.jpg
grabs2_0011_Layer 12.jpg
grabs2_0012_Layer 13.jpg
grabs2_0013_Layer 14.jpg
grabs2_0014_Layer 15.jpg
grabs2_0015_Layer 16.jpg
grabs2_0016_Layer 17.jpg
grabs2_0017_Layer 19.jpg

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.

s3d.jpg
IMG_7150.JPG
IMG_7151.JPG
IMG_7152.JPG
IMG_7153.JPG
IMG_7154.JPG
IMG_7156.JPG
IMG_7155.JPG

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.

grabs2_0019_Layer 20.jpg
grabs2_0020_Layer 21.jpg
grabs2_0021_Layer 22.jpg
grabs2_0022_Layer 23.jpg
grabs2_0023_Layer 24.jpg
grabs2_0024_Layer 25.jpg
grabs2_0025_Layer 26.jpg
grabs2_0026_Layer 27.jpg
grabs2_0027_Layer 28.jpg
grabs2_0028_Layer 29.jpg

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.

Picture Camera Printing!
IMG_7178.JPG
IMG_7157.JPG
IMG_7158.JPG
IMG_7159.JPG
IMG_7160.JPG
IMG_7161.JPG
IMG_7162.JPG
IMG_7163.JPG
IMG_7164.JPG
IMG_7165.JPG
IMG_7166.JPG
IMG_7167.JPG
IMG_7168.JPG
IMG_7169.JPG
IMG_7170.JPG
IMG_7171.JPG
IMG_7179.JPG
IMG_7180.JPG
IMG_7181.JPG
IMG_7182.JPG
IMG_7183.JPG
IMG_7185.JPG
IMG_7186.JPG
IMG_7189.JPG
IMG_7191.JPG
IMG_7192.JPG
IMG_7193.JPG
IMG_7194.JPG
IMG_7198.JPG

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!

IMG_7201.JPG
IMG_7212.JPG
IMG_7204.JPG
IMG_7206.JPG
IMG_7213.JPG
IMG_7207.JPG

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.

IMG_7208.JPG
IMG_7209.JPG
IMG_7214.JPG
IMG_0019.JPG
IMG_0008.JPG
IMG_0012.JPG
IMG_0014.JPG

Remove the detachable tripod bracket from your tripod, screw it to the base of your Picture camera and pop it onto the tripod.


Enjoy :)