DIY Smartphone Spectrophotometer: Open-Source Design for Classroom Use

Ever tried to explain why a solution looks green instead of clear, and the kids just stare at you like you’re speaking another language? A cheap, reliable spectrophotometer can turn that confusion into a “aha!” moment. And the best part? You can build one with a smartphone, a few bits of plastic, and a pinch of curiosity. In today’s post I’ll walk you through the whole process, from gathering parts to running your first test. By the end you’ll have a tool that fits right on a lab bench and fits into a school budget.

Why a Smartphone Spectrophotometer?

A spectrophotometer measures how much light a sample absorbs at different wavelengths. In chemistry that means you can figure out concentrations, reaction rates, and even identify unknowns. Commercial units cost thousands of dollars – far beyond what most classrooms can afford. Smartphones already have a decent camera and a built‑in light source, so they are perfect candidates for a low‑cost version. Plus, the data can be logged directly to a spreadsheet, making analysis a breeze.

What You’ll Need

Below is a short shopping list. Most items can be found at a local hardware store or online for under $30 total.

  • Smartphone – any model with a decent camera (8 MP or higher works fine).
  • Diffraction grating – a 1000 lines/mm transmission grating. You can salvage one from an old DVD player or buy a cheap sheet online.
  • Black 3‑D printed or laser‑cut housing – I provide the STL file on LabCraft DIY. If you don’t have a printer, a simple cardboard box works with a few cuts.
  • LED light source – a white LED (5 mm) with a diffuser (a piece of frosted acrylic or even tracing paper).
  • Sample holder – a 1 cm path length cuvette or a clear plastic tube.
  • Mounting tape or hot glue – to secure components.
  • Free app – “SpectraCam” (Android) or “ColorMeter” (iOS) can capture spectra and export CSV files.

Building the Housing

1. Print or cut the body

The housing has three main chambers: the LED chamber, the sample chamber, and the camera chamber. The STL file is designed so the LED sits opposite the camera, with the diffraction grating in between. If you’re using cardboard, cut out two rectangular slots (about 2 cm wide) for the LED and the camera, and a third slot for the grating at a 30‑degree angle.

2. Install the LED

Place the LED in its slot, pointing straight across the sample chamber. Glue a small piece of diffuser over the LED to spread the light evenly. Connect the LED to a 3 V coin cell; a simple push‑button switch makes it easy to turn on and off.

3. Add the diffraction grating

The grating must sit at a fixed angle – 30 degrees is a sweet spot for most smartphones. Tape it securely so it doesn’t shift when you move the device. The grating will split the white light into a rainbow that the camera can capture.

4. Position the sample holder

Insert the cuvette or tube so that the light passes straight through its center. Make sure the path length is exactly 1 cm; this is the standard for most spectrophotometric calculations.

5. Mount the smartphone

Slide your phone into the camera slot so the lens looks directly at the grating. The camera should be about 2 cm away – close enough to get a sharp spectrum but not so close that the image is blurry.

Calibrating the Device

Calibration is the step that turns a pretty picture into useful data.

  1. Blank measurement – Fill the cuvette with distilled water (or the same solvent you’ll use for samples). Turn on the LED and open the app. Capture the spectrum and label it “blank.”
  2. Reference standard – Use a known concentration of a colored dye, such as copper sulfate solution (0.01 M). Capture its spectrum. The app will give you intensity values for each wavelength.
  3. Create a calibration curve – Export the CSV files to a spreadsheet. Plot absorbance (A) versus concentration (C) for the reference. The slope of this line is your molar absorptivity (ε), which you’ll use for unknowns.

Running Your First Test

Let’s say you want to measure the concentration of a food coloring in a drink.

  1. Fill the cuvette with the drink sample.
  2. Capture the spectrum using the same settings as the blank.
  3. Subtract the blank spectrum from the sample spectrum – the app usually has a “baseline correction” feature.
  4. Find the peak wavelength (the highest point on the curve). For most food dyes it’s around 520 nm.
  5. Read the absorbance at that wavelength and plug it into the calibration equation (C = A / ε).

You now have a quantitative result that you can discuss with the class. It’s amazing how a phone can replace a piece of equipment that would otherwise sit on a shelf gathering dust.

Tips for Success

  • Keep everything clean – Dust on the grating or smudges on the lens will distort the spectrum. A quick wipe with a microfiber cloth does wonders.
  • Use consistent lighting – The LED should be powered by the same battery each time. Voltage drops can change intensity and affect accuracy.
  • Avoid stray light – Enclose the housing tightly. Even a small gap can let ambient light leak in and raise the baseline.
  • Document everything – Record the date, temperature, and any deviations from the protocol. Good lab practice starts with good notes.

Classroom Ideas

  • Color mixing lab – Have students prepare mixtures of two dyes and use the spectrophotometer to verify the Beer‑Lambert law (absorbance adds up).
  • Enzyme kinetics – Track the change in absorbance of a substrate as an enzyme works. The smartphone can log data in real time, making it easy to plot reaction rates.
  • Water quality test – Test for nitrate or phosphate using cheap test strips, then quantify the color change with your device.

Reflections from My Lab

When I first built a prototype in my garage, the first spectrum looked more like a scribble than a rainbow. I spent an afternoon taping the grating at a slightly different angle, and the result was a clean, crisp band of colors. That moment reminded me why I love DIY science: a little patience and a lot of trial‑and‑error can turn a messy experiment into a teaching treasure. If you run into hiccups, remember that every glitch is a chance to learn something new – both for you and for the students watching.

The open‑source nature of this design means you can tweak it any way you like. Want a longer path length for more sensitive measurements? Just swap the cuvette for a 2 cm tube and adjust the calibration. Need a different LED color for fluorescence work? Change the LED and update the software settings. The possibilities are as wide as your imagination.

Happy building, and may your spectra be ever bright!

Reactions