/laser-light-meter

A light (power) meter for PWM laser light. A desktop application written in GitHub Electron with a Python backend communicating with an ATmega32U4 collecting data from a phototransistor.

Primary LanguageJavaScriptMIT LicenseMIT

Laser Power Meter

This application provides data collection, statistical analysis, and data visualization for a custom light meter. The meter measures the output of a diode laser using a photo-transistor.

Schematic

This converts the laser's signal into a pulse-width-modulated voltage that is measured by an Arduino LeoStick.

Meter

This program also fires the laser asynchronously via remote-command-execution on the laser host. The laser firing and data collection subroutine alternates firing and collecting to generate and collect data samples.

Sample Data

The Arduino is connected to the host computer via USB tty. The tty data are collected by means of a Python script that receives JSON formatted data from the Arduino and saves it in files in the applications' data folder.

data collection

Once all the data files have been collected another Python script runs a machine learning algorithm over the data to produce a model that detects features in the data that allow it to categorize each sample by the duty cycle in the signal.

histogram

Repeated measurements of this signal characteristic over time capture the gradual decline in laser power output. This information permits the operator to predict impending laser failure and refurbish the laser. Laser failures waste costly material and upset production schedules. Data visualization is done by another Python script which generates charts.

probability distribution

Credits

  • The firmware operates the micro-controller in free-running ADC mode accumulating measurements in a low-latency ring buffer provided by Lyle Moffitt.
  • This application is powered by GitHub Electron.
  • The responsive design of the user interface is provided by Bootstrap 4.
  • The behavior of the user interface is powered by jQuery.
  • The HTML is made composable by a Node.js package named Cheerio
  • The database is SQL.js.
  • The remote-command-execution is provided by Python Paramiko .
  • The tty integration is provide by Python pySerial
  • The machine learning tools are provide by Python SciKit-Learn .
  • The data visualization are provided by Python Matplotlib .
  • This application was developed using GitHub Atom and JetBrains PyCharm CE.
  • Application packaging is provided by Electron Packager and Electron Installer DMG.
  • The banner art comes from "Teahouse at Koishikawa the morning after a snowfall" by Hokusai Katsushika (1760-1849).
Patrick Moffitt, CSM, M.A.
January 8, 2018

Project Status

This project has been archived and is no longer being maintained by the author.