A spectrometer mainly consists of four components: slit, diffracting element, detector, and relaying optics between these parts. In our case, the input optical fiber acts as our input slit. I chose to use a 50 um core multi-mode fiber for a compromise between light throughput and spectral resolution. A 2-m long SMA-905 fiber patch cable can be purchased on AliExpress for about $40, or $70 from Thorlabs.
The diffracting element is typically a grating. It is important to choose a grating with the right line density to obtain reasonable dispersion (wavelength per degree of angle) at the designed order of diffraction (1st-order is most commonly used). For this project since the design wavelength is 800 nm ~ 1600nm, a line density of 600 line per mm is about right, and this gives a dispersion of 40° over the designed wavelength range. See below for a plot of angle-of-diffraction for 50° incident angle onto a 600 line/mm grating. The 2nd and 3rd orders are clearly not usable as they overlap with the incident beam.
Next comes the detector. How are we gonna detect light from a range of angles with only a single 'pixel' of photodiode? We mount the photodiode on a motor and scan it across! To do this, I purchased a stepper-driven linear stage from Amazon for $50. This little stage is quite well-built and allows a resolution-per-step of 5 um, more than enough for our resolution.
The InGaAs photodiode mentioned above has an active area of ϕ1mm, while the image of the 50 um input slit is gonna be a bit smaller than that. So an output slit also needs to be mounted as close as possible to the photodiode, in order to make sure that the size of the photodiode does not compromise the spectral resolution. This does not need to be of great precision —— I simply used some aluminum masking tape to make a slit of ~0.3 mm wide.
Lastly, we need optics to connect all these components together. It turns out that this part is quite expensive and tricky if you want high spectral resolution as well as high light throughput (which ultimately determines the signal/noise ratio). Basically, starting from the input slit (which can be viewed as a point source), we need to (1) defocus it into a parallel beam, (2) direct it onto the grating, and (3) focus the diffracted beam (which is approximately parallel for each color) onto the sensor. Traditionally, the standard way is an all-mirror configuration known as the Czerny-Turner design. The reason to use mirrors instead of lenses is to minimize chromatic aberrations, so that all wavelengths can be focus onto the same focal plane. However, the alignment of these parabolic mirrors are quite difficult without a real optics bench, so I decided to pursue a different path that is much more friendly for DIYing.
The first step —— defocusing fiber output into parallel beam, can be achieved using a fiber collimator. This is basically a lens pre-aligned with its back focal point right at the interface of the optical fiber core.
SMA-905 fiber collimator (picture from Thorlabs)
One end of this device is already threaded with standard SMA-905 connector, so that the fiber patch cable can be directly connected to it. The other end is free-space output of parallel beam. Very easy to use!
However, the lens used in the collimator does have a chromatic aberration, so that only the beam at the designed wavelength (980 nm in my case) is truly collimated. Shorter wavelengths converge a little bit and longer wavelengths diverge a little bit. Fortunately, the level of dispersion appears to be tolerable, and it can be further corrected by optimizing the location of the detector.
The fiber collimator is not super cheap —— it sells for $160 on Thorlabs. While there are other options, they are either even more pricy, or appears much less well-built than the Thorlabs one. I was lucky to find a pair being sold on eBay for $70 each, so I can use one on each end of the fiber.
Next, directing the beam onto the diffraction grating is easy, as you just need a good silver-coated mirror. Again, I found one (12.7mm x 12.7mm) on eBay for $25, while a new one sells for $35 on Thorlabs. I assume that any decent mirror you can find will probably work, but don't use a dielectric mirror if it's designed for visible, as it's probably gonna be out-of-band for near-IR wavelengths that we need.
The last piece of optics is a lens/mirror to re-focus the diffracted beam onto the detector. Our beam is a ϕ2mm circular beam for each color. To simplify things a bit again, I chose to use a cylindrical lens to focus the light in the plane of diffraction. There are mainly two benifits of this: (1) the focused beam is a line of ~0.5 mm wide (beam waist) and ~2 mm tall (size of the original circular beam). This makes the alignment of the diffraction plane and the detector relatively unimportant (tolerance ~1 mm). (2) The rectangular shape of the cylindrical lens is easier to mount with than a circular lens. You just need a piece of double-sided tape!
The optical layout is shown in the figure below, together with a raytracing of the light path using Optometrika.
Left: optical configuration. Right: simulated intensity on the detector
The placement of the cylindrical lens (position & angle) affects the focal point for different wavelength. I did not do a rigorous calculation here —— I simply resorted to a trial-and-error method to figure out the optimal placement. The tolerance appears to be quite large, probably because of its relatively long focal length (150 mm) compared to the beam size.
The theoretical resolution (without considering optical aberrations) can be estimated based on the parameters of the optics used here. The magnification of the optical train is 150 mm (cyl. lens) / 11 mm (fiber collimator) = 13.6 times. There are three major sources of broadening:
Input slit: The 50 um fiber core creates an image of 0.05 × 13.6 = 0.68 mm spot at the screen. This corresponds to about 6 nm broadening in wavelength.
Grating: The finite beam diameter at the grating limits the spectral resolution. Resolving power of a grating (using 1st order) is equal to the number of lines being illuminated. A beam spot of 2mm has a resolving power of 1,200, so this contributes to a broadening of ~1 nm in wavelength.
Output slit: the slit at the photodiode further broadens the spectral response by about 3 nm.
You can see that the major source of broadening comes from the input slit size (fiber core size). To improve upon this without compromising light throughput, one would use a fiber collimator with larger lens/mirror and longer focal length (which is also more expensive) so that the magnification of the system is reduced. Since the input 'slit' is in fact circular, the broadening is less severe than 6 nm. My spectrometer eventually achieved a measured FWHM of 3~4 nm @ 1000 nm, and 5~6 nm @ 1500 nm, which is more than adequate for me.
In fact, this resolution is pretty darn good considering the simplicity. For reference, an InGaAs spectrometer sold by Edmund Optics using the same SMA-905 fiber input claims a resolution of 4 nm, and a compact spectrometer by Ocean Insight has a nominal FWHM of 10 nm. FYI, they sell for ~$12,000 and ~$8,000 respectively.