This project is submitted for

Description

The aim of this project is to make spectroscopy a tool accessible to everyone, and not be limited to research and industrial applications. Spectroscopy is a powerful tool extensively used for diagnosing physical properties, assessing food quality, environmental sensing and various other applications.

We have built a portable, wireless spectrometer that talks to its companion Android application via Bluetooth to store and visualise the spectrum. We have used it for non-destructive testing of fruit ripeness (more on this below). Now we want everyone to build this device and start exploring the world around them. We are open sourcing all the build instructions, codes and design files required to build the device so that anyone and everyone can build one!

Details

A spectrometer is an instrument used for studying the interaction between matter and electromagnetic radiation. Spectrometers operate over both optical and non-optical wavelengths like gamma rays and X-rays. In general, any particular spectrometer will operate over a small portion of electromagnetic spectrum because of the different techniques used to measure different portions of the spectrum. Mostly these instruments measure wavelengths and their respective intensities, which upon detailed study reveal various information of the material under study. The intensity measured from these instruments can either be in absolute units or in relative units. Instruments measuring intensities in absolute units are usually called Spectrophotometers.

A spectrometer is a very powerful tool. By analysing intensity/wavelength pairs of the interacted EM radiation with the material under study, detailed information like its chemical composition, crystal structure and other elemental information can be extracted. It can also be used for food analysis. For example, it can reveal adulteration in milk or oil and analyse toxins to understand causes of food poisoning to name a few uses. We have used it to non-destructively measure fruit ripeness. Also, did we mention, the Curiosity Mars Rover also houses a suite of Spectrometers for analysing various rock and soil samples(more information can be found here). Spectrometers are awesome!!

In our build we have used the C12666MA mini-spectrometer from Hamamatsu. As discussed earlier, every spectrometer is sensitive over a small portion of the electromagnetic spectrum, so is this. Its spectral response is from 340 to 780 nm, detailed specifications can be found here. Check out our paper in Scientific Reports here.

Project Logs

In this app update, we have added the option for users to select which device they want to connect to, so that the app can connect to any device, irrespective of the name of the Bluetooth module used with the spectrometer.

A standard dialog with a simple list was used to achieve this trivial but much needed feature as users could previously only connect to devices named "HC-05". The update increases compatibility to any Bluetooth module irrespective of its model, make or name. The code changes can be found here on the commit log on GitHub.

We have successfully used the device for non-destructive testing of fruit ripeness. Ultra-Violet (UV) fluorescence from Chlorophyll present in the skin of three different kinds of apples - Red Delicious, McIntosh and Empire was measured over the period of 11 days. The data collected showed strong correlation with the ripeness measured by a penetrometer.

There are lot of interesting applications for such a portable device. Imagine carrying such a portable device when you next visit a supermarket, that helps you buy perfectly ripped fruits. Our work is published in Scientific Reports and you can read it in detail here.

We wanted the Android application to be compatible with as many Android devices as possible, so we ensured we only used features that were compatible with all devices running Android 2.3.3 or higher. This corresponds to 98.5% of Android devices. We also used Bluetooth 2.0 over BLE to ensure that maximum number of devices are supported. Using BLE would have reduced the percentage of supported devices (Based on statistics at the time of writing. Latest statistics can be found here).

Android Studio IDE was used to develop the application using the target SDK as Android 5.0 (SDK 21) but using only APIs that are supported down till Android 2.3.3 (SDK 10). The app was build incrementally by adding modules, starting from a basic skeleton for the overall app and then developing individual modules. The modules were refined as the app was built.

The overall architecture of the app consists of following modules with some overlap between modules:

The driver routine: This consists driver routines for the app so that app can initialize and move ahead to appropriate parts of the app based on user inputs.

The camera activities: To capture images of the objects being examined using the phone’s camera and save them onto local storage.

Bluetooth activities: To pair with the spectrometer over Bluetooth and to trigger the reading of data from the sensor. Once the data is received, it is cleaned, visualized and stored.

Visualization: To visualize the data received from Bluetooth and present it appropriately in the form of a plot so the spectrum can be observed.

Database and data export: To store the spectrometer readings, images and to allow the user to exported the stored data to an excel file for further analysis.

Considering the DIY nature of the build and need for constant modifications, we came up with a modular design for the housing. It’s small, everything fits neatly and at the same time gives easy access to different sections of the device for modifications. The device is split into four different sections -

1. Nozzle - This section houses the excitation source, LED.

2. Sensing Unit - The spectrometer and the optical filter sits in this section.

3. Processing Unit - It houses other main electronics which includes the microcontroller, bluetooth module, battery, and the buck booster.

4. Lid - There are no components in this section, once removed it provides access to battery connector for charging.

All the sections easily press fit into a neat little device that looks good and can easily be carried in a pocket. :)

All the design files can be downloaded from the ‘files’ section of this document. The files are available in ready to 3D print .stl file format and also in neutral file format for easy modifications! The parts designed are optimised for 3D printing and there is a file named ‘preferred_print_orientation’ that shows orientation of the parts on print bed while printing.

We wanted the device to be easily replicated by people and extend its capabilities and so in that effort we have build it using easily available modules. The list of materials is available in the components section.

All required components

Connections of all these modules can be found in the circuit diagram attached below.

The modules used have all their PCB design files easily available for someone who wants to build a single PCB board that houses all the components used in the device. This can easily be done by someone with skills of PCB designing and fabrication. It is totally optional and not at all required for building and testing the device. Complete build instructions will be updated soon.

C12666MA is a sensitive module and it will be good to avoid direct soldering to the pins. Making a socket is easy and prevents chances of any damage to relatively costly spectrometer module.

As the pins on C12666MA module are round, so for good electrical connection round female headers should be used (Link for reference - https://www.sparkfun.com/products/743). And you will also need a small piece of Perfboard (ref ) and after soldering the headers it should look something similar to the image below.

Build Instructions

The idea was to make a device that can easily be replicated by everyone, and so we have tried to use as much possible easily available modules. The device can be easily replicated and extended as per use case. In a nutshell the steps to be followed are mentioned below-

Source all the components/modules required.

Connect them together as per the circuit diagram.

Burn the code in the microcontroller.

Print the housing and assemble all the components inside

Download the android app

Start exploring!

Extract raw data and perform detailed analysis.

2

Step 2

The required components/modules are mentioned in the components section of the document.

The circuit diagram for connecting all the modules is given below.

3

Step 3

Burn the code available here to the microcontroller (Pro mini). Pro mini is a neat little board with just the essential stuff for making small packaging. So you would need external USB to UART board that will help you burn the code to the Atmega328p chip that sits on the board. USB to UART hookup guide can be found here.

Important Note:- Make sure the bluetooth module is not connected to the RX,TX lines while burning the code. It will be helpful to create a removable connector for bluetooth connections to the microcontroller using male female headers.

Now let’s check all our connections to know if everything is working as desired. Open your preferred serial monitor and send ‘s’ character. After few seconds you should see a stream of numbers. These are ADC readout values from the spectrometer. You can perform a quick check to know what the spectrum looks like by plotting those values. If the spectrums looks similar to one attached below, then you can tell that the light fixtures has white light LEDs in them. This is the characteristic spectrum from the white LED light source(more on this here). Exciting right!

We have a market for the use of spectrometers to measure and record BRIX readings (such as the SCiO), but our market(s) are not IT teco's. Nor am I, so if anyone can supply a finished working product, I am keen to buy!

Congratulations to your entire team. Do you have estimations on how many people contacted you, apart from this discussion board, about possible meaningful applications? According to your citations, grapes and apples are the only fruits with measurable quantities in UV/VIS range via antho/fyto cyanins. Have you read some articles with other important fluorescence markers in plants? Thx.

If only I remebered more about Electronics I would do one for my self! I am will ing to try this product in an intensive and industrial enviroment. Please contact me if you what to try it with Grape tomatoes And Cherry tomatoes in a real chalenging enviroment.

The goal would be to determine BRIX content in the fruit in a non destructive way.