In the Aspectra Mini, the scientific process of observing, measuring spectrum of light, consists of following technical parts:
Each of those technical tasks has the influence on the whole process, The quality of the whole process depends from the weakest member in the chain. I'll try to describe the each part with the technical approach.
A. Converting the light into the spectrum
The spectroscope is the part responsible of converting the light into spectrum. To see the details of Aspectra's realization visit my spectroscope project on Hackster.io
As in every technical design, some trade-offs must be made. The most important trade off concerns the size of input hole (the slit diapragm).
The bigger the hole, we get more light but more rough, imprecise plot. And vice-versa: the smaller hole, the more precisely plot, but fewer light
B. Positioning the spectrum on the sensor
Utilizing Android phone as the sensor for spectroscopy, we must define 3 items:
B.1. Defining Axis, X or Y .
Most of the camera sensors have longer X axis. The most common ratios of X/Y are 4/3, 5/4 or 16/9
In the most mobile devices, camera orientation is similar to device orientation: both at the same time in the portrait or landscape mode
To identify the Axis positioning of spectrum, we should make the following steps:
With the sample spectroscope, build for Nexus 5, we use camera short axis as the spectrum lambda axis
B.2. To identify the direction (sign) of the x axis of the plot:
Set the proper axis in prefs
With the mounted spectroscope, observe the spectrum of the whichever light
Set rough the area of interest (with four lines in camera preview)
remove the spectroscope
observe the well defined picture with device camera. As well defined picture I mean the area with difference in the illumination between right part and left part
The intensity of the plot, in the plot-fragment, should match or correspond to the brightness of the picture. F.I. If the picture on the left is dark, then the intensity shown in plot should be small on the left too. (Leave the mirror setting Off). If intensity on the plot is dark on the right, then set the mirroring in preferences On.
C. Converting the light, falling on the camera, into the intensity plot
From the whole picture, the area of interest will be read the in YUV format. We can define two axis for our AreaOfInterest: X (length) and Y (width).
Based on our settings in CameraPreviewView, we have defined four points: Xend, Xstart and Ystart and Yend = Ystart + Ywidth.
In the plot area, along the X axis we get Xlength = Xend – Xstart
Important notice: the X axis dimension is in pixels.
In Y axis: we add together all the pixel in Y direction and normalize ( max value will be 1024 for the white saturation)
The Y axis dimension in digit, from 0 (dark) to 1024 (white saturation)
To see the details of implementation, please visit the Github repository and check the source code
D. Calibration, defining the intensity of the plot as function of lambda (light wave length)
The spectrum plot, shown in App-plot-area, shows the intensity of light as the function of the camera pixel's index.
To get the plot results as the function of lambda (light wave length) the the whole system need to be calibrated.
Calibration means the assignment, relation between light wave lambda and pixel index
The are some conditions, which must be fulfilled, to allow calibration. The main condition is the stable montage of spectroscope with light sensor. The actual version of spectroscope (as shown for Nexus 5) doesn't allow stable build.
It is a new version of spectroscope in preparation, which allows both: the stable and universal montage on the most of the Android devices.
In the calibration phase, the color LEDs will be placed near the input of spectroscope.
On Android device, the color bar can be moved and stretched below the plot area.
The color bar will hold the lambda markers for every LED.
In the measurement phase, the color bar will be shown near the plot, as the orientation for observed results.