A DIY scanning spectrometer and its applications are described, demonstrating 1 nanometer resolution over wavelengths from 360nm to 980nm.
Light Essentials
Two important properties of visible light are its brightness and color. Our eyes can discern these properties qualitatively to differentiate between red, orange, yellow, green, blue and violet (ROYGBV) and colors that result from their combination. If we think of light as a wave (oscillating electric and magnetic fields), the physical distance between the peaks of these waves is called a wavelength, measured (for example) in nano-meters (nm). If light of a single wavelength in the range of about 380nm to 750nm enters our eyes, we can discern a corresponding color from blue to red, shown below (Wikipedia).
Light Spectrum
Normally, light that we see contains a wide range of wavelengths, much like music contains a wide range of notes. If we measure and record the brightness of light within a very narrow range of wavelengths, and continue that process over a wide wavelength range, we then accumulate a spectrum. In the example below, the brightness of an incandescent bulb at each wavelength was recorded, showing a higher proportion of deep red light compared to the other colors. A machine that performs such measurements is called a Spectrometer.
Spectrometer
An optical spectrometer typically consists of:
- A narrow slit that allows only from a single position to enter the machine.
- A “dispersion” element that deflects light to an angle that depends on its wavelength. These elements split a ray of white light into its component colors from red to blue.
- A detector that converts the brightness of the light from each angle into an electrical signal.
- A means to record the detector signal as a function of the deflection angle, corresponding to a specific wavelength.
Examples of Dispersion elements:
Scanning Spectrometer
The following is a description of the spectrometer that was built and used. The total cost was approximately $450, with performance comparable to commercial systems costing over $2000. For a similar DIY design see: https://caoyuan.scripts.mit.edu/ir_spec.html
Camera type detector designs are plentiful on the internet, but with perhaps less flexibility in bandwidth and resolution. Some links to such designs include:
Basic Design
The Czerny-Turner design collects light from the entrance slit with concave mirror 1 and collimates it to fill a diffraction grating. The grating splits each incoming ray into its component colors reflected onto concave mirror 2, which focuses each color onto the detector. Due to the broadening of the angle range of the light by the grating, the diameter of mirror 2 should be wider than that of mirror 1. Each mirror is a distance close to their focal length (f) from the slit, grating, and detector. In this design f = 15cm, and the diameters of mirror 1 and 2 are 1” and 2”, respectively. A diffuser is often used at the entrance slit to improve the spatial uniformity of the light source.
Detector options:
- Point detector + linear translation (potential for high resolution and wavelengths outside of CCD range, but slow data acquisition): A small photo-diode is scanned across the spectrum. Examples are Adafruit TSL 2591 or VEML 7700 (used in this design).
- Spectral imaging (CCD captures full spectrum for high speed, limited by CCD resolution and response).
- For bright sources, the spectrum image can be projected onto a white screen and a high-resolution CCD camera + lens can be used for the image. A macro lens can aid resolution. Data can be averaged vertically for each pixel for best signal to noise ratio.
- Line CCD + controller: Digikey 28317 using TSL1401, 128 pixels (fast acquisition; no vertical averaging).
Power: The Arduino board is powered by the USB input also used for serial data transfer. The power for the motors uses a separate supply connected by a plug and jack.
Optical Components
An entrance slit creates an oblong cone of light filling Concave Mirror1, which collimates the light to fill the grating. The central ray hits the center of the grating. For each incoming ray, the grating reflects each spectral component at an angle depending on the wavelength, broadening the angular extent. Concave Mirror2 collects the color separated rays and focuses each wavelength onto the detector plane as individual images of the entrance slit.
For a focal length of Mirror1 = 15cm and a 600 grooves/mm grating, both 1” wide, the spatial extent of all rays at Mirror2 is about 50mm (2”). This image shows an early version that used only a 1” diameter for Mirror2, resulting in a wavelength range less than the system’s full potential. A white card (above image) shows the spectrum from a fluorescent bulb.
The Entrance Slit is composed of two pieces of razor blade separated by a gap of about 50 microns. This slit width as well as the diffraction grating and the detector size determine the final wavelength resolution of the system.
Entrance slit
A laser beam (wavelength λ ) was sent through the slit (width D) to form a pattern of dots resulting from the diffraction of light. Projecting the resulting pattern onto a wall a distance L from the slit, shows dark regions whose angular separation θm are governed by sinθm=mθ/D , where m is an integer. This translates to a spatial separation on the wall xm=mλL/D, which is used to calculate D.
Diffraction Grating
Trial w/ fluorescent lamp
Estimated resolution:
- X = 17.7mm at focus → 10.2 nm/mm
- 50um slit image → 0.5nm potential resolution
Detector: VEML 7700
Potential improvements to the detector and grating could include:
Spectrometer Version 1
Spectrometer Version 2
- Repositioned optics for wider wavelength range.
- Mirror2 diameter = 2”
- Added baffle to block stray light
Optics Holders (version 1)
Optics Holders (Mirrors + Diffraction Grating)
Light Sources
Fluorescent light source
Tungsten Halogen light source
Laser light sources
- Turret design using a selector switch as the axel.
- Rotating the turret activates the laser when rotated to face the light entrance.
LED light sources
Scanning Hardware and Software
Linear Translation Stage + Motor
Stage (Focket): https://www.amazon.com/Linear-Stroke-Stepper-Motorized-Actuator/dp/B0CW3N3FKC?ref_=ast_sto_dp
- Effective stroke 100mm
- 1.8° step angle
- Pitch = 1mm 5um/step, = 0.05nm/ step
- Use 12v, 1A limit on motor supply
Stepper Motor Controller
- TMC2208 driver: simple to use (only 2 inputs) and less burden on Arduino computation. Provides quiet sinusoidal driver waveform (improves over A4988).
- Add 100uF capacitor on driver board for supply.
- Each digital pulse = 1 microstep (default = 1/8 step, 200 steps/ revolution). Other input is direction. Use delay(ms) command to set the rate of pulses.
- Uses a heat sink on top of the driver chip.
- 4 wires = 2 coils, no polarity, check which wire pairs have low resistance.
- Connect enable pin to Arduino pin 5 so when set low the motor is enabled and set high turns off the motor to minimize heating and energy use.
Hall effect sensors for sensing origin of detector
One way of knowing the position of the linear stage is to use a Hall Effect sensor bolted to the system base and a small magnet attached to the linear stage. This Hall sensor (3144) responds only to North pole pointing to flat face of the chip. Eliminate the LED (to reduce stray light) by disconnecting at junction with its 680ohm resistor and re-connect resistor to V+. The 3144 uses a Schmidt trigger to switch S pin from 5 to 0 volts when above the magnetic threshold. In this system, the motor is advanced until the sensor is triggered to always begin a scan at the origin (lowest wavelength).
Code for Arduino Uno
Note: Some sections of this code were extracted from various sources including Adafruit and Arduino.
Declarations
Load in the Adafruit library for the VEML 7700 detector and declare variables and constants.
Setup
Setup initiates serial communication for Excel Data Streamer, assigns pin values, initiates VEML detector, and disables the step motor to reduce energy usage and heating.
Main Loop
Loop waits for serial data to be detected by serialEvent subroutine, calls the parsing routine, and assigns the variable values from the input. If the StartMode value from Excel = 1, it then calculates and assigns the motor and wavelength calibration (within limits), sets the detector parameters, and runs the scan routine. While StartMode = 0 the user can type in all the Data Streamer outputs without triggering the scan.
Scan subroutine
RunScan enables the motor, moves it to the origin and halts. The variable SpecMode determines if it then scans the motor or moves just to the start wavelength for continuous monitoring of the detector signal until the reset button is pressed (SpecMode = 1). The scan can output either [wavelength, signal] (SpecMode = 0) or [motor step, signal] for wavelength calibration (SpecMode = 2). Wavelength is in units of 0.01nm as a long integer.
Motor subroutine
JogMotor sends a pulse to the motor control board with a period of 2*HalfPulseWidth.
Origin subroutine
GoToOrigin keeps reading the Hall Sensor and jogging the motor in the direction of the blue end of the spectrum (lowest wavelength) until it senses the magnet attached to the linear stage. This maintains the wavelength calibration.
Data In subroutine
serialEvent is triggered whenever a byte is received. It accumulates into inputArray[] until the line feed character is detected.
String parse subroutine
ParseCharArray builds a subarray [] from inputArray[] from bytes between the comma delimiter used by Excel Data Streamer, until the line feed character is detected.
VEML set subroutine
The VEML 7700 requires strings to set gain and integration time. These are selected from the variables VEML7700Gain and VEML7700IT.
Excel Data Streamer
Excel Add-In Data Streamer is used to provide parameters to operate the spectrometer, and to receive data. The parameters needed for this system are:
- Spec Mode: values allowed are 0 (scan from wave start to wave end; print wave(nm)*100, signal), 1 (go to wave start and hold; print wave(nm)*100, signal until reset button is pressed), and 2 (scan step start to step end; print motor step number, signal; used for wavelength calibration).
- Step 435nm (546nm): number of motor steps corresponding the 435nm (546nm) peak of a Hg source such as a fluorescent lamp, derived from the calibration.
- IT (ms): Integration Time of the VEML 7700 detector in milliseconds. The allowed values are 25, 50, 100, 200, 400, 800 ms, with default of 100ms. Longer time increases signal but increases the scan time.
- Gain: allowed values are 0 (gain = 1/8), 1 (gain = ¼), 2 (gain = 1), and 3 (gain = 2).
- Wave (nm) or Step Start: beginning of scan using wavelength in nm for SpecMode = 0, or motor steps for SpecMode = 2, or the hold wavelength in nm for SpecMode = 1.
- Wave (nm) or Step End: end of scan using wavelength in nm for SpecMode = 0, or motor steps for SpecMode = 2.
- Start: allowed values = 0 (stop), 1 (start). Enter the parameters with Start = 0, then set Start = 1 and hit Enter to start the run.
To run in Data Streamer Menu:
- Connect a Device
- Enter 0 for the Start parameter in Data Out sheet
- Fill in rest of the parameters
- Enter 1 for the Start parameter and hit Enter.
- Click Start Data in Data Streamer Menu to send data to the Data In sheet
Wavelength Calibration
To calibrate wavelength scale:
- Set up the fluorescent lamp source at the entrance slit.
- Click on Connect to a Device in Data Streamer
- In Data Out, set the Start to 0, Spec Mode to 2, IT = 100, Gain = 2, Step Start = 0, Step End to 2000 (depending on the optical component arrangement)
- Set Start to 1 and hit Enter
- Click on Start Data in Data Streamer
- Once the spectrum is captured and plotted, identify the motor steps for the 435nm and 546nm peaks by visual comparison to the published spectra.
- Set Start = 0. Type in the step values in Step 435 and Step 546 cells in Data Out sheet. Set Spec Mode = 0 for wavelength scan.
Data Communication
Under current conditions, the Data Streamer records about 2 to 3 errors on average during the accumulation of several thousand data points. Errors include missing digits or blanks. Plotting the data usually reveals the errors, which can be hand corrected. Attempts to adjust the Data Interval and Arduino baud rate did not seem to solve this issue. According to some experts, this is probably due to communication errors from the Arduino. A suggested fix is to use a more sophisticated micro-controller such as Adafruit Feather M4 Express. Perhaps this will be a future upgrade.
Application Spectra
Tungsten halogen lamp + matte tape at Entrance Slit (diffuser)
The lamp spectrum (3200K black body) is essentially increasing from 400nm over this wavelength range, but the response functions of the grating (above 600nm) and detector (above 820nm) and the mirror geometry reduce the signal at the higher wavelengths. The matte tape at the Entrance Slit helps remove spatial non-uniformities that would distort the spectrum.
Solar + Earth Atmosphere Spectrum
Spectrometer was attached to a telescope mount with a sight-tube for alignment to record the solar spectrum. Fraunhofer lines indicate absorption in the sun or earth atmosphere, characteristic of their chemistry.
Transmission Spectra of Liquids
- Tungsten Halogen light source
- Liquids in a 1 cm wide quartz cuvette
- Transmission = Spectrum with sample/ Spectrum with water only
Samples and Data:
- Steeping Tea: tea bag + 1 cup hot water. Samples taken after various steeping times. The water was allowed to cool as it normally would when making tea.
- Food coloring : 1drop/3 ml water
The amber color of this tea results from absorption of blue green vs. red wavelengths. Longer steep times increases the concentration of tea in the water, reducing the transmission. Plotting %T at 600nm vs. steep time shows a logarithmic dependence. After a typical steeping of 4 minutes, %T(600 nm) = 65%/cm for this tea.
Red dye primarily transmits above 600nm, absorbing blue and green. Yellow dye transmits about 540nm, absorbing blue. Green dye transmits only in the green around 515nm (the peak is small, making a dark green even at 1 drop/cc), and blue dye transmits around 460nm. The additional transmission above 680nm for green and blue is difficult for the human eye to see. At their peak transmissions, the green dye is 5x more absorbent than the blue dye at these concentrations.
Comments
Post a Comment