DIY optical breadboard

The cake is a lie. This is actually a post about anodising aluminium.

The internet is full of information about anodization/eloxation of aluminium, so I’ll just summarize what I’ve learnt is important:

  1. Current control rather than voltage control
  2. Temperature control
  3. Cleanliness is next to godliness
  4. Work in a well-ventilated area
  5. The alloy is important. I’ve used AlMg3 (5754).


Every single paper I’ve come upon agrees on that a current density of at least 1.25A/dm² and an electrolyte temperature of 20-30⁰ C is required for a type II coating (what you want for nicely coloured aluminium), so current control is definitely needed.

Continue reading


Finally Windows

There’s finally a Windows interface for the TCD1304. It’s not me, I didn’t do it, it’s the work of Jens-Ulrich Fröhlich and it looks like this:


The JFS-OtterVIS running on linux.

Being Java-based it can also run on other OS’s, and I’ve been able to play a bit with it on linux and it looks great. The COM-port system of Windows is of course different from linux’s TTY-system, so I couldn’t actually connect to the nucleo board, but the program can handle both. There’s all the basic necessities like wavelength-calibration, baseline, transmission and absorption, printing, scaling etc, and a very well made help functionality. In other words it has all the stuff and more, that I’ve been to lazy to do anything about myself.

The weather for today

Today I finished the PSU for the peltier element and connected the stm32f103 to the thermistor (the stm32f103 is still not measuring the voltage over the TEC). And here are the readings (sorry for the blurry photographs):

First, before the TEC was turned on:


It’s fairly hot in DK at the moment. The ambient temperature is 25-26°C.

Then after 5min with the TEC on. The voltage drop over the TEC is app. 8V, I have no idea what current draws, but the transformator is rated at 4A:


So it reaches a temperature difference of around 10°C. Not as much as I had hoped.. With some heatsink paste between the peltier element and the aluminium plates the temperature dropped another 1.5°C, still not anywhere the expected ΔT of 30°C.

So good animals are uncooked, as we say here in Denmark. I had a second look at the audine project to see if I had missed something. Most likely I have, but I didn’t find anything suspicious about my setup except that the TEC 12706 protrudes slightly on the cold side. I had some smaller TEC’s from another shopping spree, most notably the TEC 03506. You see the difference in size here:


And with the little one, it’s an entirely different story. The voltage drop across the smaller TEC was around 5.6V and the temperature difference was much greater. The CCD started to collect condensation, which is around the time I stopped the test:


The temperature at this point was -0.6°C 🙂


New spectrograph geometry calculations

Here’s a quick walk-through to calculate the geometry of the spectrograph. I guarantee nothing concerning the correctness of what follows (but please do correct me if you find errors).

At the heart of everything is the diffraction equation:

The relevant wavelengths are given by the Raman shifts:

If we’re interested in wavenumbers from 150-4000cm⁻¹ and λ₀ = 532nm, the range for λ₁ becomes 536.3-675.8 nm. The edge filter’s cut-on wavelength is 540 nm, so the range is in fact 540-675.8 nm – this also means that the spectrometer’s lower limit is 278 cm⁻¹.

d is given by the grating in the case of 1200 lp/mm it becomes

Because the CCD is 29.1 mm wide and the focal length of the focusing off-axis parabolic mirror is 152.4 mm we can calculate what angles of the diffracted light we would like. For 540 nm to fall on the edge of the CCD, the angle should be:

The angle for 675.8nm is of course identical except for the sign. It gives us an angular range of ±5.45° around the center angle. The angle of incidence can now be found by solving this set of equations:

Of course not any solution will fit the spectrograph’s geometry. The angle of dispersion (γ) for the central ray must match the angle between the off-axis parabolic mirrors as seen from the diffraction grating (2α):

2α is determined by the position of the mirrors and is:

Where lm is the distance between the mirrors. Their diameter is 25.4mm, so lm cannot be shorter than this.

I’m don’t think there’s a (practical) solution to the equations, but setting lm to 27mm, 2α becomes 10.16° and then these values more or less cover the spectral range:

The CCD then covers the spectrum from 538-680 nm.

For better explanations go here:

Sneak peak at the new spectrograph

My original choice for the spectrograph’s geometry turned out to be much worse than I had even dared expect. The difference between the angle of incidence and the angle of the diffracted light was far too great.

I (obviously) didn’t know at the time, that there’s something called the anamorphic factor.¹ The definition is as follows:

r = cos θi / cos θm

If the anamorphic factor is significantly different from 1, the image of the slit on the CCD will be deformed. I don’t fully understand the implications, but I could see that a “line” supposed to take up maybe 100µm was spread out over almost 1 mm. Ok, I might be exaggerating slightly, but it was very obvious that it was never going to work.

I spent some time not thinking about it(!?), and eventually came across T.J. Nelson’s page about a High resolution compact spectrograph, and decided that this was juuust exactly what I wanted to do.

Continue reading

Blue pill blues

Every once in a while I get the question if the STM32F103 “blue pill” will be able to drive the TCD1304, and while the chip has enough peripherals to do all the driving and reading, it lacks a 2nd DMA-controller to handle communication.

Of course that doesn’t mean the mcu can’t be used in this application, it just means that my firmware can’t be ported to the F103 without rewriting at least parts of it.

But that isn’t what this post is about anyway, it’s actually about using a thermoelectric element to cool the TCD1304, to keep dark current down thereby enabling long(er) integration times.

Here is the CCD on top of the cold tip. The TEC-12706 is sandwhiched between the two aluminium plates. The lower plate will be secured to the chassis of the spectrograph, which in turn has a larger heatsink:

Continue reading

Broken promises

I promised I would test the new circuit after june 16th, and as I’ve promised my girlfriend to act more like a grown-up, I immediately broke this promise.

Having finished correcting exam papers ahead of time, I did a few tests this afternoon. It went terrible at first. The first 30min was spent without realising I had swapped the SH- and ICG-wires. Then ..okay I’m getting frustrated all over again just writing about it.

The long story short was that the particular nucleo board I was using had a an old and/or corrupted firmware. 2 hours later, once I figured that out, I resoldered all the resistors I had frantically been swapping, to get something resembling what ltspice said I should be getting and then:


An aspirin blister pack covering roughly half the CCD.


The TCD1304 at full saturation. The ADC delivers close to it’s maximum value (4095).


“Total” darkness. (The CCD was placed upside down on the table, light is leaking in from the sides.) The pixel values are close to the dummy pixels.


20µs integration


80µs integration. notice the pixel values are roughly 4x higher than for 20µs.

The values for R1, R2, R3 and R4 are:

  • R1 = 1200 Ω
  • R2 = 2200 Ω
  • R3 = 1200 Ω
  • R4 = 560 Ω

in the opamp section of the circuit:


Approximately 300mV of the ADC’s range remain unused, however at this point I ran out of time and patience.