Skip to content

Colorimeter for doing boring job more fun. When finished, shall make ammonia testing of seawater easier, and more automated.

License

Notifications You must be signed in to change notification settings

joakimsk/colorimeter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Colorimeter

A project to develop an open source colorimeter that is "good enough". End goal is to analyze sample colors for water quality measurements, using off-the-shelf test kits for aquarium water quality. In the process, maybe we can do a sample with less reagents, as well.

Photometer: Measuring quantity of light, usually all kinds of wavelengths, "full spectrum". Output is light intensity.

Colorimeter: Measures the absorbance of particular wavelengths of light by a specific solution. Normally, only a narrow wavelength, where most light is absorbed by the solution, selected with filters is used to maximize accuracy, and Beer-Lambert law is applied to deduce the solution strength.

Spectrophotometer: Measures the absorbance across several wavelengths of light, giving a graph of spectral absorption. Like a colorimeter but across many wavelengths.

I believe this means that we could manage with a single "full-spectrum" light measurement of the liquid, but it gets more accurate as we select correct wavelength. A spectrophotometer is more fancy than necessary in our case.

If our solution will be green to blue, we want a light source that is in between green and blue, depending on where we want best accuracy.

Read the NOTES.md for more details and testing.

What you need

Hardware needed

  • An LDR, light sensitive resistor as light detector
  • A single-wavelength or multi-wavelength LED as light source
  • A couvette, preferably of quartz due to its optical qualities (Mine is 12.5x12.5x45mm from Purshee.com wavelength 200-2500nm, 3.5ml volume)
  • An Arduino to make the measurements
  • A PC to run software and analysis

Tools needed

  • A 3D-printer is nice but not necessary, print in black filament if possible, reduce light noise. Or spray paint with black. Or run in dark room.
  • A PC for software
  • Basic electronics tools are recommended

Other things needed

  • Food coloring for initial tests (optional)
  • Water quality test kit (ammonia suggested, can be of any chemistry, but I am using salicylate method, JBL Seawater Ammonia test kit)
  • Household ammonia (to calibrate software)
  • A small syringe, I have 1 ml with a short tip from the local pharmacy

Theory

Send light through a liquid, our sample. Detect how much light is received. With light at a certain color, the light received tells us how much light was absorbed, and how much was passed through the sample. If we use three different colors, maybe we can say which color the liquid is.

By taking samples through time, we can explore the kinematics of the liquid, to make sure we make a reading we can trust, when reagents are done reacting.

Putting this all together, we can also calibrate the readings of the kits to a known solution, for example using an ammonia kit and dosing ammonia at certain concentrations.

Light path Overview of couvette holder

Something like that.

Optical parameters

Reflectance: Amount of reflected light, referenced to a reference measurement. Expessed in % or dB, negative number.

Absorbance: Amount of light absorbed, referenced to a reference measurement, can be original light source. Expressed in dB, considered opposite of transmittance.

Transmittance: Amount of light transmitted through a liquid, referenced to a reference measurement, can be original light source. Expressed in % or dB.

Optical parameters, copyright original owner

pyroistech.com relative measurements

We should probably decide on what 100% transmittance is, then do a divison to find relative transmittance for various colors/wavelengths.

sigmaaldrich.com transmittance/absorbance table

Beer-Lambert law

wikipedia.org Beer-Lambert law

Related to the attenuation of light, as it passes through a material. Absorbance = absorpitivity * optical path in cm * concentration of attenuating species.

Should only be applied to absorbance within 0.2 to 0.5, to maintain linearity.

LDR details

The LDRs are commonly of CdS, Cadmium sulfide. They have also been mostly discontinued on Elfa Distrelec, but I found a datasheet.

They are most sensitive to green wavelengths, which may explain blue and green samples giving nearly the same, high response.

LDR spectral response pdf: ldr datasheet

Quartz couvette details

The couvettes are often found in plastic, normal glass and quartz glass. There are various types of quartz, suitable for different wavelengths.

Here is a typical UV Quartz couvette transmittance plot, very transmissive from 200 to 2000 nanometers, far beyond visible light.

Quartz couvette

Error sources

  • If using a round couvette (glass vials that follow test kit), light can get bent along sides and avoid the liquid all-together. Thus we do not use the vials, for now.

  • If using a small reagent dose, we may get imbalance in chemistry. Not sure how this will affect the reading. Read up on best practice with syringe usage.

  • White PLA plastic, and 20% infill during print will allow more light to pass through the body. And, imperfect joints will too. Try black plastic spray paint for this. If not enough, use black PLA and set 100% infill. If still not enough, put it all inside another light-proof box.

  • LDR and LED may not be accurate enough, so we may consider upgrading these components, maybe using a light sensor instead of a light resistor. LDR resistance is among other, temperature dependent. LDR has also a bit of latency, it takes time for the resistance to reach stable value, going from full dark to full light, often taking one second.

  • Conversion roundoff errors and noise in Arduino may become a problem as well. Arduino Uno is 8 bit, the ADC has 8 bit resolution. The LDR is an analog device.

  • Temporal issues due to sampling not being instant - if we make several readings at several colors, these will necessarily happen at a delta t larger than 0. Meaning that our readings will not happen in the same time, but spread over time, giving us small errors. By making sampling faster, we can mitigate but not eliminate this. Using a full spectrum light and read all wavelengths at the same time would be the best, but most expensive.

Remaining work

  • Design 3D models, then print for couvette-assembly
  • Assemble electronics
  • Make Arduino software
  • Make PC software (in progress)
  • Test and calibrate (in progress)
  • Final casing

Final thoughts

The idea of the colorimeter works well, but there are some numbers of improvements I suggest for the future.

  • The LDR is undocumented, and delays the whole sampling process, since it takes time for it to settle when light exposure changes. Get a phototransistor or a color sensor or similar.
  • The RGB led is undocumented as well as lacking a "full spectrum" white color. Preferably it is replaced with well documented light sources, or as in professional instruments, with color filters on a natural light source.
  • The 3D-printed casing should be printed in black plastic, fully filled, to avoid light leakage.
  • The modularity is not necessary, so consider printing it all in one print.
  • The quartz couvette is overkill, it seems, can potentially manage well with normal glass couvettes, or even plastic, due to calibration.
  • The arduino programmed as a simple device works well, with program logic in python.
  • The color standards should be more standard, food coloring works to get an impression but it still do not seem very standard, at least not without measuring exactly. Also, maybe we do not need standards anyhow, after designing this system.
  • There should be a couvette holder nearby, at all times, to avoid spilling water all over the place. I suggest printing this as an addon.
  • Using wood as a base works well, with glue gun to keep things together.
  • Using a small couvette with lesser volume makes you depend on an exact syringe - get an exact robust syringe, not cheap one that loose its markings over time.
  • Making one that fits aquarium test vials may be nice, one for JBL, one for

Theory & code references

moleculardevices.com Absorbance electronics-tutorials.ws Light sensors

Similar work

mit.edu Low Cost Colorimeter iorodeo.com Open Source Colorimeter Project instructables.com Inexpensive photometer & colorimeter arduino.cc Open Source Colorimeter arduino.cc Mini spectrophotometer publicLab.org Desktop spectrometer with DVD diffraction grating

researchgate.net A Simple, Rapid Analysis, Portable, Low-cost, and Arduino-based Spectrophotometer with White LED as a Light Source for Analyzing Solution Concentration researchgate.net Open-Source Colorimeter iop.org Development of color detector using colorimetry system with photodiode sensor for food dye determination application

Possible light sources and detectors

sparkfun rgb light sensor ISL29125 Digital 16bit Serial Output Type Ambient Light Sensor IC BH1750FVI electronics-notes.com LDR: Light Dependent Resistor

About

Colorimeter for doing boring job more fun. When finished, shall make ammonia testing of seawater easier, and more automated.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published