Find all your DIY electronics in the MakerShed. 3D Printing, Kits, Arduino, Raspberry Pi, Books & more!

Spectrometer-1.jpg
Make a device that identifies dangerous liquids by analyzing light – By Eric Rosenthal…

After air travel security banned bottled water and baby formula, I began wondering why they didn’t use a device to determine the contents of liquids. If a liquid was detected to be safe, security could allow it on the plane. Spectrometers can identify the chemical makeup of a material by shining light on it and analyzing the precise mix of colors that bounce back.

These devices are usually very expensive, but I’ve designed a simple and inexpensive one that can identify liquids. You can also adapt it to determine the color of a swatch of paper or cloth or to identify a gem or semiprecious stone.

I spent less than $100 on this project and it took just a few days to design, fabricate, and test the hardware, plus another two days to write and debug the source code. Collecting the liquids and building the database took one evening, and it was fun!

MATERIALS

Arduino board from sparkfun.com. Use the Arduino NG or the latest USB version, the Arduino Diecimila.

LEDs (5) blue, green, yellow, red, and infrared Infrared

(IR) phototransistor

¼-watt resistors: 220 Ω (5), 1KΩ (2), 2.2KΩ, 18KΩ

Serial display I used a Crystalfontz 634 Serial LCD; you could also use the Matrix Orbital LK 204-25, or similar products from seetron.com.

Power supply 6V–12V DC, 1A– 1.5A

7805 5V voltage regulator and heat sink to drop the 12V to 5V for the display’s backlight

Case from vellemanusa.com

Push-button switches (2) momentary, normally open

Soldering iron and solder

Wiring diagram Download from makezine.com/14/diyscience_spectrometer or follow the one in this article.

Spectrometer-2.jpg

SCHEMATIC DIAGRAM OF SPECTROMETER

An all-controlling Arduino board drives 5 colored LEDs from output pins, along with a serial LCD display. Digital inputs from buttons switch between “learn” and “identify” modes, and analog input from the phototransistor is analyzed to identify the sample. A 7805 voltage regulator powers the LCD backlight.

A Little Science Background

A spectrometer measures the properties of light over a specific portion of the electromagnetic spectrum. Because all materials have a unique spectral signature, spectroscopic analysis can identify materials from the light that they reflect or emit. Mixtures of materials produce combined spectra, and by measuring the intensity of light at each wavelength, a spectrometer can determine the overall chemical makeup of a material under investigation.

When material burns, a spectrometer can detect and analyze the light it emits to determine the material’s composition. In astronomy, highly specialized spectrometers are used to determine the composition of the gases that are ionizing and emitted as light energy from a star.

How It’s Done

  1. 1. An Arduino board sequentially illuminates 5 different colored LEDs (light emitting diodes): blue, green, yellow, red, and infrared.
  2. 2. As each LED’s light passes through a vial of liquid, we measure the intensity of the light detected by a phototransistor. See the wiring diagram above to wire together this part of the spectrometer.
  3. 3. Our spectrometer has a “learn” mode and an “identify” mode. In the learn mode, a known sample is placed in the unit and sampled at each wavelength emitted by the LEDs. The sampled values are stored in the Arduino memory. In the identify mode, an unknown sample is spectrally scanned, and the software in the Arduino compares the values of the scan with the values stored in the database.
  4. 4. A simple algorithm makes a best guess to identify the liquid, which is then displayed on a serial LCD. I think you’ll be impressed by its accuracy.

Eric Rosenthal is president of Creative Technology, LLC (CTech), a company specializing in new and advanced imaging technology consulting and development.


References:


Make: Arduino

Arduino Starter Kit

Getting Started with Arduino

http://creative-technology.net/MAKE.html

http://www.make-digital.com/make/vol14?pg=136

http://makezine.com/14/diyscience_spectrometer

http://makezine.com/go/spectrometer

http://seetron.com

http://sparkfun.com

http://vellemanusa.com


Make 14 - Optics

From MAKE 14 – Page 134. To get MAKE, subscribe or purchase single volumes.

Phillip Torrone

Editor at large – Make magazine. Creative director – Adafruit Industries, contributing editor – Popular Science. Previously: Founded – Hack-a-Day, how-to editor – Engadget, Director of product development – Fallon Worldwide, Technology Director – Braincraft.


Related

Comments

  1. Anonymous says:

    Neat little spectrometer, but since it seems to be really limited in resolution, and just visible-NIR, I doubt it would be able to tell the difference between paint and formula. BUT from a “I’m teaching instrumental analysis next semester” stand point, this is fantastic, and deserves a big thank you!

  2. Anonymous says:

    Could the Saftey Spectrometer in Volume 14 be used to determine alcohol content in home made beer? Has anyone done this?

In the Maker Shed