Programming

Simple Optical Breadboard Raspberry Pi Support

Simple Optical Breadboard Raspberry Pi Support

An idiot admires complexity, a genius admires simplicity
– Terry A. Davis

The problem being solved here was having a Raspberry Pi streaming from a digital camera in an optical setup to a display. Just leaving the Pi dangling on the setup is cheap, sloppy. For prototyping, however, a beautiful enclosed mount is not only unnecessary but undesired, as it hinders probing and rewiring.

Within this context, the mount just has to hold the device, nothing else. Ideally, it shouldn’t take up breadboard real estate, as this is valuable. Also, being able to move (and remove) it around the setup easily, with no tools, is convenient.

Finally, in my prototyping philosophy moving fast is king. Developing and testing as fast as possible is more important than achieving a perfect, unattainable solution. Optmizations should always come later.

Fifteen minutes of CAD, fifteen minutes of 3d printing, and that was the result:

Here is the cadquery code that generates this object:

#!/usr/bin/env python3

import cadquery as cq
from cadquery.vis import show

# Part parameters
s_height = 60.0      # mm, support height above plate surface
s_width = 22.0       # mm, support width
s_thick = 12.0       # mm, support thickness

bt_thick = 8.0       # mm, bottom tab thickness // gap offset
plate_thick = 12.7   # mm, breadboard thickness
slot_depth = 16.0    # mm, how far the part "bites" the breadboard

ph_spacing = 49.0    # mm, pi mounting hole spacing
ph_offset = 6.0      # mm, pi hole offset from plate top surface

# Hardware parameters (counterbores)
screw_dia = 3.2
screw_cap_dia = 6.0

total_height = bt_thick+plate_thick+ph_offset+s_height

body_sketch = (cq.Sketch()
               .segment((0,0), (s_width, 0))
               .segment((s_width,0), (s_width, total_height))
               .segment((s_width, total_height), (slot_depth, total_height))
               .spline([(slot_depth, total_height), (0, bt_thick+plate_thick+ph_offset)],
                       [(0, -1), (-1, -1)], False)
               .segment((0, bt_thick+plate_thick+ph_offset), (0, bt_thick+plate_thick))
               .segment((0, bt_thick+plate_thick), (slot_depth, bt_thick+plate_thick))
               .segment((slot_depth, bt_thick+plate_thick), (slot_depth, bt_thick))
               .segment((slot_depth, bt_thick), (0, bt_thick))
               .close()
               .assemble()
               )

support = (cq.Workplane("YZ").placeSketch(body_sketch).extrude(s_thick/2.0, both=True)
           .faces("<Y").workplane()
           .pushPoints([(0, bt_thick+plate_thick+ph_offset),
                        (0, bt_thick+plate_thick+ph_offset+ph_spacing)])
           .cboreHole(screw_dia, screw_cap_dia, slot_depth+2.0)
           )

show(support)

The code is not much different then others seem before on this blog. The general protocol is the same as point and click CAD:

  1. Try to come up with a sketch that defines most of the object,
  2. Extrude it
  3. Apply the remaining 3d operations.

The most exotic line today, is the one that creates the spline:

  • A spline is defined by a list of points, and a list of vectors that will define the tangent line from this points. For example, this design has the spline starting at the top with a tangent line pointing down given by a [(0, -1)] vector and arriving at the end point with a line tangent at 45 degrees, given by a [(-1, -1)] vector.
.spline([(slot_depth, total_height), (0, bt_thick+plate_thick+ph_offset)],
        [(0, -1), (-1, -1)], False)

This is illustrated on the figure on the left. Just as a counter example, on the right figure we see the output if the vector at the end point would point straight in a negative direction along x axis [(-1, 0)].

spline example

The boolen False in the end is about the “periodic” argument. One uses

  • False → to get open curves, as in “draw a curve from A to B”
  • True → to get a closed loop, as in “draw a loop that comes back to A smoothly”

It is mandatory to pass one of the two as it will also tell the dispacther to use the overload method that takes tangents.

Some final photos of the mount in use:

Raspberry Pi Optical Breadboard Support Raspberry Pi Optical Breadboard Support 2

It did the job ! 😎

📎 Download: Raspberry Pi Optical Breadboard Mount