Welcome to the SpectraCam project page hosted by Walla Walla University. This project was developed and is maintained by Dr. Tom Ekkens. If you have comments or suggestions please send email to Tom.Ekkens@wallawalla.edu. This page was last updated on August 19, 2018.
Revision 5 of the SpectraCam uses simple tooling and PVC parts to make the spectrometer. Now that 3d printers are common and cheap, the build process was refined to put some of the work on the 3d printer. The resulting Revision 6 is faster to assemble and uses fewer parts.
|1½ ABS cap||012871529771||$2.56||Home Depot|
|11” of 1½" pvc conduit||722669||$4.77||Home Depot|
|ABS "Camera holder"|
|M2 x 4mm socket cap screw||532512 SHB||$1.26||Amazon|
|USB 2MP webcam||JDEPC-OV05||$30.00||Public Labs|
|Flat Black paint||020066197674||$3.63||Home Depot|
|Plastic Diffraction Grating||1000 lines/mm||$5.00||Ebay|
|Black Card Stock||759598993705||$8.26||Walmart|
- Remove the lens from the camera.
- Turn the lens housing over and remove the reddish glass.
- Spray with compressed air to clean and reassemble the lens to the camera.
- Plug in the usb camera to a computer running Windows 10 - 64 bit.
- Copy “SpectraCam.exe” and “opencv_world330.dll” to the computer. The file “opencv_world330.dll” is part of the OpenCV 3.30 package. The file “SpectraCam.exe” can be obtained by emailing the author of this page at the address above.
- Start SpectraCam and press “Start”. Once the image is live, right click on the image and check “Full Image”. If you do not see a picture, change the USB Port from 0 to 1.
- Once you have a good image, set the focus to about 12 inches. Work slowly, the image is averaged over a few seconds.
- Prepare the diffraction grating.
- Cut a 5 mm x 5 mm piece of diffraction grating to fit over the camera.
- Orient the diffraction grating so that light is bent along the long axis of the camera board.
- Put a tiny bit of black paint on the camera housing and glue the diffraction grating down to the top of the camera. Do not get so much paint on that the camera hole is covered.
- Drill a hole in the center of the ABS cap.
- Use a 0.0217” drill bit and try to put the hole as close to vertical at the exact center as possible. Be aware that the drill bit is very fragile.
- Use a 0.0276” drill bit by hand to make the hole a bit bigger.
- The completed part is shown in the picture below with the location of the hole indicated by the red arrow.
- Use a saw to cut a piece of 1½ inch PVC conduit to a length of 11”. (This lets one sheet of paper sit in the tube without bumping.) Smooth the ends of the cut if desired.
- 3D print the camera housing.
- Start with the file “Camera Holder R11.STL” and print it from ABS.
- Once the print is done, tap the two holes with a 2 mm tap.
- Roll a piece of black 8.5” x 11” cardstock up and slide it into the tube.
- Slide the PVC cap unto the tube and lightly push it down.
- Attach the cable to the camera and bend it around the left side of the camera.
- Slide the camera into the camera holder so that it fits in the slot and the plug is held down by the finger.
- Attach the camera to the holder using a single M2 metric screw.
- Push the cable into the cable slot as shown in the picture at right.
- Push the camera housing onto the tube.
- Start the software and press “Start”. Once the image is live, right click on the image and check “Full Image”.
- Aim the tube a fluorescent light. You should see a picture similar to the one at the right.
- If the colored dots are not close to a horizontal line, you will need to rotate the camera focus knob slightly to get them as close to horizontal as possible.
- Once the dots are horizontal, remove the camera from the housing and apply two dots of paint at the top and bottom edges of the diffraction grating to hold the diffraction grating down better.
- Apply a spot of hot glue to the lens/housing interface to keep it from moving.
- Once the glue and paint is dry, reassemble the system.
- Start the SpectraCam program and point the spectrometer at a fluorescent light.
- Click the “Start” button to begin capturing data and once again to end capturing data and hold the last data. You also can use CTRL + Space Bar to toggle the camera. You should see a picture similar to the one below. If a warning message about the camera not being found appears, change the “Camera #” from 0 to 1.
- With the camera stopped, press the “Auto” button. The two numbers in the “Blue” and “Red” boxes should change slightly.
- Check the quality of the calibration by selecting “Fluorescent Light” from the dropdown box titled “Fit”. This will add colored bars indicating the expected peak location to the line scan. Many of your peaks should line up with the bars. (This calibration data is adapted from https://www.nist.gov/pml/handbook-basic-atomic-spectroscopic-data ).
- The first order lines are shown in red and the second order lines are shown in green.
- You can adjust the “Blue” or “Red” numbers slightly to try to make the peaks line up better.
- The camera doesn’t show all the lines since it only has a range of 380 nm to 900 nm.
- Once the camera is calibrated, these two numbers should be entered for each set of data.
- The calibration data scan be saved to the local computer by using the the “Save Calibration” entry from the menu accessed by left-clicking on the upper-left icon.
- Moving the camera to another computer will require the numbers to be entered by hand but will not require another spectra of the overhead lines to be taken.
- The “Brightness” dropdown box can be used for dim samples.
- Data Saving.
- The data can be saved using the “Save As” entry from the menu accessed by left-clicking on the upper-left icon. This data can be loaded back into the SpectraCam software and modified.
- The data can also be exported as columns of numbers from that same menu. Once it is in that format, it cannot be loaded back into SpectraCam.
- Also from that menu, the view on the screen can be saved to a PNG file. The resulting file cannot be loaded back into the program.
Once the SpectraCam is completed, it is time to use it and measure things. The most obvious sample is the fluorescent light that was used for calibration. In the picture below, the red and green lines are the expected values for the first and second order lines. Additional data is shown in the Revision 5 page.