USB Spectrophotometer

Introduction: USB Spectrophotometer

What is a spectrophotometer you may ask? Basically it's a device that uses different wavelengths of visible light (and sometimes even infrared or ultraviolet) to collect data. The light is passed through the substance, which is usually in liquid form or is in solution, and the intensity of the light reaching through the sample is measured. Different substances of different concentration will interact with the light differently, so that the composition or concentration of the substance can be calculated.

Step 1: Materials

Materials needed:

LEDs of different colours - as many as you want

Resistors to match the LEDs - depends on amount of LEDs

Photoresistor - used to measure light intensity

USB cable - used to provide power to the circuit

Case - helps to keep out unwanted light and keeps things organized

Multimeter - to measure the resistance of the photoresistor, and to help build the circuit




Step 2: Circuit

Sorry it looks bad :P

Step 3: Begin Assembly

The first thing I did was attach all of the negative leads of the LEDs to a single wire and gave each positive lead its own wire. After that, I attached the resistors to their respective LEDs, and used electrical tape to secure it. ( soldering is recommended although i couldn't find my soldering iron )

Low intensity LEDs are recommended as the light will sometimes be focused on the photoresistor when a sample is being tested.

Step 4: Power Cable

Now, cut the USB cable in two. Keep the male end (the part that plugs into your computer) and strip it. There should be four wires and some mesh, but we only need the red and black wires. Strip the ends of the black and red wires and attach a switch to the black wire (negative) attach the other end of the switch to the negative wire from the LED array.

Step 5: Connect the Positive Ends

UGGGGG. This is terrible. I got the bright idea to use a connector from a computer power supply. DON'T USE THEM! Use ANYTHING but them. It didn't work well but it was all I had around. Each positive should go to its own connector through the resistors that we attached earlier. Use the appropriate number of connectors for the number of LEDs you have.

Step 6: Positive Probe

The purpose of this is to set which LED turns on. Depending on which female connector you attach it to, the corresponding LED will light up. This connector is simply attached to the positive end of the USB cable.

Step 7: The Light Sensor

Attach two leads to the end of the photoresistor. The multimeter will be used to to read the resistance of the photoresistor to determine the intensity of the light after it has passed through the sample.

Step 8: Put It in a Box

Place everything in a container of some sort. Make sure no light can get in to the casing. I did mine in a closet with the lights off so it was not a problem for me. When setting up the case be sure to do the following things...

Set the LEDs so they face the photoresistor. Leave a gap between them so you can place the sample in between them.

Have the leads of the photoresistor outside the box so you can attach them to the multimeter.

Have the connectors for the LEDs as well as the positive probe outside the box so you can actually USE them.

Step 9: Testing

Place a sample between the photoresistor and the LEDs. Connect the male connector to the LED you want to turn on, and plug the USB cable into a port. Connect the multimeter to the two leads off of the photoresistor and set it to measure resistance. Measure the resistance for each LED and record this data.

NOTE: the resistance will get lower the more light passes through the sample.

also the resistance will be higher when there is no sample because the light is focused on the resistor when a clear sample in placed in.

USB Contest

Participated in the
USB Contest

Be the First to Share


    • Colors of the Rainbow Contest

      Colors of the Rainbow Contest
    • Tinkercad to Fusion 360 Challenge

      Tinkercad to Fusion 360 Challenge
    • Hot Glue Speed Challenge

      Hot Glue Speed Challenge



    11 years ago on Introduction

    Anybody got a way to cycle through all the colors using those RGB (color changing) LEDs to do this? It could create many different colors for this colorimeter.


    Reply 9 years ago on Introduction

    Interesting idea but an RGB LED doesn't output a color via a single wavelength, it merges the colors of the R, G and B wavelengths to display a color. A spectrometer measures the absorption of individual wavelengths of light so an RGB LED would only give you three wavelengths (red, green and blue). This instructable uses a variety of LEDs to provide as many data points as possible, but as the other comment pointed out, its really just a multi-channel colorimeter.


    Reply 9 years ago on Introduction

    I haven't tried any of these with a diffraction grating, but if I could do that it would answer these things right quick!

    1.  So-called white LEDs have a fair amount of spectrum in their output, do those count as a wideband source?

    2.  If the power to each separately colored LED source is varied, does that change the spectrum?

    3.  If the colors of light are mixed in a ground glass diffuser, does that blend their colors?


    Reply 9 years ago on Introduction

    It would be fun to try. Unfortunately I don't have a prism on hand.


    Reply 9 years ago on Introduction

    Do you have a CD or DVD on hand? Shine the mixed light on it, look for breaks in the reflected spectrum. Compare with unmixed light. If spectrum breaks are the same, there was no "mixing."


    Reply 7 years ago on Introduction

    An RGB LED can be used to create red, green, and blue individually.

    You can also mix the colors to create combinations of colors.

    I created a simple 3-channel monochromator for a pulse oximetry demo for an intro to engineering class that I am TA-ing for. I plan on putting up an Instructable pretty soon. Here is the code to turn on the individual colors of an RGB LED

    I bought the LEDs here

    If you want to turn on more than one color at the same time, then write LOW to the pin which is connected to the color you want to turn on. In order to mix the intensities of color dynamically, use PWM.

    Hope this helps!


    12 years ago on Introduction

    This is a cool build, and one that I've thought of before, but technically this is a multi-channel colorimeter, not a spectrophotometer.