Public Lab Research note


Assembling the Public Lab Lego Spectrometer

by warren , asnow , Bronwen | December 13, 2017 06:27 13 Dec 06:27 | #15360 | #15360

Follow these steps to assemble a Lego Spectrometer, for use with the Raspberry Pi camera.

This design builds on, and is version 4 of, the Desktop Spectrometry Kit. It is still a prototype! For more on Do-It-Yourself spectrometry, see this page; see more on the Lego Spectrometer Kit.

To order a kit, visit the Public Lab Store: Order a kit

Design files (including Lego Digital Designer files and parts lists) are kept here: https://github.com/publiclab/lego-spectrometer

1. Lay out your pieces

You should have 53 parts, of 10 different types:

  1. Four (4) 1 x 2 bricks - 3004
  2. Thirty three (33) 1 x 4 bricks - 3010
  3. One (1) 1 x 6 brick - 3009
  4. Two (2) 2 x 2 corner - 2357
  5. One (1) 4 x 6 plate - 3032
  6. Four (4) 6 x 8 plate - 3036
  7. Two (2) 2 x 4 45 slopes - 3037
  8. Four (4) 1 x 2 Technic brick with hole - 3700
  9. Two (2) 1 x 4 Technic brick with holes - 3701
  10. Three (3) Technic pins with friction ridges - 2780

Here are images of all the pieces in the order above:image description

Also see this page for links to 3D-printable models on Thingiverse and Tinkercad.

Assemble the case

The case is made of legos, in three levels, as shown here. It's designed to be rigid but to be made of as few different types of Lego as possible, and using cheaper pieces.

Note: the basic Webcam version of the kit will have an extra layer of bricks, which can be added at the end, to the bottom of this stack. We'll mention this again later in the activity.

image description

Level 1

Start with one of the 6x8 plates and use 5 1x4 bricks to enclose all but one side. Add a sloped piece as shown.

image description

On the other 6x8 plate, use four 1x4 bricks to line the sides only.

image description

At what will become the "front" of the spectrometer, add one 1x4 Technic brick with holes with one peg in the middle. Behind it, place a regular 1x4 brick (to stop light leaking in).

image description

Level 2

Start with a single 1x6 brick at the "back" of the box, and then add a second sloped piece to make a ramp -- this is where your camera will go.

image description

Use 1x4 bricks to continue the Level 2 walls to the front, but end with the L-shaped 2x2 bricks to create a narrower window at the front:

image description

In front of the L-shaped bricks, add two 1x2 Technic bricks with holes and pegs. This forms the locking interface with the sample holder, or any other "compatible" attachments.

image description

Level 3

Now use 10 more 1x4 bricks to line the top, but leave the back open for the camera cable, and double up the front for strength.

image description

Sample holder

Now take the 4x6 plate and use 3 1x4 bricks and 1 1x4 Technic brick with holes to make a first layer of walls.

image description

Use 4 of the 1x2 bricks and 2 of the 1x2 Technics bricks with holes to complete the second layer and the negative side of the pin "interface" -- see how they line up with the pegs on the main body? A hole is left at the back for light to shine in, although if you're doing some kinds of analysis (like #fluorescence), you'll want this hole on the side instead.

image description

Finish the 3rd level of the sample holder with 4 1x4 bricks, and snap it onto the main body.

image description

Here it is assembled! The hole on top is for sample containers -- like cuvettes. You may want to pad it with black paper or foam core to make a tighter fit for whatever sample containers you use.

image description

Add the slit

On the inside of the window of the main body, tape or glue the narrow slit we've printed on negative film. You can also make your own from two sheets of precisely cut paper or metal foil, or two razor blades. This ensures a sharp spectrum by only allowing a narrow beam of light into the box.

image description

Mount the camera at an angle

You can use permanent double-sided foam tape, or hot glue, to affix the camera to the slope. Once it's in the box it won't be moved around, but you want it to be firmly attached. Be sure the camera points at about 45° upwards, not directly at the slit. The shaft of light entering the box will be redirected by the DVD piece (the diffraction grating) and so the camera needs to be looking upwards at an angle to "see" it.

If your spectrometer doesn't "see" anything, try pointing the camera further upwards towards the top of the box.

Note for basic Webcam kit assembly

If you have a webcam instead of a Raspberry Pi camera, attach it here instead, although you may need to modify the box to fit it -- our Webcam kit includes an extra row of Legos to make your kit 1 row taller to fit the webcam.

Note: For the basic Webcam kit, we've found that adding the extra Legos as the first or bottom row works best, rather than adding them on top -- that way the camera lens and the slit are at the same height!)

image description

Here's the standard Raspberry Pi camera setup:

image description

Cut and split a slice of DVD

The DVD will act as a diffraction grating (like a prism) to redirect the beam of light, but also to separate out the colors.

Cut out a slice of DVD, peel off and discard the opaque mirrored layer, then cut the remaining transparent piece down to size as shown here (from the papercraft spectrometer instructions)

Note: don't cut off the curved outer edge, because it will help keep the DVD oriented correctly. Read on to see why.

image description

Attach the DVD to the camera

Tape or glue the DVD slice onto a piece of stiff black card paper (provided in our kit), or use Lego to make a frame if you like. You can even tape it directly to the camera -- just be sure it's very firmly affixed in place - I've used some very strong tape, but you can also use hot glue.

Be sure the outer edge of the DVD is at the top -- see the curvature in the image below as a guide.

image description

Now fold up and add the black paper liner included in the kit. This is really just a simple black box to add extra light-damping protection, especially where Legos may be shiny enough to cause reflections. We've included some black paper that is roughly the right size, but you can trim it down like this (shown on a 1/2 inch gridded background) and keep only the big piece. (Read more about the liner here. Design files for this piece can be found here.)

Note: This liner is helpful but not 100% necessary; also, any sheet of non-glossy black paper will work.

image description

image description

Now put the cover back on and seal up the end where the ribbon comes out, using some opaque tape. I could do a better job in this picture, but it's OK to illustrate the idea:

image description

Complete!

Now plug your Raspberry Pi into the camera cable and you're done with assembly! Download the camera software on our Pi Builder page or see this post by @partsandcrafts for instructions on setting up your Raspberry Pi to stream images over WiFi, or with the right cables you can plug in a monitor and keyboard and capture images that way.

If you have a Webcam kit, you can just plug in the webcam to your computer, and go to https://spectralworkbench.org/capture to begin.

complete

There are a lot of things we could refine about this, and we're hoping you'll share your setups and any new add-ons you develop.

Upgrades and next steps

We're hoping to simplify the process of connecting to the Raspberry Pi to fetch images. There's some great challenges and next steps posted on this page -- if you can help improve this open source kit, please pitch in!

If you modify the design at all, please leave a comment. And tell us what goes well or what goes wrong! Post a comment here or use this page to post questions, and help one another out as well -- we're a peer-driven community!

Thanks and good luck!


I did this Help out by offering feedback!


People who did this (1)



22 Comments

I just got a lego spectrophotomer "kit" a bag of some lego pieces, a slit, and a CD. Directions are online I guess and the buyer must supply the raspberry pi I assume.
$ 50 dollars for the above seems a little steep (actual cost $ 2 - 3?) and mailing cost of ~ $7 hard to believe for such a light package.
Am I missing something here?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


Hi @dcanprdn you're not missing anything, our initial pre-order was so that folks could get in early to start making their own and contributing to the project, and there are other variants of the kit coming soon. That said, we're sorry to hear you're frustrated with what you received! If you would like to drop us a line at kits@publiclab.org, our store manager can work with you to facilitate a return/exchange/unpgrade/etc.

Reply to this comment...


The parts manifest should show Four 6 x 8 plates - 3036 instead of one. I'm also pretty sure that building the illustrated item also requires two more 1 x 2 bricks - 3004 (for a total of six).

Reply to this comment...


Hi @jpschaaf You are right! The kits should come with 4 x 3036 plates, not one as mentioned above. Regarding use of the 3004 bricks, which step in the process are you referring to? Right now on my end I see a need for 4. Just to make sure, if you ordered a kit that arrived incomplete please email us at kits@publiclab.org so we can make it right!

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


@asnow -- I did not order a kit so nothing to worry about from that perspective; I just would like to see the page edited in case someone else gets the pieces from bricklink.

The two other short legos aren't strictly necessary, but are pictured just above where it says "using some opaque tape."

Reply to this comment...


So, I didn’t receive the black piece of cardboard. No big deal I can work with that. What is a problem is that I cannot see any way to connect the Raspberry Pi camera to the Raspberry Pi. The ribbon from camera is not compatible with the computer board and the cable provided with the Raspberry Pi is 40mm long so it’s not working. Have to say I’m a little disappointed. The idea of a kit is that it’s everything you need, now I’m scrounging pieces and ordering cables.

Reply to this comment...


Hi, @MoparWade, I believe @amanda followed up on this and sent a cable -- sorry -- this was an oversight. They went out a few days ago -- sorry, we actually had some trouble finding these at a reasonable price! I hope we figure out some better solution -- what a silly part to spend $3.50 each on. Apologies for the slowness!

Reply to this comment...


Your paper liner really sucks and doesn't fold well at all. I will be designing and 3D printing an opaque enclosure to replace most of the legos and paper liner. A much slicker solution that would probably be cheaper for y'all to manufacture than buying legos. Will have much tighter tolerances too. I suggest you guys switch to this!

Reply to this comment...


Hi, @rjboyd00, please don't use disrespectful language in any Public Lab space -- we work hard to preserve a respectful and welcoming environment, and we appreciate your help in maintaining it so. You can see our Code of Conduct at http://publiclab.org/conduct

Feedback is always welcome, of course, and I think a different choice of paper may make it easier to fold. Likewise your idea of printing an enclosure sounds cool and I encourage you to share your improvements on the site here.

Reply to this comment...


Hi spectrometrists :)

I've just ordered the Lego-parts and I'm going through the instructions now. I don't really follow the step:

"Tape or glue the DVD slice onto a piece of stiff black card paper (as provided in our kit), or use Lego to make a frame if you like. [..] Now fold up and add the black paper liner included in the kit."

Do I understand correctly: The grating frame is only affixed to the liner and this is loosely placed in the Lego casing. How will this provide a stable 65° angle and stable distance to the camera? Would it make more sense to fix the grating frame directly to the lego walls? Or is gluing the frame to the liner and the liner to the walls actually enough?

Also, I didn't find the blueprints for the liner anywhere. Did you make them available yet?

Thanks for your help, looking forward to actually building it :)

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


Hey! Before you tape the bit of DVD into your spectomoter, make sure that you soak the purple dye out and avoid leaving fingerprints. Here is a helpful link to MrBumper's post on the topic. https://publiclab.org/notes/MrBumper/01-11-2015/preparing-a-dvd-r-to-act-as-a-diffraction-grating

Reply to this comment...


Does anyone have some helpful advice on how to make sure the angles are right? I am using a usb camera, which means I had to add an aditional layer of legos. That means the black box lining doesn't really fit anymore and I am not sure if it also changed the angle of the camera?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


I think the best method I've seen is to actually assemble it and loosely attach the cover. Then see where the spectrum falls on the screen. You can adjust left or right by making the angle a little more or less, and this trial-and-error approach works pretty well!

On Tue, Sep 18, 2018 at 12:29 PM \<notifications@publiclab.org> wrote:

Hi! There's been a response to your research note 'Assembling the Public Lab Lego Spectrometer'. Do NOT reply to this email; click this link to respond:

https://publiclab.org/notes/warren/12-13-2017/assembling-the-public-lab-lego-spectrometer#c20706

khov wrote:


Does anyone have some helpful advice on how to make sure the angles are right? I am using a usb camera, which means I had to add an aditional layer of legos. That means the black box lining doesn't really fit anymore and I am not sure if it also changed the angle of the camera?


Look like spam? Mark this as Spam

Reply at: https://publiclab.org/notes/warren/12-13-2017/assembling-the-public-lab-lego-spectrometer#c20706

Report abuse to: moderators@publiclab.org

Check out the blog at https://publiclab.org/blog | Love our work? Become a Public Lab Sustaining Member today at https://publiclab.org/donate

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


Prepping the DVD is a HUGE pain.

Tried: Xacto knives Duct tape ( works but leaves residue ) Sticking it in the freezer Super glue doesn't work.

The best bet is to split the DVD down the seam ( so that you'd end up with 2 DVD shaped pieces ) and hope that the metallic film stays attached to the top ( the side thats printed on).

The bottom side is what you want.

STILL. An ENORMOUS pain.

Reply to this comment...


Hi! Sorry u had trouble... We've found that some DVDs (even in the same batch) are much harder than others for reasons we don't understand. Did you eventually get a big enough clear piece?

On Thu, Oct 11, 2018, 4:40 AM \<notifications@publiclab.org> wrote:

Hi! There's been a response to your research note 'Assembling the Public Lab Lego Spectrometer'. Do NOT reply to this email; click this link to respond:

https://publiclab.org/notes/warren/12-13-2017/assembling-the-public-lab-lego-spectrometer#c20859

carlcrott wrote:


Prepping the DVD is a HUGE pain. Tried: Xacto knives Duct tape ( works but leaves residue ) Sticking it in the freezer Super glue doesn't work. The best bet is to split the DVD down the seam ( so that you'd end up with 2 DVD shaped pieces ) and hope that the metallic film stays attached to the top, or the side thats printed on. The bottom side is what you want. STILL. An ENORMOUS pain.


Look like spam? Mark this as Spam

Reply at: https://publiclab.org/notes/warren/12-13-2017/assembling-the-public-lab-lego-spectrometer#c20859

Report abuse to: moderators@publiclab.org

Check out the blog at https://publiclab.org/blog | Love our work? Become a Public Lab Sustaining Member today at https://publiclab.org/donate

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


@warren

I did a few things differently:

  1. I opened up the webcam + stripped it of its black plastic housing

  2. I left the DVD in the freezer overnight -- this lessened the cracking on cutting, but might have made peeling the Aluminum harder.

  3. Definitely don't use acetone ... it demolished the grating

  4. The assembly directions might be out of order with the narrow-slit being installed prior to ensuring that the webcam is aligned + able to pickup a spectrum at all. I had to go back + remove the silt-filter and reposition the webcam to catch the correct light path. This might be solved by drilling + tapping a lego and including a screw to adjust the tilt of the webcam.

  5. Ive got a protocol for removing the aluminum foil which might be reproducible Im picking up more DVDs today to give it a try

  6. Alignment from the slit-filter to the webcam seems to be the biggest problem currently.

  7. Purchasing a CFL bulb has been a challenge as well.

  8. Final alignment ( light source >> slit-filter >> webcam ) is still up in the air. Not sure how complex its going to be

Reply to this comment...


Are there any cut out templates for the card papers used in this design?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


More questions:

1) Are DVD diffraction angles consistent? Could a spacer be designed that would correctly orient the camera with precision + repeatability?

2) Can the spectrometer be calibrated against a light source other than a Compact Fluorescent?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


These are great questions!!! I think DVDs are consistent but have no evidence to support it. I do think they're close enough for your spacer idea to work and I think it's really worthwhile. Would you post a prototype?

Another source might work although our autocalibration is based around a CFL. Maybe a green and red laser together could work? I believe you can do a manual calibration by manually entering a tag like "linearCalibration:______" or something. If you want to post a spectrum that has two known peaks i can try to help!

Thanks, great ideas and questions!!!

On Fri, Oct 12, 2018, 11:53 PM \<notifications@publiclab.org> wrote:

Hi! There's been a response to your research note 'Assembling the Public Lab Lego Spectrometer'. Do NOT reply to this email; click this link to respond:

https://publiclab.org/notes/warren/12-13-2017/assembling-the-public-lab-lego-spectrometer#c20893

carlcrott wrote:


More questions: 1) Are DVD diffraction angles consistent? Could a spacer be designed that would correctly orient the camera with precision + repeatability? 2) Can the spectrometer be calibrated against a light source other than a Compact Fluorescent?


Look like spam? Mark this as Spam

Reply at: https://publiclab.org/notes/warren/12-13-2017/assembling-the-public-lab-lego-spectrometer#c20893

Report abuse to: moderators@publiclab.org

Check out the blog at https://publiclab.org/blog | Love our work? Become a Public Lab Sustaining Member today at https://publiclab.org/donate

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


This is really great feedback, and excellent for others looking to assemble the kit. Great work, and thanks for sharing, Carl!

On Thu, Oct 11, 2018 at 2:06 PM \<notifications@publiclab.org> wrote:

Hi! There's been a response to your research note 'Assembling the Public Lab Lego Spectrometer'. Do NOT reply to this email; click this link to respond:

https://publiclab.org/notes/warren/12-13-2017/assembling-the-public-lab-lego-spectrometer#c20879

carlcrott wrote:


@warren I did a few things differently: 1) I opened up the webcam + stripped it of its black plastic housing 2) I left the DVD in the freezer overnight -- this lessened the cracking on cutting, but might have made peeling the Aluminum harder. 3) Definitely don't use acetone ... it demolished the grating 4) The assembly directions might be out of order with the narrow-slit being installed prior to ensuring that the webcam is aligned + able to pickup a spectrum at all. I had to go back + remove the silt-filter and reposition the webcam to catch the correct light path. This might be solved by drilling + tapping a lego and including a screw to adjust the tilt of the webcam. 5) Ive got a protocol for removing the aluminum foil which might be reproducible Im picking up more DVDs today to give it a try 6) Alignment from the slit-filter to the webcam seems to be the biggest problem currently. 7) Purchasing a CFL bulb has been a challenge as well. 8) Final alignment ( light source >> slit-filter >> webcam ) is still up in the air. Not sure how complex its going to be


Look like spam? Mark this as Spam

Reply at: https://publiclab.org/notes/warren/12-13-2017/assembling-the-public-lab-lego-spectrometer#c20879

Report abuse to: moderators@publiclab.org

Check out the blog at https://publiclab.org/blog | Love our work? Become a Public Lab Sustaining Member today at https://publiclab.org/donate

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


I did this!

Reply to this comment...


I did this!

Reply to this comment...


Login to comment.