Spectruino Installation and Getting Started Guide
Draft v1.1, 2017, Andrej Mošať, support[at]myspectral.com http://myspectral.com
- Spectruino 3
- Spectruino DIY
- Spectruino Space Edition
- Spectruino Deluxe
This document introduces the installation and getting started instructions for Spectruino Beta - the first opensource spectrometer.
How to install Spectruino
Installation Instructions for Arduino
- Install Ardunino Nano Drivers https://www.arduino.cc/en/Guide/Windows#toc4
- Arduino Nano needs FTDI Drivers (virtual COM port over USB) for your OS to be installed. FTDI Drivers can be found on: http://www.ftdichip.com/Drivers/VCP.htm Please try 32-bit version for Windows XP/Vista/7 first.
Installation Instructions for mySight software for Spectrometry
- download mySight from [https://gitlab.com/myspectralcom/mysight3]
- unpack the ZIP package into your home directory, say C:\
- run the software in a subfolder, Windows 7: C:\mySight3\application.windows32-windows7\mySight3.exe Windows 10: C:\mySight3\application.windows64-windows10\mySight3.exe
- Press "2" on your keyboard to detect Spectruino , or press "1" to start a simulation.
This step does only apply to calibrated devices, Spectruino Deluxe and Spectruino Space Edition. If you received calibration file in email attachment, please copy and paste the file "CFG-spectruino-calibration.txt" into the main folder of mySight application, e.g. C:\mySight3\CFG-spectruino-calibration.txt if running from source, or C:\mySight3\application.windows32-windows7\CFG-spectruino-calibration.txt if running from the compiled application.
If you use Processing source file, paste it into the C:\mySight3\ folder as well and run the sketch. The file contains calibration parameters and the serial number of your device. You should now see wavelength [nm] in the main graph window of the mySight application.
- if you experience any trouble, please install Processing language from Processing language download http://processing.org/download/
- Open the Processing sketch C:\mySight3\mySight3.pde and edit.
- Ping us on email if you need help. We are constantly updating the software on gitlab.
please rename the directory: mysight3-master-fea141a106b04b8939058e0267e7 to: mySight3 otherwise the Processing will not work
For programmers and software developers: mySight software algorithm
- open serial ports, find Spectruino
- read-in stream of bytes from virtual serial port over USB cable
- split the incoming byte stream into a byte array of length 501, check if the HEADER bytes are present and contain the correct size of the array "501" and “501"
- construct Spectrum class from byte array
- plot Spectrum
- wait for keypress 1, 2, 3, ..... 0 if numeric key pressed, send command to Spectruino: "Set exposure time (N)" where N is encoded in software
- in Spectruino, when SetExposureTime(N) is encountered, an interrupt is triggered, and immediately confirmation characters are sent back, even in the middle of data stream transmission.
- pressing the key "space" will display readings of wavelength intensity - see code for more information
- calibration file is read-in at the beginning, which converts x-axis "Pixels" into "wavelength [nm]", file must be present in the folder where the executable resides.
- mouse click on the graph to save a PNG image
Serial port UART RS232 Communication Protocol description
- Plug-in Spectruino into a free USB port
- Open serial port (e.g. COM4 on Windows) with your programming language (we recommend Processing)
- Serial byte array as integer values from 0..255 is sent from Spectruino to PC: [pixel1 value] [pixel2 value] ... [pixel501 value], char(A), char(x), 0x01, 0xF5, char(B), 0x01, 0xF5, char(c), char(y)
- new measurement on Spectruino takes place, CCD sensor is being exposed to light
- step 3 is repeated
- if incoming characters from PC to Spectruino are received, an interrupt is generated Setting new exposure time of the CCD sensor in Spectruino: Function setExposureTime(N) is called if you send the following 2 characters over the serial port: char(#) N where N is any hexadecimal byte from 0x01 to 0xFF
Measurement with Spectruino
Figure 1: Spectruino side view. G - diffraction grating, M - adhesive, S1, S2 - optical slits with approx. 150µm width, H - Arduino Nano v3.0 with Spectruino shield and Sony ILX554-B CCD sensor.
Figure 1 shows the side view cut through the spectrometer. Light wave enters through slit S1, passes through slit S2, and hits the surface of the reflective diffraction grating G attached through adhesive M. The zero-order diffraction is reflected internally at an angle not incident to the light sensor. The first diffraction order is reflected and falls onto the CCD sensor H in wavelengths of about 365 to 750 nm. Higher diffraction orders and other wavelengths are not recorded. CCD sensor is soldered on a printed circuit board with simple electronics for supply, clock, amplification and signal sending through UART over USB cable protocol.
Practical Measurement Setup
Figure 2: Spectruino side view with a) two slits in place, b) one slit in place. The incident light cone angle is very narrow, due to the dimensions of the slit openings, the incoming light must be near to normal to the slit plane.Configuration b) with one slit allows for wider light cone for incoming light, but the resulting measurement of peak wavelength will be shifted on the surface of the CCD sensor, thus reducing measurement precision.
Figure 2 shows the correct setup for measurement of a light source. The incident light needs to be oriented normal to the surface of the slit, or parallel to the surface of the CCD sensor. As there are differences in each manufactured piece, please adjust the measurement angle accordingly. In case you prefer less precision in your measurement, Figure [fig:sideview-measurement] b) shows configuration of spectrometer with just one slit in place. Please unscrew three torx nuts and carefuly take out slit S2. Beware that the calibration of the device is not valid anymore and needs to be repeated. During the measurement, it is advisable to start with higher exposure times. You can set higher exposure times in mySight software by running the software, detecting Spectruino (pressing “2”) and then adjusting exposure on numeric keyboard, for instance “4”. For a bright white LED, starting with “3” is recommended, adjusting down to “1” as needed.