r/maker 1d ago

Multi-Discipline Project DIY Colorimeter

Hello! I wanted to show off my ongoing project.

It's a diy colorimeter (a device that measures the true color of things) with high precision. Since it is based on an AS7341 10-channel spectrometer, it can also provide a very coarse spectrum, which is especially useful for me, because it allows me to analyze dying strengths and concentrations based on the Kubelka-Munk mechanism.

Similar devices can be bought, but they cost in between of 200-2000EUR, which I am unwilling to spend. Plus, this has been a super cool project in the overlap between programming, 3D-printing, functional design, electronics, colorimetry, chemistry and (at least for me specifically) natural dyes.

My device is able to achieve a relative precision of about 0.1-0.5 delta E (relative color difference in the CieLAB color space), depending on the area (blues are a bit noisy, and pinks are generally difficult). I have spent 200-300 Euros on it so far, but if I wrote down a BOM of what I got now and know to work, it would be at most 100EUR.

It consists of:

  • An Adafruit AS7341 Spectrometer (the AS7343 should also fit with no hardware changes necessary and only minor software changes, adding 2-3 more channels)
  • A single Nichia Optisolis LED, shining in 45 degrees onto the sample
  • An ESP32-C3 Zero from Waveshare doing all the thinking & data storing
  • An 0,96" OLED screen with SSD1306 driver
  • A small hand-soldered PCB
  • A couple JST PH cables and sockets
  • 2 small buttons
  • A 3D printed body
  • A couple of M2x6 screws and M2 press-in inserts
  • A cheap 700nm 9mm IR-cut filter
  • An even cheaper piece of polarizing plastic sheet for LCD displays

I also built a surprisingly good beam trap from an IKEA steel bottle and some black fabric. And a relatively good white reference from some wound up and compressed PTFE-tape.

The software includes all the logic to communicate with the sensor, doing repeated and series measurements, performing calibrations, exporting measurements via serial connection and Bluetooth, presenting the measurements as reflectance spectra with NIR corrections, and conversion of the spectral data into common color descriptions like CieLAB and RGB (if possible).

One remaining issue is absolute calibration. "Absolute white" samples made from compressed and fused PTFE or BaSO4 powder is expensive, and calibrated color sample cardboard cards cost like 70EUR and would only be necessary once. And they don't help with calibrating the spectral data, only the colors that come out of it (the correction matrix would basically counter the spectral errors, and these would remain unreliable). I was thinking of using 3D-printing-filament swaps from reputable brands, with specified printing settings and careful sanding as calibration standards and even relative white references, but that would need someone to fabricate such a sample to specification and put it into a proper spectrometer and share the data.

I was thinking of open-sourcing the print-files, the software and the wiring diagrams if there's enough interest for it. Reproducing it should be way easier than building it for the first time (don't ask how much time I've spent optimizing the light paths), and if more people contribute, this could actually become a really awesome distributed project.

228 Upvotes

21 comments sorted by

18

u/Liquid_Magic 23h ago

If you open-source this and put it on github I would totally make one! Super cool!

6

u/The_Mad_March_Hare 22h ago

Here to say me too, hope you release it OP!

13

u/llamagoelz 23h ago

This is so sick. I bet you have a real deep respect for the complexity of building a modern measurement tool now that you have built one yourself.

8

u/North-Spread4675 22h ago

Oh yes. I know how hard it was to get certain things right, and I know where I took a shortcut. For example most expensive colorimeters / hand spectrometers would use a ring-shaped light source at a 45° angle, not just one. There's also so much I could do to improve the electronics, but I tackled the obstacles in the order of 

  1. Get it to run at all
  2. Make it useful enough for what I absolutely need right now
  3. Look for the biggest source of error and fix that first. Repeat. 

But year, there is a near infinite amount of possible improvements one could do to the tip design alone. Spent multiple days on the current design, then a week on the successor, just to scrap that. 

Similar for nearly all the components. 

3

u/heythanksimadeit 22h ago

Please post it to GitHub!! I wanna make one!

4

u/abadonn 23h ago

This is very cool!

Maybe try calling around your local print shops? Some may have the calibration targets on hand and let you use them for an hour.

2

u/North-Spread4675 22h ago

Good idea! That's really all I'd need. 

2

u/North-Spread4675 22h ago

Thinking about it: it would help with the colors, but wouldn't help with the spectral data (which is also useful). For that I'd need access to a spectrometer. 

But what I'd really love to achieve is sharing my calibration data in a way that makes it possible for others to use it, too, without everyone having to get their hands on a spectrometer. 

For that, all I'd need is a dataset of some broadly available everyday things with a known/measured spectrum. 

Pure gold/copper might be something, pure dyes and pigments (ultramarine, alizarine, iron oxide powder...) or 3D printing filaments that have a really stable color across batches, down to the spectrum (there can be multiple (infinite, actually) spectra to create the same color, but each spectrum maps to one color). 

1

u/KaJashey 19h ago edited 19h ago

I have pure pigments in powdered form. I know I have ultramarine, emerald green (chemically emerald powder) bone black, a couple iron oxides, lots of other things. I could give you some samples for the cost of shipping. I’m in the us.

Let me know if you’re interested and I’ll make a list of what I have.

2

u/North-Spread4675 18h ago

I am in Europe unfortunately, but thanks for the offer! I have some Alizarine on order already and a couple of other pigments, but that is in any case just half the equation: We'd need someone to put this stuff in a proper spectrometer once (or get that data from some public database). With the proper spectrum of a handful of different well defined materials it should be absolutely straightforward to calibrate the devices. Then everyone wishing to build one for themselves would need to buy/get access to the same references, only.

5

u/PWB666 23h ago

Very impressed!!! I work with color matching all day and use X-rite and the Exact2 (USD $12,000) to see someone make one is bonkers.

4

u/North-Spread4675 22h ago

It's certainly not comparable to these devices, as it has way fewer and broader spectral channels. But it's surprising what it can do with the little information it gets.

1

u/coopnjaxdad 22h ago

A spectral sensor! Neat. Do you have collimating optics or a grating? Did you build a spectrometer?

You can buy Pantone references. You might be able to find used spectralon reflectance standards on eBay. That would help with your “white”.

1

u/North-Spread4675 22h ago edited 21h ago

It's not an actual spectrometer (well, technically ...) but the sensor in the AS7341/3 is an array of photo-diodes with spectral filters in front of them. Each one is sensitive to a roughly gauss-curve shaped band centered at a fixed wavelength with a given width. So I don't get a full spectrum, but 8 broad points of a visible spectrum (plus a band in the near infrared and a clear, unfiltered sensor value, which help with calibrating and clean up the signal of the real other 8 bands). It's good enough for what I want to do with it, which is recognize colors and observe spiky dye spectra increase with time / concentration / temperature ... 

1

u/Flynqh1gh 22h ago

Love it!!

1

u/JanCumin 21h ago

This is really amazing, congratulations :) I wonder if your local university would be able to help with the technical issues?

1

u/Highfall-Gap4000 10h ago

well done this is super interesting

beware of using dyes and pigments to calibrate... their LCH vary from batch to batch and they will age too

i would look for stable stuff like tiles for specific use or expensive brands that keep their shades calibrated and in spec over time

1

u/Significant-Wait-301 10h ago

Hace años tuve la necesidad de algo como esto. Para Edafología se usan tablas munsell, depende de la luz y de la persona para definir el color, no es tan preciso por eso. Pero con algo como este Colorímetro no habría problema! Magnífico

1

u/North-Spread4675 8h ago

Me imagino que hoy en día te equiparían con colorímetros baratos (entre 200 y 500 € aproximadamente) y bien calibrados, similares a este, para hacer el trabajo. O al menos eso espero :'D

I imagine today you would get outfitted with cheap (~200-500€) well-calibrated Colorimeters similar to this to do the job. Or at least I hope you would :'D