These are projects posted by the students of Dr. Gove Allen at Brigham Young University. These students have taken one semester-long course on VBA and generally have had no prior programming experience

Thursday, December 11, 2014

Using VBA to Analyze Sensor Data

My project was designed to solve a problem I was having while doing research on detecting objects using a near-infrared spectroscopy sensor. It provides data on the amount of light that objects reflect. This data could be very useful but it outputs the data in .txt files that are hard to interpret. My project was designed to turn that data into interpretive excel spreadsheets and also allow for comparison between various materials.

The system I built does so by first executing a ribbon tab called, “Sensor Data” and the button in this ribbon called “Bring in Data.” This runs a subroutine that does the following:

1.       Goes into each file in a folder called data with many .txt files
2.       In each file, it turns the data into an excel spreadsheet, first as a separate workbook that is copied into the main workbook as a tab that describes the data in the file. Prior to copying data into the workbook, all previous records on the main workbook are deleted so that no duplication occurs
3.       Once each file is analyzed and copied into the workbook as separate tabs, each tab is analyzed by a set of equations that tell about the data points. These formulas give the minimum reflectivity, maximum reflectivity, and the wavelengths at which these reflectivities occurred. They also give data about the ranges of wavelength and reflectivity.
4.       Each tab also shows a graph that has been properly zoomed to enhance the line plot
5.       For each tab, the important data points that were calculated are aggregated on the summary tab, which clearly states the name of the .txt file, which is also the name given of the object that was tested
6.       Now that each test object is aggregated, they can be compared for similarities that might distinguish unique characteristics of different types of material.

      Project Write-up

      Excel Spreadsheet

No comments:

Post a Comment

Blog Archive