Vintage Plotter Turned Fruit Spectrometer

Fruit can be a tricky thing: if you buy it ripe you’ll be racing against time to eat the pieces before they turn into a mushy mess, but if you buy the ones which are a bit before their prime it’s not always easy to tell when they’re ready to eat. Do you smell it? Squeeze it? Toss it on the counter to see if it bounces? In the end you forget about them and they go bad anyway. That’s why here at Hackaday we sustain ourselves with only collected rainwater and thermo-stabilized military rations.

But thankfully Cornell students [Christina Chang], [Michelle Feng], and [Russell Silva] have come up with a delightfully high-tech solution to this decidedly low-tech problem. Rather than rely on human senses to determine when a counter full of fruit has ripened, they propose an automated system which uses a motorized spectrometer to scan an arrangement of fruit. The device measures the fruit’s reflectance at 678 nm, which can be used to determine the surface concentration of chlorophyll-a; a prime indicator of ripeness.

If that sounds a bit above your pay grade, don’t worry. The students were able to build a functional prototype using a 1980’s era plotter, a Raspberry Pi, and a low-cost AS7263 NIR spectral sensor from SparkFun which just so happens to have a peak responsivity of 680 nm. The scanning is performed by a PIC32MX250F128B development board with an attached TFT LCD display so the results can be easily viewed. The Raspberry Pi is used in conjunction with a Adafruit PCA9685 I2C PWM driver to control the plotter’s stepper motors. The scanning and motor control could be done with the PIC32 alone, but to save time the students decided to use the Raspberry Pi to command the PCA9685 as that was what the documentation and software was readily available for.

To perform a scan, the stepper motors home the AS7263 sensor module, and then passes it under the fruit which is laying on a clear acrylic sheet. Moving the length of the acrylic sheet, the sensor is able to scan not only multiple pieces of fruit but the entirety of each piece; allowing it to determine for example if a section of a banana has already turned. The relative ripeness of the fruit is displayed to the user on the LCD display as a heatmap: the brighter the color the more ripe it is.

At the end of their paper, [Christina], [Michelle], and [Russell] note that while the scanner worked well there’s still room for improvement. A more scientific approach to calculating how ripe each fruit is would make the device more accurate and take out the guess work on the part of the end user, and issues with darker colored fruit could potentially be resolved with additional calibration.

While a spectrometer might sound like the kind of equipment that only exists in multi-million dollar research laboratories, we occasionally see projects like this which make the technology much more accessible. This year we saw a compact spectrometer in the Hackaday Prize, and going a bit farther back in time we even featured a roundup of some of the most impressive spectrometer builds on

[Thanks to Bruce Land for the tip.]

9 thoughts on “Vintage Plotter Turned Fruit Spectrometer

  1. Ah ha, good to see, I covered this post-grad in food science 2010 and indeed has useful aspects all sorts of applications for precise NIR along also with fiddling isoelectric points if you want to extract interesting proteins ie in conjunction for best signal/noise ratio…
    The trick here in terms of extrapolation would be to observe the changes as they converge over time to determine a rate assessment towards appropriate ripeness for the species rather than a static measurement at the time.
    IOW. Collect the data regularly and see where it converges on an asymptote with a bit of curve fitting then confirm – this way you can include effect of more variables such as exposure to ripening gasses, temperature and sunlight ie correlated with an extrapolation for best fit time to consume.
    In essence best time to consume fruits/veg is not when fresh, it’s the period between ripeness and earliest onset of spoiling as cells easier to digest and vit B series highest. Bit of bacteria at that time not an issue unless you are aware of pathogen risk for the species where it’s grown and keep up to date with mutation potentials eg industrial chemicals trapped/exploited in commensul bacteria.
    Fwiw. Chlorophyll great though also of value given widespread mineral deficiencies in so many people some leading to cognitive deficits especially worrisome for vegetarians and even worse for vegans would be chlorophyllin. I have some in my bio fridge, a great dye and healthy to consume even healthier if sodium replaced by potassium as aid to cardiac rhythm moderation and neural enhancer ;-)
    Great to see posts on diverse subjects, thanks :-)

    1. Great to see more spectral analysis posts.

      I really enjoyed the non-destructive nature of FT-NIR spectroscopy and even the other types of NIR systems (AOTF, Dispersive, Hyperspectral, etc.) were neat to work with.

      Seems an algorithm like image stitching to increase resolution might be able to be digitally performed maybe with multiple scans as well as an algorithm to create a hyperspectral image since reads like more than the 680nm channel is being used… like 6 channels if I heard correctly.

      Like moving forward with ABB to aid in designing a broader range IR-NIR-UV-Vis spectrometer system solution… will be nice to see the same in an open source broader range IR-NIR-UV-Vis spectrometer system solution more-so. I think styropyro’s last video inspired me to look more into the filters on the market that change frequency so maybe a single source emitter can be used say from a laser pointer or maybe something more off the shelf for an interferometer type system. Even if multiple sources and detectors are used… seems really interesting what is open source and do-able. I’ve wondered if something really accurate like a hard drive needle head, arm and controller is consistent and accurate and may even be a decent case for a system grating/filter.

      I last left off wanting tested more and developing a wedge, or multipath length cell basically, for the sample to be held in one prep so that single prep can be more easily scanned in the whole range in diffuse reflectance with a 99% reflectance std backing from IR-NIR-UV-Vis versus an ATR for IR. I didn’t get into the Terahertz region as much… though the little work we did… was interesting in regards to equivalent capabilities outside of an ionizing radiation range to see inside specimens.

      1. Sounds like a great idea but it will have to be “housebroken” from the get-go. I do *NOT* want to be awakened at 3 a.m. just to be told that the hand of bananas in my fruit storage unit needs to be eaten ASAP. :-)

        1. I don’t know…

          Sometimes I think it might actually take that degree of precision and urgency to actually get to eat a banana when it is best. Those things are horrible when at all unripe and only good for a very short time once ripened! I stopped buying them a long time ago because I was wasting too many.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.