Back close

Development of Portable Spectrophotometer for Milk Quality Analysis

January 2, 2019 - 9:00
Development of Portable Spectrophotometer for Milk Quality Analysis

Abstract: In this article, we present our ongoing work in the development of a portable spectrophotometer for monitoring the quality of milk. We have constructed it with a single chip spectral sensor which gives a low-cost solution for monitoring cow health and milk quality paving the way for farm automation for small scale farmers and dairy societies.


Milk is an important food for man from ancient days, because of its balanced combination of nutrients. In olden days milk from animals was used within one day. With the increase in population and urbanization,  it became necessary to preserve milk for more days which lead the path to process milk in different form like pasteurized milk, toned milk, milk powder, etc. From this evolution, it became necessary to monitor the quality of milk in terms of nutrients and adulteration.

Many chemical and physical methods are available for milk quality analysis but they are either expensive (about INR 35000), or of lower resolution(which cannot monitor most adulterants). The most common detector used is the Lactometer which detects adulteration by water, comparing densities. Ultrasonic systems which can monitor multiple components exist but they are very expensive for small scale farmers. Hamann and Kromker (1), have reported that,the health condition of the cow can be analyzed by meticulous monitoring of the milk components. B. Aernoutset al. (2) reported that, visible and near-infrared spectroscopy can be used as a useful tool for the analysis of milk components like crude protein, lactose, and fat. They used the full range of wavelength from 400 to 2500 nmto determine milk components and identified that the wavelength above 1000 nm is most suitable for the analysis.

We focus our research on the determination of components of milk with a range of 410 to 940nm. This range is inside the silicon photodiode range in which low-cost sensors are readily available. As the first step, we investigated water adulteration in milk at 6 visible wavelengths and obtained nearly linear results at one wavelength and sensitive results at others.


Cow milk is a highly complex solution which contains many components. Approximate composition of cow milk is 86% water, 4-5% lactose, 3% protein, 3-5% fat, 0.8% minerals and 0.1% vitamins. Among this, fat is responsible for sensory properties. (Triacylglycerol is the main fat in cow milk). (3). If a reliable wavelength correlating to absorption of these components can be monitored with high accuracy. In literature, it is found that, some wavelengths in the range 400-1000 nm can be used to show good correlation with variation in fat content of the milk. (2). We suspect that there will be wavelengths corresponding to protein and lactose in this region which can predict their concentration with needed accuracy.


The experiment is performed with AMS AS7262, AS7263 spectral sensors which have 12 photodiodes equipped with Fabry-Perot interferometric filters. This sensorcan sense 12 distinct wavelengths with a bandwidth of 20nm. A custom box is designed to house the sensors and I2c connection is established with the sensor. An open source Microcomputer Raspberry Pi is used for data acquisition. A custom library is developed in our lab for data acquisition, conditioning, and visualization. This instrument can take the measurement in both reflectance and transmittance modes.

The sample is prepared by taking 100ml of milk in a measuring jar and is added with a suitable amount of water in steps and repeated measurement is taken. Fiber cuvette, which is cost-effective, is used for measurements.

Reflectance Measurement

Transmittance Measurement

Experimental Setup

AS726X sensor

Results and Discussions

In the present stage of the project, we have analyzed milk from different sources, viz., local cow milk, MILMA milk (milk from Kerala Co-operative Milk Marketing Federation) and commercial milk powder (Nestle Everyday) for detecting adulteration with water. Fig1 shows the reflectance as a function of the concentration for different wavelengths and Fig2 shows the reflectance vs. wavelength for different concentrations. All the data were acquired using 5700K LED light source. To correct the influence of the light source and cuvette in spectra, empty cuvette reading was subtracted from spectral reading of milk.

From these observations we can conclude that the transmission spectrum of milk is changing with wavelength and milk concentration. As shown in Fig1, the variation of the 450nm channel with concentration is monotonous and is thus a good candidate for monitoring the concentration. In other channels such as 550,570, 600nm we observe non-monotonous variation with concentration that needs further investigation.

If we succeed in the determination of at least three components accurately it will result in an accurate device with only a fraction of the price of commercial devices (price of components used is given in table1 and table2). More experiments should be conducted and suitable data processing methods should be developed to overcome limitations of spectral range.

Fig1: concentration vs intensity of reflected light (with dark subtraction) of milk powder and pure milk water is added in steps of 10ml and 5ml

Fig2: wavelength vs intensity of reflected light of pure milk and milk powder for different concentration.
Component Price (INR)
Spectral sensors (12 channel) 2*1510=3652
Raspberry Pi 2990
Cablesand housing 300
Cuvette 20
Total 6962

Table 1: price of component for our experimental setup

Component Price (INR)
Spectral sensor 1510
Arduino 450
Cuvette 20
Cables and housing 300
Total 2280

Table 2: price of components for the proposed device


We have proposed a device for monitoring the milk quality based on open source component spectrophotometry that can be locally made in low cost (less than 3500INR). We showed that it can be efficient for monitoring milk concentration, and if all spectral lines are well understood it could also monitor fat content and give good insights on cow health.

This device could be used as a portable device by health officers for milk quality monitoring, or by farmers. For this to be achieved more research should be done to refine the theory, experimental and data processing procedure. We hope this research will give useful results to the research world and society.


  1. Visible and near-infrared spectroscopic analysis of raw milk for cow health monitoring: Reflectance or transmittance
  2. Aernouts, E. Polshin , J. Lammertyn , and W. Saeys (doi: 10.3168/jds.2011-4354)
  3. Spectroscopic analysis of milk fat and its mathematical evaluation. H. Vaskova, M. Buckova, and L. Zalesakova
  4. Potential of specific milk composition variables for cow health management. J.Hamann,V. Kromker

“This article is authored by Prasanth Prasenan, Gauthami Viswan, Keyan Bennaceur, Department of Physics Amrita Vishwa Vidyapeethm, Amritapuri”

Admissions Apply Now