Low-cost scalable BLE Temp&Humidity sensor to prevent food spoilage and enable asset tracking of food.

Food spoilage and wastage is a major issue in both developed and developed nations. Countries like China,India has been plagued by tainted milk, meat, and grain that have endangered people’s health in recent years. A study on global food wastage found that about 21 million tonnes of wheat go waste in India. Despite proper storage conditions, There is a lack of a low-cost scalable solution to detect spoilage of food. FoodBeacon aims to fix it by measuring humidity and temperature of the food items from the warehouse near a farm to the food retailer. The anomalous condition of grain spoilage and meat rot are detected in advance to prevent fungal infections and incidence of food poisoning. FoodBeacon nodes are 6$ coin sized sensors that can be deployed to either grain sacks or meat refrigerator. Temp&RH, Volatile Organic Gas and motion sensor data is sent over BLE to a mobile gateway unit, FoodBeacon adds traceability to the food supply chain thus empowering customers.

The application of IoT in food supply chains (FSCs) is one of the promising applications. There is an imperative need for ensuring food quality across the supply chain. Achieving the objectives of food quality partly relies on physical traceability throughout the chain. Automation of this process can reduce corruption in the process and will have a positive impact on the health of consumers. The era of IoT brings about new connections between food producers, transportation and retail companies who can work now together to ensure efficient delivery and food safety. Groups across the supply chain gain the real-time visibility and enable the automated, intelligent actions needed to ensure food is of the highest quality, delivered on time and prepared in optimal settings. FoodBeacon aims to be extremely low cost aiming to mimic ideas relating to the IoT smart dust, Advent of low-cost BLE MCU's like the Nordic nrf51822 makes it possible to get connectivity at low power in a size of a coin.The sensors used are HDC1000/HTU21 for Relative Humidity and temperature and a MiCS5524 to detect VOC's, Ethylene and Ethanol produced during rotting of meat along with motion sensors using an ADXL345 to detect the impact, vibrations, and handling during transit.Data from these sensors are sent to a gateway device which uses WiFi for the prototype but would use mobile data in the final design of the device.A smartphone app would be developed to visualize the data and alert if rot is detected, Further, the app would enable inventory and delivery management. (PICTURE 2)

Step 1: Beginnings

The idea was conceptualized a few days back when I read a newspaper article on the widespread food spoilage even during drought conditions in my state.

The cause was identified as fungal infection in grains and spread of salmonella in meat due to improper refrigeration. Doing some research I was unable to find a connected sensor solution to detect and monitor food spoilage and rot. I decided to build my own low-cost BLE-based mesh sensor that can either be dropped inside grain sack to monitor relative humidity or set alongside meat packaging to detect volatile organic compounds emitted during decay. I hope that this project can bring attention to food spoilage and by optimizing the food supply chain using FoodBeacons it is my belief that not only accountability will result in safer and fresher food but also overall food wastage would be minimized. Food surplus was a gift given by our ancestors and it is something we must take utmost care when millions starve worldwide.

Food wastage estimate


For the implementation of the project, we chose to use BLE for communication due to ultra low power and the backbone already established by iBeacons.The LightBlue bean despite being expensive was chosen for the prototype due to its insanely small size and inbuilt cr2032 battery.The code was compatible with Arduino, So it would be easier to develop our application.The sensors we chose to work on our first revision is the HTU21 humidity sensor and an MICS5524 sensor. The data would be read by a Raspberry Pi3 which would be a gateway device to upload the data to a cloud service like Thingspeak or Node-Red.For the first prototype, we want to implement our idea and record the sensor data and find out the issues to iterate our design.A sketch of our implementation is attached.

Step 3: Humidity & Temperature Sensing

We have used an HTU21 for now with our system though we want to use an HDC1000 with our FoodBeacon due to its capacitive sensing technique which would enable us to make our sensor air sealed in it's design to increase reusability.Hooking up to the lightblue bean was rather easy and we soldered a 4-pin JST connector to the blue bean.(PICTURE 1 & 2)

Thanks to the code compatibility of the lightblue bean, We were able to get the Humidity and Temperature sensing up and running. Here is a snapshot of the data ( PICTURE 3).

We also decided to get some data points in a container in the fridge


Internet Of Chillies!

Step 4: Software

To get a grab hold of the data and notify us of certain conditions, we planned to interface the raspberry pi3 to the NODE-RED online platform. By doing so we can program it to send the obtained data directly to our e-mail on predetermined conditions.

For example, if the temperature of the refrigerated meat is over a certain threshold, An alert can be triggered to notify the relevant personnel.Here is an actual view of the online NODE-RED platform to connect the data from raspberry pi3 to our e-mail. (PICTURE 1)

We had to do some programming to keep our device running perfectly so that the email service is being triggered on apt conditions
Below here is the actual snippet of the coding to set up a threshold value as a trigger point. (PICTURE 2)

Step 5: Deploying the Code

On deploying the code we were finally able to finish the loop of getting data ,using raspberry pi3 as gateway device by communicating with the cloud to get data logs on client's devices.

Here is our final hardware for this setup (PICTURE 1)

Step 6: HDC1000 PCB's Arrived

Though I planned on designing a PCB from scratch for the HDC1000 sensor, I found the amazing work Francesco Truzzi did (http://b.truzzi.me/hdc1000-temperature-and-humidity-sensor-breakout-with-arduino-library/) in designing a neat tiny breakout board for HDC1000.I did some size reduction and sent it to OSHpark and the PCB's arrived yesterday.

Step 7: Soldering

I soon got started to solder teeny HDC1000 sensor, The BGA package turned out to be quite a challenge to our amateur SMD soldering skills.

Step 8: FB V 1.0 READY

After a few dead boards, We got a working one!

<p>This is very well thought out, and it's a fantastic example of the real-world problem solving that the maker community is frequently praised for.</p><p>Great job! Voted. </p>
<p>Thanks a lot!</p>
great project! I'll add this my my to do list.

About This Instructable




Bio: Ideologist, Innovator, Environmentalist
More by Vijayakumar Anbalagan:CODE RED FOOD BEACON (FB) 
Add instructable to: