DIY Oil Pollution Testing




Introduction: DIY Oil Pollution Testing

I work with the Public Lab community, and we've been developing DIY pollution measuring tools.

The Homebrew Oil Testing Kit is an open source, Do-It-Yourself kit which attempts to make it possible to identify oil pollution by type. This means matching a suspected sample with a known sample of crude oil, motor oil, heating oil, or other petroleum-based contaminant using a homemade fluorescence spectrometer. A spectrometer enables you to precisely measure the colors of light emitted by carefully prepared samples when they are illuminated with strong ultraviolet light, as shown in the lead image.

We're running a Kickstarter campaign to distribute a batch of these kits, but of course since it's open source, you can simply find the materials and make one yourself. Watch this video to learn a bit about our campaign, and about the Public Lab community:

You'll need:

  • protective latex or nitrile gloves
  • cotton swabs
  • some small glass bottles, like empty nail polish bottles, or plastic cuvettes (available on Amazon)
  • mineral oil (from the pharmacy -- it's used as a laxative; also sold as "baby oil")
  • a "Blu-Ray" or 405 nanometer laser
  • an eyedropper
  • a spectrometer: you can build one from a piece of DVD-R, a webcam, and a light-sealed box. Instructions and design files for several types can be found on the Public Lab website, and we are working on getting an Instructable posted too. This Instructable covers the use of a spectrometer to do a specific type of analysis.

Many of these things may need to be sealed in plastic and thrown away if you use them to handle spilled oil or anything suspect which you find on the ground, so don't use your grandfather's heirloom eyedropper :-P

A more detailed list plus links for where to buy things can be found at the bottom of the Public Lab Oil Testing Kit page.

Collect, Scan, & Compare

The process of testing for oils can be described in three overall steps;

  1. collecting samples of suspected oil or tar from the ground, and dissolving small amounts in mineral oil so they are transparent
  2. illuminating the solutions with ultraviolet light -- presently using a 405 nanometer blue laser -- and recording the light spectrum with a DIY spectrometer, as shown in the diagram above
  3. comparing the spectrum to those of similarly prepared samples of known pollutant oils, as well as a negative control

Here I'll discuss and illustrate these steps one by one -- but keep in mind this process is always evolving. For a constantly-updated version of these instructions, see the Oil Testing Kit page on the Public Lab Wiki.

Step 1: Collecting Samples

Locating samples

Originally, we focused on tar balls which were washing up on US Gulf Coast shorelines following the BP oil spill, in part because the Public Lab community was founded during the spill. These ranged from hard black lumps to orange residue. But oil contamination takes many forms, from residue around a street drain, to a sheen or buildup on the surface of the water. Above you can see some examples. You could look at the banks of an urban waterway, or for the motor oil that collects by a street drain. Be sure to use gloves!

Above images, left to right: dried oil on rocks in 2010, Louisiana coast by Cesar Harada CC-BY-NC-SA, oil residue in the ocean in 2010, Louisiana coast by Cesar Harada CC-BY-NC-SA, Oil tanker leak on tracks beside Mississippi River, by @marlokeno, swabbing a street grate by @warren


Label sample bottles with the date, time, and location. If you also give it a unique number, any other information can be kept in a notebook next to that number, such as further notes on the location and its condition. Take a photo of the sample with your label, in the place you found the sample, for context.

The second photo above is of a sample already dissolving in mineral oil, but typically we've collected relatively dry samples and dissolved them later. You can put a small amount into an empty sample jar or use the cue tips to put residue directly into mineral oil as in the next step.

Step 2: Preparing Samples

Use a cotton swab or small brush, dipped in mineral oil, to break up some of the material and dissolve it in a small, square-sided glass jar of mineral or baby oil. Wear gloves before handling suspected pollutants. You may need to rub the sample for a while to get it to dissolve. If it does not dissolve, there may be more aggressive ways to dissolve it.

Where possible, try not to put too much sand or other stuff in the jar. It's a good idea to keep extra samples (dry, as you found them, not in mineral oil) in glass jars, stored in a cool dark place, as there may be an opportunity to test them later with more expensive, official means.

Seal the bottle tightly with the cap. You can then gently turn it over a few times to get the residue to dissolve -- it may take some time before the mineral oil takes on a distinct but faint yellowish hue. You may then have to wait for the sediment to settle out. You want the liquid to be quite transparent, with the chunky stuff settled to the bottom.


One big issue is getting the correct concentration of sample dissolved. If it's too little, we may not be able to get it to glow under UV light. Too much and it could be too dark for the light to be visible in the bottle. Ideally we'd like to have the same concentration in each sample bottle, but determining this is very difficult as the samples may be mixed, so they can't easily be weighed. We recommend going by how dark they are -- try for a color similar to very dilute tea, as in the second image above. If you notice the laser dimming noticeably as it goes through the liquid, it's too dark, and you'll have to dilute it more.

Step 3: Illuminate and Scan the Sample

Now that your sample is prepared, you may be able to get it to fluoresce or glow by shining an ultraviolet light through it. We have had good results using a blue/UV laser, a 405 nanometer laser which is the same as found in a Blu-Ray player. See the parts list at the beginning, or on this page, for where to buy one. Very strong UV LEDs could also work, but are not as bright, and getting enough light to the spectrometer is a challenge. LEDs are also not as narrow wavelength as a laser.

Don't look at the laser too much, as it can hurt your eyes, even if you're not pointing it directly at your eye! Only turn it on while scanning, and look away.

Note that the laser will have a purple-ish color by itself (as seen in the lead image at the top of the page) -- this is not fluorescence, but just scattering of the laser light. What you're looking for is any other color -- whitish, bluish, greenish -- which is not from the laser, but is produced in the material itself as it's excited by the UV light. To measure precisely the colors that are being produced, we will use a spectrometer.

Step 4: Spectrometry? Fluorescence?

Colored light is often a blend of different colors. A spectrometer is a device which splits those colors apart, like a prism, and measures the strength of each color. A typical output of a spectrometer looks like the above spectrum of the daytime sky, with the actual light spectrum at the top and the graph of wavelength (horizontal axis) and intensity (vertical axis) below.

Your own spectrometer

You can build your own spectrometer from a piece of DVD-R, a webcam, and a light-sealed box. Instructions and design files for one can be found on the Public Lab website, and we are working on getting an Instructable posted too.

What is fluorescence, and how do we use it to match oils?

While there are many ways to use a spectrometer, in this case we're causing the samples to glow by exciting them with a high-energy UV light.

When we scan the fluorescence from an oil sample, we can clearly see the laser color, or wavelength, which is only in a narrow range around 405 nanometers, to the left, as in the second image above. All the remaining light, to the right of that tall peak, is produced by the excited material in the sample. The shape of that curve can be matched against other samples to help us identify what ours is.

You can often even see the difference with the naked eye, though you can't do a precise comparison. The third image above shows a Blu-Ray laser going through several different kinds of oils -- note the different colors they each emit!

Step 5: Illuminate the Sample and Record Its Spectrum

Whether you use the Homebrew Oil Testing Kit , or one of the prototype designs we've recently published, the basics are that you need to illuminate your sample with a laser beam perpendicularly to the direction your spectrometer is pointing, and to align it so that you can see enough light using the software at, which connects to your USB webcam. The illustrations above show a couple ways we've folded up or modified boxes to keep a spectrometer lined up with a sample container and a jar.

The hard parts are getting the laser lined up with the slit, so the light actually goes into the spectrometer, and using a pretty sensitive webcam so that it can actually detect the light. One thing not shown as clearly above is that you should either turn the lights off or cover the box so that you don't detect ambient light from the room.

The illustration shows scanning a control sample at the same time, but this may not be necessary if everything is consistent between scans. You'll want to see something like the third image above in the software.

If you don't, but you can visibly see fluorescence (see below for examples), try moving the laser up and down a bit to get it to align. You want the curve to the left of the tall peak (which is the laser) to be mostly between 25% and 75% intensity, so it's not "clipping" by being too bright but you're getting enough light to see a clear shape amongst the noise. You should also use "RGB mode" (in the Tools section of a saved spectrum page) to check that none of the three channels is overexposed, as shown in the fourth image. We'll add an automated warning for overexposure, soon.

Improve your technique

Once you get a basic scan, save and label it, but consider some of these techniques to improve your data collection:

  • try to ensure the same concentration of contaminant in each sample bottle
  • take several scans for each sample, and label them #1, #2 -- comparing them to ensure your technique is consistent
  • scan multiple samples from the same site
  • smooth your data using the technique described in this note

Once you're confident that your sampling is consistent and rigorous, you're ready to start comparing the data you've collected.

Step 6: Compare Your Scans

When identifying an oil, we are hoping to measure the color of fluorescence of the blend of Poly-Aromatic Hydrocarbons (PAHs) in the sample. The best way to identify a sample would be to compare it to a selection of similarly-prepared known reference materials. For example, if you have unknown X, you could compare it to both: A) a known sample of crude oil and B) a known uncontaminated sample of material (perhaps soil) to see which it matches best.

Which is it more like? Ideally, it should be compared to a range of possible references. For example, if it's possible the sample is heating oil or motor oil, you could compare it to similarly prepared samples of those as well. Some research has shown that vitamins A and E can produce fluorescence similar to petroleum products.

Read over this detailed research note to see how to set up a comparison -- but keep in mind that since it was published, we've vastly improved noise reduction (smoothing) and comparison features as described in this note.

Plot your samples and compare

Add all your scans to a set, so they can be viewed together, and you can see the subtle color differences as graphed lines. Add the spectrum of your unknown sample and see which of the others it is closest to.

Be sure your spectrometer is calibrated so that the spectra have wavelength units -- although if they're captured on the same device and you haven't moved it, even uncalibrated spectra can be aligned and compared.

Step 7: Be Sure You Have It Right!

There are a lot of steps in this process, and it's still a prototype, so think about the following things to be more confident in your findings, or to help refine them to answer your questions adequately. There are thousands of people in the Public Lab community, so also consider posting your work there (requires a login) to solicit input and advice. Even if your work is not done, it's a great idea to share and solicit feedback on your plan before, during, and after you've done the work. You may be able to build on previous work on the website, and your work will help others who are seeking to perform similar tests.

Positive and negative controls

Think critically about your testing and how it might have gone wrong. Could you have made mistakes, or is the match you've found between your unknown sample and your references not good enough? Could another material produce the same color spectrum as your suspected contaminant, and fool your test? (See this research on Vitamins E and A causing such false positives).

Validate your results

An extra step that may give your work more credibility is to submit a few of your samples for analysis to a lab, or to use other tests to confirm your results. Alternatively, if you know other testing has occurred, you can try to extend its results by re-testing the same site or samples, correlating your results with the previous test, and performing your own tests over a larger area or at more sites, or over a longer time span.


There are many variations of the process which could be useful but are not essential. These include:

  • collecting samples from a sheen on the surface of the water -- which may be difficult as sheens are extremely thin and spread out
  • measuring fluorescence in-situ on the ground, without collecting or concentrating samples in a jar -- which could be difficult as it's very dilute and mixed with other things like water, dirt, or plant matter

Many of these may be future goals of the project, but we are focusing on our primary use case of collecting contaminated soil or residue from the ground, dissolving it in mineral oil, and illuminating it with UV in a spectrometer.

That's it for now!

Thanks! This is far from a finished or mature technique, but we believe that a collaborative, open process is the best way to iterate and improve on it. Please offer suggestions for simplifying, lowering costs, or improving the validity of the tests, either here, or on, where there are manymany people working to make pollution monitoring more accessible and cheaper. And have a great day!

Tech Contest

Participated in the
Tech Contest

Formlabs Contest

Participated in the
Formlabs Contest

Be the First to Share


    • Puzzles Speed Challenge

      Puzzles Speed Challenge
    • CNC Contest 2020

      CNC Contest 2020
    • Secret Compartment Challenge

      Secret Compartment Challenge

    4 Discussions


    How interesting. I'll keep this in mind in the future. Who knows, it may come in handy!


    5 years ago on Introduction

    This is pretty smart!

    But why not use a recent devise has called 'Scio', it'll already make most of the job by detecting materials by scanning the spectrom of their light, and translate them into elements and molecules. You can scan the water and it'll tell you if in the water there is oil.

    *I'm not sell the product, I share the technology :-)

    Victor Does
    Victor Does

    5 years ago on Introduction

    Would be a fun project to control the water in the lakes around me some time!