 steps. So black is 0-0-0, white is 256-256-256, pure red 256-0-0 and so on. Pure yellow would be 256-256-0, pure cyan 0-256-256. But the sensor used here is very precise and allows to discriminate over 67,000 steps for each color channel.
Photometers are often used to measure chemical reactions, like changes in the acidity (pH) of a solution, by measurement of the intensity of an indicator dye. For optimal detection you may want to measure only the absorption of light close to the absorption maximum of the dye. Therefore you will prefer to use a monochromatic light source instead of white light. LEDs come in a wide variety of colors, give nearly monochromatic and intensive light with a very stable intensity pattern and are very energy effective. The sensor used for the photometric layout allows you to measure light intensity over a very broad spectrum, from UV to IR, with a very high precision.
A variety of indicator dyes are changing their color, e.g. from yellow to blue. Here a colorimetric measurement can allow to demonstrate and quantify this transition process, as the colorimeter described here could also be defined as a three-channel photometer.
So you may for example measure the pH, oxygen and CO2 concentrations in your pool or aquarium, or nitrate and lead concentrations in your drinking water. Or just analyse the precise color of your favorite ink, so you may paint your flat in the same color.
As the costs per unit are extremely low compared to any commercial devices, it is a nice tool for science classes and hobbyists.
Step 1: Basic Layout of the Device; Required Parts
The device consists of three core elements:
- the housing and lid are made by assembly of pieces that were laser-cut from a single sheet of 3 mm acrylic (see pictures next step). They are defined by a single SVG-file. I am using the laser cutting service of Formulor (Berlin/Germany, 13€ per plate plus shipping), but using the same SVG-file, the parts could also be ordered at Ponoko (US) or RazorLAB(UK) at a similar price. You may choose from a wide variety of colors, but to minimize color artefacts I would recommend black, grey or white.You can find the SVG-file defining the latest tested version at a later step of this instructible.
- a sensor breakout:
* For the colorimeter, the TCS34725 RGBW-sensor breakout from Adafruit (< 8 US$/€, www.adafruit.com/products/1334) is used.
* For the photometer I use the TSL2591 breakout from Adafruit (< 7 US$/€, www.adafruit.com/products/1334) .
I ordered both breakouts at Flikto, Germany.
- a light source:
* For the colorimeter I am using a 5 mm naturally white LED with a narrow emission angle (Nichia NSPW500DS, about 2,20 € at Conrad, Germany). Please be aware that a "white" LED does not give a homogenous emission spectrum, as sun light, but a sharp blue peak and a bell-shaped emission spectrum with a maximum in the yellow-green range (see image). "Naturally white" LEDs emit similar amounts of light in the red, green and blue regions.
* For the photometer, a 5 mm LED with a color optimal for the specific analyte shall be used.
E.g. for a dark red analyte, you may use a green LED, a yellow LED for a blue dye.
You can find an overview of some commercially available LEDs with different colors at a later step.
The 5 mm LEDs can be powered either by a two 1.5 V batteries or using the 3.3 V output of the Raspberry Pi. Most yellow, orange and red LEDs will need a series resistor (e.g. 60 Ohm) to reduce the voltage to 2.1 V.
In addition to the above, an assortment of screws, nuts and washers (2.5 M and 3 M), silicon rubber feet and some cables are required. I also would recommend to use a breadboard to connect RPi and device.
A more detailed list is found at a later step.
Step 2: Assembly of the Device
The parts for the housing are constructed in a way that they fix together precisely, with grooves and tongues, without gluing. Only the assembly of the lid requires a bit of glue.
The pictures shown here may not represent the latest version of the device, as its layout still is subject of ongoing optimization.
At fir