Close

An Improvement and an Unfixed Bug

A project log for Pi Spectrophotometer Tests Olive Oil

An RPi spectrophotometer distinguishes extra virgin olive oil from canola oil and light olive oil.

daniel-james-evansDaniel James Evans 08/29/2019 at 02:430 Comments

I changed the code so that it takes 3 images and averages them, instead of taking 1 image.  This dramatically improves the precision of the device.

I found a major bug in the code: the x-axis was reversed!  This escaped detection because there are peaks on both edges of the olive oil spectrum.  But when I started averaging images (see above), it became apparent that the right-side peak was much bigger than the left-side peak.  This is incorrect; it caused me to investigate and find the bug.  I still haven't fixed the bug; I need to do this before taking more measurements.  The spectrophotometer is currently NOT accurate (because of the bug); it should NOT be used right now.  I hope to fix the issue soon.

Discussions