Open Source Spectrometer Python Scripts
APACHE-2.0 License
This repository provides scripts for the open spectrometer project to enable practitioners, students and citizen scientists to collect data with their spectrometer and have a good and fun learning experience. Enjoy!
The open spectrometer project consists of a web cam, simple lasercut parts, battery casing and a suitable LED lightning component. The spectrometer connects to a computer via USB, where the user can run the scripts provided in this repository to run experiments and take measurements. The two main components of this repository are analyse.py and calibrate.py. The analyse.py script is used to plot the absorbance spectra of measurements taken with a webcam spectrometer. The calibrate.py is useful for advanced users who want to understand the mechanics of scientific measurements and understand how to assess the quality of the data generated.
By definition science should be open and reproducible. So, the outcome of an experiment can be verified by anyone. Unfortunately today this is not always the case. In order to be able to verify experiments all components used should be openly accessible. This includes the software and hardware of scientific instruments. Our spectrometer project follows this path. By giving access to all layers of the device used in a scientific experiment users can develop a deep understanding how scientific measurements are taken and practitioners are able to critically understand the limitations of one particular instrument.
The spectrometer community is still small. There are overlaps with the Pocket Science Lab team. To stay connected with different community members we continue to use the PSLab Gitter channel for the beginning. We will set up a dedicated channel once the project is more established. Please join us here:
Feature | Description | Status |
---|---|---|
USB Connection | Transmit data using USB from a compatible spectrometer to a computer | ✔️ |
Generate PNG | Run the software on www.spectralworkbench.org with samples | ✔️ |
Calibration | Calibrate using calibrate.py and report in analyse.py | ✔️ |
Scripts in Browers | Scripts can be executed in the browser using repl.it | ✔️ |
Scripts Locally | Scripts can be executed on the computer without Internet | ❎ |
Generate PNG Locally | Generate png images from collected data without Internet service | ❎ |
Calibrating a spectrometer means referencing the values that otherwise would represent pixels, and turning them into wavelengths, which is what the spectrometer is meant to measure. In order to create a correlation between pixels and wavelengths, a mercury light bulb is used, a compact fluorescent light (CFL). Because of its sharp emission peaks, it is possible to assign to some pixels some specific wavelength values and infer all the others.
As a reference you can use Wikipedia to view an image for the fluorescent lightning spectrum here .
Steps to use calibrate.py:
This project was started by Alessandro Volpato. We welcome new contributors and feedback of users from around the world. Thank you!
This projects is licensed under Apache v.2.0.