You are on page 1of 58

A MINI PROJECT REPORT ON

“FOOD QUALITY MONITORING SYSTEM”


A Project report submitted in partial fulfilment ofrequirement for the
award of the degree of

BACHELOR OF TECHNOLOGY
IN

ELECTRONICS AND COMMUNICATION ENGINEERING BY

NAME REGISTER NUMBER


P. Manojkumar (18091A04A3)
M. Obaiah (19091A04C8)
M. Rakesh (20095A0413)
C.V. Dinesh Reddy (19091A0437)

Under the guidance of

Dr. P.V. GOPI KRISHNA RAO M.E, Ph. D


Professor, ECE Department

ESTD -1995
DEPARTMENT OF ELECTRONIC AND COMMUNICATION ENGINEERING

RAJEEV GANDHI MEMORIAL COLLEGE OF ENGINEERING& TECHNOLOGY


(AUTONOMOUS)
Accredited by N.B.A & NAAC of UGC, New Delhi with ‘A+’ Grade
Approved by AICTE, Affiliated to J.N.T.U.A- Anantapuramu,
Nandyal-518501
RAJEEV GANDHI MEMORIAL COLLEGE OFENGINEERING & TECHNOLOGY
Autonomous
Affiliated to J.N.T.U.A - Anantapuramu, Approved by A.I.C.T.E., New Delhi,
Accredited By N.B.A. & NAAC with ‘A+’ Grade -New Delhi,
NANDYAL –518501, Kurnool Dist. A.P.

ESTD -1995
CERTIFICATE
This is to certify that the dissertation entitled “FOOD QUALITY MONITORING SYSTEM ”

that is being submitted by P.MANOJ KUMAR (18091A04A3), M.OBAIAH (19091A04C8),

M.RAKESH(20095A0413), C.V.DINESH REDDY(19091A0437) under the guidance of

Dr. P.V. GOPI KRISHNA RAO M. E , Ph. D for Mini Project for the award of B.Tech Degree

in ELECTRONICS AND COMMUNICATION ENGINEERING in the RAJEEV GANDHI

MEMORIAL COLLEGE OF ENGINEERING & TECHNOLOGY, Nandyal (Affiliated to

J.N.T.U.A,Anantapuramu) is a record of bonafide work carried out by them under our

guidance and supervision.

HEAD OF THE DEPARTMENT PROJECT GUIDE

Dr. P.V. GOPI KRISHNA RAO M. E ,Ph.D


Professor in ECE

Signature of the External Examiner


Date:
CANDIDATE’S DECLARATION

We hereby declare that the work done in this Project titled “FOOD QUALITY MONITORING

SYSTEM ” submitted towards completion of mini project in III Year II Semester of B.Tech(ECE) at

the Rajeev Gandhi Memorial College of Engineering & Technology, Nandyal. It is an authentic

record of our original work done under the guidance of Dr. P.V. GOPI KRISHNA RAO, Professor,

Dept. of ECE, RGMCET, Nandyal..We have not submitted the matter embodied in this project for

the award of any other Degree in any other institutions.

SUBMITTED BY:

P.Manoj Kumar 18091A04A3

M.Obaiah 19091A04C8

M.Rakesh 20095A0413

C.V.Dinesh Reddy 19091A0437


ACKNOWLEDGEMENT

We manifest our heartier thankfulness pertaining to your contentment over our project
guide Dr. P.V. GOPI KRISHNA RAO GARU, Professor of Electronics and Communication
Engineering department, with whose adroit concomitance the excellence has been exemplified in
bringing out this project to work with artistry.

Involuntarily, we are perspicuous to divulge our sincere gratefulness to our Principal, Dr.T.
JAYACHANDRA PRASAD GARU, who has been observed posing valiance in abundance
towards our individuality to acknowledge our project work tangentially.

At the outset we thank our honorable Chairman Dr. M. SANTHI RAMUDU GARU,
for providing us with exceptional faculty and moral support throughout the course.

Finally, we extend our sincere thanks to all the Staff Members of ECE Department who have
co-operated and encouraged us in making our project successful.

What ever one does, what, ever one achives, the first credit goes to the PARENTS be it not for their
love and affection, nothing would have been responsible. We see in every good that happens to us their love
and blessings.

SUBMITTED BY:

P.Manoj kumar 18091A04A3

M.Obaiah 19091A04C8

M.Rakesh 20095A0413

C.V.Dinesh Reddy 19091A0437

DEPT OF ECE, RGMCET iv


FOOD QUALITY MONITORING SYSTEM

ABSTRACT

Food plays a very important role in our day-to-day life. With an increase in globalization
quality of food decreases day by day. In most of the time various food processing is done to keep the
food fresh. Various preservatives or the ingredients are added in the food so that it looks like fresh or
tempting. Now most of the food is preserved with chemicals which causes the food contamination.
This contamination leads to various diseases which results that consumer wants healthy food. The
people want organic food for healthy lifestyle. So, to avoid the problems associated with the food
without human interpretation we need such a device which helps to determine the quality of food.
There is a requirement of such a device which guides us about the hygienic food. Hence to fulfill this
consumer demand we made a device that checks whether the quality of food is good or bad. This
system represents the use of various sensors in the field of the food industry. The sensors like DHT11
sensor, gas sensor, temperature sensor help in identifying the condition of food. This system makes
an effective presence in restaurants, households, small scale industries.

DEPT OF ECE, RGMCET v


FOOD QUALITY MONITORING SYSTEM

INDEX

List of Contents

CHAPTER -1 ........................................................................................................................................................ 1

INTRODUCTION AND LITERATURE SURVEY ......................................................................................... 1

1.1 INTRODUCTION ....................................................................................................................................... 1

1.2 LITERATURE SURVEY ........................................................................................................................... 2

CHAPTER-2 ......................................................................................................................................................... 3

INTRODUCTION TO PROPSED WORK ....................................................................................................... 3

2.1 PROPOSED WORK ................................................................................................................................... 3

2.2 BLOCK DIAGRAM ................................................................................................................................... 4

CHAPTER-3 ......................................................................................................................................................... 5

IMPLEMENTATION PROCEDURE OF PROPOSED WORK .................................................................... 5

3.1 ARDUINO IDE ........................................................................................................................................... 5

3.2 ARDUINO SOFTWARE INSTALLATION STEPS: ............................................................................. 6

3.3 INSTALLATION STEPS ......................................................................................................................... 12

CHAPTER-4 ....................................................................................................................................................... 14

HARDWARE DESCRIPTION ......................................................................................................................... 14

4.1 ARDUINO UNO ...................................................................................................................................... 14

4.1.1 INTRODUCTION TO ARDUINO UNO ....................................................................................... 14

4.1.2 ARDUINO PIN DESCRIPTION .................................................................................................... 15

DEPT OF ECE, RGMCET vi


FOOD QUALITY MONITORING SYSTEM

4.2 Power Adapter: ......................................................................................................................................... 18

4.3 DHT11 SENSOR:...................................................................................................................................... 18

4.3.1 COMPARISION BETWEEN DHT 11 AND DHT 22 .................................................................. 19

4.3.2 DHT11 Working Principle .............................................................................................................. 20

4.4 GAS SENSOR: .......................................................................................................................................... 21

4.5 Light Dependent Resistor (LDR) ............................................................................................................. 21

4.5.1 OPERATION OF LDR: .................................................................................................................. 22

4.6 BREAD BOARD: ...................................................................................................................................... 22

4.7 Liquid Crystal Display (LCD) ................................................................................................................. 23

4.7.1 Advantages of LCD screen .............................................................................................................. 24

4.8 WIFI MODULE. ....................................................................................................................................... 25

4.8.1 SPECIFICATIONS AND FEATURES: - ...................................................................................... 26

4.9 Jumpers: .................................................................................................................................................... 27

CHAPTER 5........................................................................................................................................................ 28

PROJECT DESCRIPTION ............................................................................................................................... 28

5.1 CIRCUIT DESCRIPTION DIAGRAM.................................................................................................. 28

5.2 BLYNK APP ............................................................................................................................................... 29

5.2.1 FEATURES OF BLYNK APP: ............................................................................................................ 30

5.2.2 CREATE A BLYNK ACCOUNT ................................................................................................... 31

5.3 Construction Process ................................................................................................................................ 32

5.3.1 Gas Sensor Testing on breadboard ................................................................................................ 32

5.3.2 DHT-11Sensor Testing on breadboard .......................................................................................... 33


DEPT OF ECE, RGMCET vii
FOOD QUALITY MONITORING SYSTEM

5.3.3 LDR Sensor Testing on breadboard............................................................................................... 33

5.3.4 LCD testing on breadboard ............................................................................................................ 33

5.4 Uploading code to ARDUINO software .................................................................................................. 34

5.5 SENSORS PROGRAMMING ................................................................................................................. 39

5.5.1 GAS SENSOR .................................................................................................................................. 39

5.5.2 DHT 11 Sensor ................................................................................................................................. 39

5.5.3 Light Sensor ...................................................................................................................................... 41

5.5.4 I2C 16*2 LCD ................................................................................................................................... 41

5.6 Testing and Result ..................................................................................................................................... 43

5.6.1 Test Point Testing............................................................................................................................. 43

5.6.2 Power Supply .................................................................................................................................... 44

5.6.3 RESULT............................................................................................................................................ 44

5.7 OBSERVATION ....................................................................................................................................... 45

5.8 Advantages ................................................................................................................................................. 46

5.9 Applications ............................................................................................................................................... 46

CHAPTER 6........................................................................................................................................................ 47

CONCLUSION AND FUTURE SCOPE ......................................................................................................... 47

6.1 CONCLUSION.......................................................................................................................................... 47

6.2 FUTURE SCOPE ...................................................................................................................................... 47

REFERENCES ................................................................................................................................................... 48

DEPT OF ECE, RGMCET viii


FOOD QUALITY MONITORING SYSTEM

List of Figures

FIGURE 2 .1 QUALITY MONITORING SYSTEM BLOCK DIAGRAM…………………………..4

FIGURE 3. 1 ARDUINO TYPE A TO TYPE B USB 2.0 CABLE…………………………………...6


FIGURE 3. 2: ARDUINO TYPE A TO MINI TYPE B USB 2.0 CABLE…………………………....6
FIGURE 3. 3: DOWNLOADING ARDUINO IDE…………………………………………………....7
FIGURE 3. 4: OPENING ZIP FILE OF ARDUINO…………………………………………………..8
FIGURE 3. 5: CREATING A NEW SKETCH IN ARDUINO IDE……………………………………8
FIGURE 3. 6 SELECTING ARDUINO BOARD…………………………………………………….9
FIGURE 3. 7 SELECTING SERIAL PORT………………………………………………………….10
FIGURE 3. 8: TOOL BAR OF ARDUINO IDE FOR EASY ACCESS……………………………..10
FIGURE 3. 9:INSTALLATION STEPS OF BLYNK APP…………………………………………..12

FIGURE 4. 1: ARDUINO UNO………………………………………………………………………15


FIGURE 4. 2: ADAPTER……………………………………………………………………………..18
FIGURE 4. 3:DHT 11 SENSOR………………………………………………………………………20
FIGURE 4. 4: MQ-5 GAS SENSOR MODULE………………………………………………………21
FIGURE 4. 5: TYPICAL LIGHT DEPENDENT RESISTOR………………………………………..22
FIGURE 4. 6:REAL VIEW OF BREAD BOARD……………………………………………………23
FIGURE 4. 7: LCD DISPLAY………………………………………………………………………..24
FIGURE 4. 8:WIFI MODULE……………………………………………………………………......25
FIGURE 4. 9:REAL VIEW OF JUMPER WIRES……………………………………………………27

FIGURE 5. 1: FOOD QUALITY MONITORING SYSTEM…………………………………………28


FIGURE 5. 2: BLYNK APP…………………………………………………………………………..30
FIGURE 5. 3:BLYNK APP CONDITIONS…………………………………………………………..31
FIGURE 5. 4: MQ5 TESTING ON BREADBOARD…………………………………………………32
FIGURE 5. 5: DHT-11SENSOR TESTING ON BREADBOARD…………………………………..33
FIGURE 5. 6: PROGRAMMING THE GAS SENSOR………………………………………………39
FIGURE 5. 7: PROGRAM FOR DHT 11 SENSOR………………………………………………….40
FIGURE 5. 8: PROGRAMMING THE LIGHT SENSOR……………………………………………...41
FIGURE 5. 9: PROGRAMMING THE LCD………………………………………………………..43
FIGURE 5. 10:READINGS ON LCD………………………………………………………………...44
FIGURE 5. 11: READINGS ON BLYNK APP………………………………………………………45

DEPT OF ECE, RGMCET ix


FOOD QUALITY MONITORING SYSTEM

CHAPTER -1
INTRODUCTION AND LITERATURE SURVEY

1.1 INTRODUCTION

Food contamination can occur in the production process, but also a large part caused by the
inefficient food handling because of inappropriate ambient conditions when the food is being transported
and stored. There are many factors leading to food poisoning, typically changes in light intensity,
temperature, alcohol content and humidity are important factors. A monitoring system capable of
measuring temperature and humidity variability during transport and storage isof prime importance.

Today almost everybody is getting affected by the food they consume, it's not only about the
junk food, but all the packed foods, vegetables, products consumed and used in daily life, as all of them
do not offer quality since their temperature, moisture, oxygen content vary from time to time. Majority
of consumers only pay attention to the information provided on the packaging, ie, the amount of
ingredients used and their nutritional value but they forget that they are blindly risking their health by
ignoring the environmental conditions to which these packets are subjected. Everyproduct making firm
just want to attract more and more costumers towards them and their main motive is to sell the product
anyhow like by adding more flavors, coloring chemicals and preservatives to increase the taste and
appearance but they forget that these moneymaking tacticsare actually affecting the consumers’ health.

High temperature and relative humidity favor the development of post-harvest decay organisms.
More acidic tissue is generally attacked by fungi, while fruits and vegetables having pH above 4.5are
more commonly attacked by bacteria. A wide variety of foods can also undergo changes in color, flavor,
and nutrient composition when exposed to light. The extent of these changes dependson many factors
including the composition of the food and the light source. Light exposure could result in color and
vitamin loss. Light also may be responsible for the oxidation of fats. Some typesof yeasts can also lead to
spoilage. True yeast metabolizes sugar producing alcohol and carbon dioxide gas. This process is known
as fermentation. Hence by checking on alcohol quantity contentone can detect the quality of food.
The system I propose is intended for food quality monitoring. In ts project, a smart quality

DEPT OF ECE, RGMCET 1


FOOD QUALITY MONITORING SYSTEM

monitoring device will be designed that will keep watch of environmental factors like temperature,
humidity, alcohol content and exposure to light.

1.2 LITERATURE SURVEY


Food choice is like an all alternative human behavior is complicated and is affected by many
interconnected factors. Understanding those factors associated with nursing is crucial, since it has
created important factor for population dietary modification. Variety of models looking to point out the
potential effects of such influences are planned within the survey. One amongst these models tries to
reason the factors those associated with the food (structural/biological properties, nutrient content), to
the person creating the selection (perception of sensory attributes, psychological factors) or to the
external economic and social setting at intervals that alternative is formed (price, convenience, brand,
social/regional) (Shepherd 2001).

A huge survey was conducted throughout Europe [1] to work out necessary factors in impacting
European shopper food selection. The reporters showed that the first issue was quality/freshness
followed by style, healthy diet, money, family inclination and eventually, habits. [1] Other study
including 171 U.S. and 205 Irish shoppers concluded that brand and freshness were the foremost
highlighted attributes once asked however they determined if a nutrient is of top quality (George, 1993)
amongst the customers asked, thirty-fifth of the U.S. and thirty-eighth of Irish people customers
highlighted freshness. During 1999, freshness was the third most vital reason for choosing a primary
market, simply behind, “high quality food items” and a “hygiene and organized store” (FMI, 1999) many
other surveys were conducted to see the factors effecting food items selection amongst the population[2].

A research done by the AGV (1981) in ninety-nine cities of European country revealed that
freshness was the foremost vital issue once buying fruits and vegetables. Fifty-six pc of the two, 265
customers World Health Organization was interviewed within the streets reportable that their purchases
done by them were addicted to this criterion. During a research by Ragwort et al. (2004) in Kingdom of
Belgium, around two hundred customers stated the significance of various factors effecting the acquisition and
intake of minimally processed food items. Freshness was the foremost vital issue each at the time of buying and
using up, followed by tagged period date and style. Find (1989), United Nations agency shoppers reports of a
U.S. research.

DEPT OF ECE, RGMCET 2


FOOD QUALITY MONITORING SYSTEM

CHAPTER-2

INTRODUCTION TO PROPSED WORK

2.1 PROPOSED WORK

This project proposes a system to analyze the ambient conditions under which the food item is
being stored and transported. The proposed solution senses the temperature, humidity, alcohol content
and light parameters of surrounding environment as these parameters affect nutritional values of food
items. This system makes use of storage units implanted with various electronic sensors which can read
those parameters affecting food materials.

These quality monitoring devices keep a watch on the environmental factor that cause or pace up
decay of the food. Later, the environmental factors can be controlled like by refrigeration, vacuumstorage
etc.

The proposed solution is designed to use an IoT platform used for logging and monitoring of sensor
data. With the power of Internet of Things, the environmental factors affecting the food storage can be
monitored from anywhere, anytime and from any device.
The proposed system should be able to;

a) Read temperature and relative humidity in the food store.


b) Sense the intensity of light in the food store.
c) Detect the emission of ethanol type of gases.
d) Collect data from all the sensors and pass to LCD for display.
e) Monitor the sensor data visually online.

DEPT OF ECE, RGMCET 3


FOOD QUALITY MONITORING SYSTEM

2.2 BLOCK DIAGRAM

Temperature and
Humidity Sensor

Light Sensor Wi-Fi Transceiver

MICROCONTROLLER

AVR328P

Gas Sensor

Display Unit

Power Supply

FIGURE 2 .1 QUALITY MONITORING SYSTEM BLOCK DIAGRAM

DEPT OF ECE, RGMCET 4


FOOD QUALITY MONITORING SYSTEM

CHAPTER-3

IMPLEMENTATION PROCEDURE OF PROPOSED WORK

3.1 ARDUINO IDE

The open-source Arduino Software (IDE) makes it easy to write code and upload it to the board.
It runs on Windows, Mac OS X, and Linux. The environment is written in Java and based on Processing
and other open-source software. This software can be used with any Arduino board.
For the latest software visit https://www.arduino.cc/en/Main/Software.

• Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast prototyping, aimed
at students with or without a background in electronics and programming.
• Arduino is an open-source prototyping platform based on easy-to-use hardware and software.
• You can tell your board what to do by sending a set of instructions to the microcontroller on the
board.
• To do so you use the Arduino programming language (based on Writing), and the Arduino Software
(IDE), based on Processing.
• Cross-platform: The Arduino Software (IDE) runs on Windows, Macintosh OSX, and Linux
operating systems. Most microcontroller system is limited to Windows.
Simple, clear programming environment: The Arduino Software (IDE) is easy-to-use for beginners,
yet flexible enough for advanced users to take advantage of as well.
• Open source and extensible hardware: The plans of the ESP32 board are published under a Creative
Common license, so experienced circuit designers can make their own version of the module,
extending it and improving it.

• Open source and extensible software: The Arduino software is published as opensource tool and the
language can be expanded through C++ libraries

DEPT OF ECE, RGMCET 5


FOOD QUALITY MONITORING SYSTEM

3.2 ARDUINO SOFTWARE INSTALLATION STEPS:


Step 1 − First you must have your Arduino board (you can choose your favorite board) and a USB cable.
In case you use Arduino UNO, Arduino Duemilanove, Nano, Arduino Mega 2560, you will need a
standard USB cable (A plug to B plug), the kind you would connect to a USB printer as shown in the
following image

FIGURE 3. 1 ARDUINO TYPE A TO TYPE B USB 2.0 CABLE

In case you use Arduino Nano, you will need an A to Mini-B cable instead as shown in the following
image

FIGURE 3. 2: Arduino Type A to Mini Type B USB 2.0 cable

DEPT OF ECE, RGMCET 6


FOOD QUALITY MONITORING SYSTEM

Step 2 − Download Arduino IDE Software.


You can get different versions of Arduino IDE from the Download page on the Arduino Official

FIGURE 3. 3: Downloading Arduino IDE.


website. You must select your software, which is compatible with you operating system (Windows,
IOS, or Linux). After your file download is complete, unzip the file

Step 3 − Power up your board.


The Arduino Uno, Mega, Duemilanove and Arduino Nano automatically draw power from either, the
USB connection to the computer or an external power supply. If you are using an Arduino Diecimil.,
you have to make sure that the board is configured to draw power from the USB connection. The power
source is selected with a jumper, a small piece of plastic that fits onto two of the three pins between the
USB and power jacks.
Check that it is on the two pins closest to the USB port.

Connect the Arduino board to your computer using the USB cable. The green power LED (labeled PWR)
should glow.

DEPT OF ECE, RGMCET 7


FOOD QUALITY MONITORING SYSTEM

Step 4 − Launch Arduino IDE.


After your Arduino IDE software is downloaded, you need to unzip the folder. Inside the folder,
you can find the application icon with an infinity label (application.exe). Double-click the icon to start
the IDE.

FIGURE 3. 4: Opening Zip File of Arduino


Step 5 − Open your first project.
Once the software starts, you have two options –
Create a new project.
Open an existing project example.To create a new project, select File → New.

FIGURE 3. 5: Creating a new sketch in Arduino IDE.

DEPT OF ECE, RGMCET 8


FOOD QUALITY MONITORING SYSTEM

Step 6 − Select your Arduino board.

FIGURE 3. 6 Selecting Arduino Board

To avoid any error while uploading your program to the board, you must select Arduino board name,
which matches with board connected to your Computer Here, we have selected the Arduino Uno board
according to our Project, but you must select the name matching the board that you are using.

Step 7 − Select your serial port.

Select the serial device of the Arduino board. Go to Tools → Serial Port menu. This is likely to be
COM3 or higher (COM1 and COM2 are usually reserved for hardware serial ports). To find out, you
can disconnect your Arduino board and re-open the menu, the entry that disappears should be of the
Arduino board. Reconnect the board and select that serial port.

DEPT OF ECE, RGMCET 9


FOOD QUALITY MONITORING SYSTEM

FIGURE 3. 7 Selecting Serial Port

Step 8 – Upload the program to your board.

Before explaining how we can upload our program to the board, we must demonstrate the function of
each symbol appearing in the Arduino IDE toolbar.

FIGURE 3. 8: Tool Bar of Arduino IDE for easy access

A – Used to check if there is any compilation error. B – Used to upload a program to the Arduino board.

DEPT OF ECE, RGMCET 10


FOOD QUALITY MONITORING SYSTEM

C – Shortcut used to create a new sketch.


D – Used to directly open one of the example sketch. E – Used to save your sketch.
F – Serial monitor used to receive serial data from the board and send the serial data to the board.

Now, simply click the “Upload” button in the environment. Wait a few seconds; you will see the RX
and TX LEDs on the board, flashing. If the upload is successful, the message “Done uploading” will
appear in the status bar.

Note – If you have an Arduino Mini, NG, or other board, you need to press the reset button physically
on the board, immediately before clicking the upload button on the Arduino Software.

BLYNK APP:

Blynk was designed for the Internet of Things. It can control hardware remotely, it can display
sensor data, it can store data, visualize it and do many other cool things.
There are three major components in the platform:
Blynk App - allows to you create amazing interfaces for your projects using various widgets system
provide.
Blynk server-responsible for all the communications between the smartphone and hardware. You can
use our Blynk Cloud or run your private Blynk server locally. It’s open-source, could easily handle
thousands of devices and can even be launched on a Raspberry Pi. Server and process all the incoming
and out coming commands.
Now imagine: every time you press a Button in the Blynk app, the message travels to space the Blynk
Cloud, where it magically finds its way to your hardware. It works the same in the opposite direction
and everything happens in a blynk of an eye.
Blynk Libraries - for all the popular hardware platforms - enable communication.

DEPT OF ECE, RGMCET 11


FOOD QUALITY MONITORING SYSTEM

3.3 INSTALLATION STEPS

FIGURE 3. 9:Installation steps of blynk app

Include ESP8266 Core to Arduino IDE


1) Go to 'Preferences' and enter the following URL to Additional Board Manager URLs
http://arduino.esp8266.com/stable/package_esp8266com_index.json
2) Open the Boards Manager (Tools > Board Menu)
3) Search for "esp8266" and install the latest version
4) Select your board under Tools > Board and define Baud Rate etc.

DEPT OF ECE, RGMCET 12


FOOD QUALITY MONITORING SYSTEM

3.4 Install Blynk libraries

1) Install the latest release of the Blynk libraries on GitHub


) Unpack it
3) Move the libraries to C:/User//Documents/Arduino/libraries

Install Blynk App

Download the App for iOS or Android


Before creating your project, you have to create an account or sign in
Click 'Create New Project'
Choose your device and connection type (Arduino uno Wifi)
Receive and note down your 'Auth Token'
Open the 'Widget Box' ('+')
Add a button
Name it and select switch mode
Define the output pin the LED is connected to (anode Dx, cathode)

DEPT OF ECE, RGMCET 13


FOOD QUALITY MONITORING SYSTEM

CHAPTER-4

HARDWARE DESCRIPTION
• Arduino UNO

• Adapter

• DHT11 Sensor

• Gas Sensor

• LDR Sensor

• Breadboard

• Jumper wires

4.1 ARDUINO UNO

4.1.1 INTRODUCTION TO ARDUINO UNO

The Arduino UNO is a standard board of Arduino. Here UNO means 'one' in Italian. It was named as
UNO to label the first release of Arduino Software. It was also the first USB board released by Arduino.
It is considered the powerful board used in various projects.
Arduino.cc developed the Arduino UNO board. The Arduino microcontroller is an easy-to-use yet
powerful single board computer that has gained considerable attraction in the professional market. The
Arduino is open-source, which means the hardware is reasonably priced and the development software
is free.
The Arduino programming language is a simplified version of C/C++. If you know C programming
the Arduino will be familiar. If you do not know C, no need to worry as only a few commands are needed
to perform useful functions.
An important feature of the Arduino you can a control program on the host PC, download it to the
Arduino and it will run automatically. Remove the USB cable connection to the PC, and the program

DEPT OF ECE, RGMCET 14


FOOD QUALITY MONITORING SYSTEM

will still run from the top each time you push the reset button. Remove the battery and put the Arduino
board in a closet for six months. When you reconnect the battery, the last program you stored will run.
This means that you connect the board to the host PC to develop and debug your program, but once that
is done, you no longer need the PC to run the program.

The power of the Arduino is not its ability to crunch code, but rather its ability to interact with the
outside world through its input-output (1/0) pins. The Arduino UNO includes 6 analog pin inputs, 14
digital pins, a USB connector, a power jack, and an ICSP (In-Circuit Serial Programming) header. It is
programmed based on IDE, which stands for Integrated Development Environment. It can run on both
online and offline platforms. The IDE is common to all available boards of Arduino.
Each digital pin can sink or source about 40 mA of current. This is more than adequate for
interfacing to most devices, but does mean that interface circuits are needed to control devices other than
simple LED's. In other words, you cannot run a motor directly using the current available from an
Arduino pin, but rather must have the pin drive an interface circuit that in turn drives the motor. A later
section of this document shows how to interface to a small motor.
To interact with the outside world, the program sets digital pins to a high or low value using C
code instructions, which corresponds to +5 V or 0 V at the pin. The pin is connected. to external interface
electronics and then to the device being switched on and off.
4.1.2 ARDUINO PIN DESCRIPTION

FIGURE 4. 1: Arduino Uno

DEPT OF ECE, RGMCET 15


FOOD QUALITY MONITORING SYSTEM

Every Arduino board needs a way to be connected to a power source. The Arduino UNO can be powered
from a USB cable coming from your computer or a wall power supply (like this) that is terminated in a
barrel jack. In the picture above the USB connection is labeled (1) and the barrel jack is labeled The
USB connection is also how you will load code onto your Arduino board. More on how to program with
Arduino can be found in our Installing and Programming Arduino tutorial.
NOTE: Do NOT use a power supply greater than 20 Volts as you will overpower (and thereby destroy)
your Arduino. The recommended voltage for most Arduino models is between 6 and 12 Volts.Pins (5V,
3.3V, GND, Analog, Digital, PWM, AREF).

The pins on your Arduino are the places where you connect wires to construct a circuit (probably
in conjuction with a breadboard and some wire. They usually have black plastic ‘headers’ that allow you
to just plug a wire right into the board. The Arduino has several different kinds of pins, each of which
is labeled on the board and used for different functions.

• GND (3): Short for ‘Ground’. There are several GND pins on the Arduino, any of which can be used to
ground your circuit.

• 5V (4) & 3.3V (5): As you might guess, the 5V pin supplies 5 volts of power, and the 3.3V pin supplies
3.3 volts of power. Most of the simple components used with the Arduino run happily off of 5 or 3.3
volts.

• Analog (6): The area of pins under the ‘Analog In’ label (A0 through A5 on the UNO) are Analog In
pins. These pins can read the signal from an analog sensor (like a temperature sensor) and convert it
into a digital value that we can read.

• Digital (7): Across from the analog pins are the digital pins (0 through 13 on the UNO). These pins can
be used for both digital input (like telling if a button is pushed) and digital output (like powering an
LED).

• PWM (8): You may have noticed the tilde (~) next to some of the digital pins (3, 5, 6, 9, 10, and 11 on
the UNO). These pins act as normal digital pins, but can also be used for something called

• Pulse-Width Modulation (PWM). We have a tutorial on PWM, but for now, think of these pins as

being able to simulate analog output (like fading an LED in and out).
DEPT OF ECE, RGMCET 16
FOOD QUALITY MONITORING SYSTEM

AREF (9): Stands for Analog Reference. Most of the time you can leave this pin alone. It is sometimes
used to set an external reference voltage (between 0 and 5 Volts) as the upper limit for the analog input
pins.

Reset Button

Just like the original Nintendo, the Arduino has a reset button (10). Pushing it will temporarily connect
the reset pin to ground and restart any code that is loaded on the Arduino. This can be very useful if your
code doesn’t repeat, but you want to test it multiple times. Unlike the original Nintendo however,
blowing on the Arduino doesn’t usually fix any problems.
• Power LED Indicator

Just beneath and to the right of the word “UNO” on your circuit board, there’s a tiny LED next to the
word ‘ON’ (11). This LED should light up whenever you plug your Arduino into a power source. If this
light doesn’t turn on, there’s a good chance something is wrong. Time to re-check your circuit!
• TX RX LEDs

TX is short for transmit; RX is short for receive. These markings appear quite a bit in electronics to
indicate the pins responsible for serial communication. In our case, there are two places on the Arduino
UNO where TX and RX appear – once by digital pins 0 and 1, and a second time next to the TX and RX
indicator LEDs. These LEDs will give us some nice visual indications whenever our Arduino is
receiving or transmitting data (like when we’re loading a new program onto the board).
• Main IC

The black thing with all the metal legs is an IC, or Integrated Circuit. Think of it as the brains of our
Arduino. The main IC on the Arduino is slightly different from board type to board type, but is usually
from the AT mega line of IC ’s from the ATMEL company. This can be important, as you may need to
know the IC type (along with your board type) before loading up a new program from the Arduino
software. This information can usually be found in writing on the top side of the IC. If you want to know
more about the difference between various IC’s, reading the datasheets is often a good idea.4

• Voltage Regulator

The voltage regulator is not actually something you can (or should) interact with on the Arduino.
But it is potentially useful to know that it is there and what it’s for. The voltage regulator does exactly

DEPT OF ECE, RGMCET 17


FOOD QUALITY MONITORING SYSTEM

what it says – it controls the amount of voltage that is let into the Arduino board. Think of it as a kind
of gatekeeper; it will turn away an extra voltage that might harm the circuit. Of course, it has its limits,
so don’t hook up your Arduino to anything greater than 20 volts.

4.2 Power Adapter:

An AC adapter, AC/DC adapter, or AC/DC converter is a type of external power supply, often
enclosed in a case similar to an AC plug. Other common names include plug pack, plug-in adapter,
adapter block, domestic mains adapter, line power adapter, wall wart, power brick, wall charger, and
power adapter. Adapters for battery-powered equipment may be described as chargers or rechargers (see
also battery charger). AC adapters are used with electrical devices that require power but do not contain
internal components to derive the required voltage and power from mains power. The internal circuitry
of an external power supply is very similar to the design that would be used for a built-in or internal
supply.

FIGURE 4. 2: Adapter

4.3 DHT11 SENSOR:

These sensors are very popular for electronics hobbyists because there are very cheap but still providing great

performance. We have two versions of the DHT sensor, look a bit similarand have the same pinout, but have

DEPT OF ECE, RGMCET 18


FOOD QUALITY MONITORING SYSTEM

different characteristics

a) DHT 11 Sensor

b) DHT 22 Sensor

The DHT22 is the more expensive version which obviously has better specifications. Its temperature
measuring range is from -40 to +125 degrees Celsius with +-0.5 degrees’ accuracy,while the DHT11
temperature range is from 0 to 50 degrees Celsius with +-2 degrees’ accuracy.Also, the DHT22 sensor
has better humidity measuring range, from 0 to 100% with 2-5% accuracy, while the DHT11 humidity
range is from 20 to 80% with 5% accuracy.

4.3.1 COMPARISION BETWEEN DHT 11 AND DHT 22

DHT 11 DHT 22
0-50°C ±2°C accuracy Temperature Range -40 to 80°C ±0.5°C
accuracy
20-80% humidity readings Humidity Range 0-100% humidity readings
with 5% accuracy with 2-5% accuracy
No more than 1 Hz Sampling Rate No more than 0.5 Hz
sampling rate (once every sampling rate (once every
second) 2 seconds)
15.5mm x 12mm x 5.5mm Body Size 15.1mm x 25mm x 7.7mm
3 to 5V power and I/O Operating Voltage 3 to 5V power and I/O
2.5mA max current use Maximum Current 2.5mA max current use
during conversion (while during conversion (while
requesting data) requesting data)

DEPT OF ECE, RGMCET 19


FOOD QUALITY MONITORING SYSTEM

FIGURE 4. 3:DHT 11 sensor

4.3.2 DHT11 Working Principle


They consist of a humidity sensing component, a NTC temperature sensor (or thermistor) and an
IC on the back side of the sensor.
For measuring humidity, they use the humidity sensing component which has two electrodes with
moisture holding substrate between them. So as the humidity changes, the conductivity ofthe substrate
changes or the resistance between these electrodes’ changes.
This change in resistance is measured and processed by the IC which makes it ready to be read by
a microcontroller.
On the other hand, for measuring temperature these sensors use a NTC temperature sensor or a
thermistor. A thermistor is actually a variable resistor that changes its resistance with change of the
temperature [2]. These sensors are made by sintering of semi conductive materials such as ceramics or
polymers in order to provide larger changes in the resistance with just small changesin temperature.
The term “NTC” means “Negative Temperature Coefficient”, which means that the resistance
decreases with increase of the temperature.

DEPT OF ECE, RGMCET 20


FOOD QUALITY MONITORING SYSTEM

4.4 GAS SENSOR:


A gas sensor is a device which detects the presence or concentration of gases in the atmosphere.The
appropriate type of gas sensor to be used can be determined by factors such as the kind of gas to be
detected, sensitivity of the gas, stability of the gas and price and durability of the gas sensor. The types
of gas sensors in existence today are electrochemical gas sensors, metal oxidesemiconductor gas sensors,
catalytic gas sensors and infrared gas sensors.
The MQ5 sensor detects the emission of ethanol type of gases. If the food/fruits get spoiled, they
emit the ethanol type of gases. The MQ5 sensor detects the concentration of such gases and output an
analog voltage proportional to the concentration of the gas. The analog output is passedto the analog
pin of the Arduino which has inbuilt ADC that coverts the analog to digital value.

MQ-5 gas sensor is powered with 5 V DC. It can detect gas concentrations ranging from 10 to 10,000
ppm. The sensor output is an analog resistance.

FIGURE 4. 4: MQ-5 gas sensor module

4.5 Light Dependent Resistor (LDR)

A Light Dependent Resistor (LDR) is also called a photo resistor or a cadmium sulfide (CdS) cell.It is
also called a photoconductor. It is basically a photocell that works on the principle of
photoconductivity. The passive component is basically a resistor whose resistance value decreaseswhen the
intensity of light decreases. This optoelectronic device is mostly used in light varying sensor circuit, and
light and dark activated switching circuits. Some of its applications include camera light meters, street

DEPT OF ECE, RGMCET 21


FOOD QUALITY MONITORING SYSTEM

lights, clock radios, light beam alarms, reflective smoke alarms, and outdoor clock

FIGURE 4. 5: Typical Light Dependent Resistor

4.5.1 OPERATION OF LDR:

The snake like track shown below is the Cadmium Sulphide (CdS) film which also passes through
the sides. On the top and bottom are metal films which are connected to the terminal leads. It is designed
in such a way as to provide maximum possible contact area with the two metal films. The structure is
housed in a clear plastic or resin case, to provide free access to external light. As explained above, the
main component for the construction of LDR is cadmium sulphide (CdS), which is used as the
photoconductor and contains no or very few electrons when not illuminated. In the absence of light, it is
designed to have a high resistance in the range of mega ohms. As soonas light falls on the sensor, the
electrons are liberated and the conductivity of the material increases.When the light intensity exceeds a
certain frequency, the photons absorbed by the semiconductorgive band electrons the energy required
to jump into the conduction bands.

4.6 BREAD BOARD:

Breadboard is a white rectangular board with small embedded holes to insert electronic
components. It is commonly used in electronics projects. We can also say that breadboard is a
prototype that acts as a construction base of electronics.

DEPT OF ECE, RGMCET 22


FOOD QUALITY MONITORING SYSTEM

FIGURE 4. 6:Real view of Bread Board


A breadboard is derived from two words bread and board. The word breadboard was initially used to
slice the bread pieces. But it was further named as a breadboard for its use in electronics around the
1970s. Hence, the term breadboard refers to these boards only and provide a quick electrical connection.
A breadboard is also categorized as a Solderless board. It means that the component does not require
any soldering to fit into the board. Thus, we can say that breadboard can be reused. We can easily fit
the components by plugging their end terminal into the board. Hence, a breadboard is often called a
plugboard.

4.7 Liquid Crystal Display (LCD)

LCD is a flat panel display technology that is commonly employed in television sets and computer
monitors. It is also used in screens for mobile devices including tablets, laptops, and smartphones.The
LCD screen has a backlight that provides light to individual pixels arranged in a rectangular grid. Each
pixel contains a red, green, and blue RGB sub-pixel that can be turned on or off. Whenthe entire pixel’s
sub-pixels are turned off, the screen appears black. When all the sub-pixels are turned on, it appears
white. On adjusting individual levels of red, green, and blue light, there are several possible color
combinations.

The backlight in LCD provides an even light source behind the screen. The light is polarized. The
liquid crystals are made up of a part solid and partly liquid substance that can be twisted through applying
electrical voltage to them. They block the polarized light when they are off but reflect it when they are
activated.

Each LCD screen contains a matrix of pixels that display the image on the screen. The matrix can

DEPT OF ECE, RGMCET 23


FOOD QUALITY MONITORING SYSTEM

either be passive or active. The passive matrix screens control individual pixels by sending a chargeto their
row and column. On the other hand, the active-matrix contains thin film transistors (TFTs).The transistors
include capacitors that play a role in helping the pixels to retain charge. Thus, active-matrix LCDs are
more efficient and appear more responsive than passive-matrix displays (Thompson. S, 2018).

FIGURE 4. 7: LCD Display.

4.7.1 Advantages of LCD screen

i. Cost effective
ii. Consumes lesser power compared to Light Emitting Diode screens.
iii. Utilizes little space.
iv. Light weight.
v. Less eyestrain
vi. Improved image quality

DEPT OF ECE, RGMCET 24


FOOD QUALITY MONITORING SYSTEM

4.8 WIFI MODULE.

FIGURE 4. 8:Wi-Fi module


The ESP-01 ESP8266 Serial WIFI Wireless Transceiver Module is a self-contained SOC with
integrated TCP/IP protocol stack that can give any microcontroller access to your Wi-Fi network. The
ESP8266 is capable of either hosting an application or offloading all Wi-Fi networking functions from
another application processor. Each ESP8266 module comes pre-programmed with an AT command set
firmware, meaning, you can simply hook this up to your Arduino device and get about as much Wi-Fi-
ability as a Wi-Fi Shield offers (and that’s just out of the box)! The ESP8266 module is an extremely
cost-effective board with a huge, and ever growing, community. This module has a powerful enough
onboard processing and storage capability that allows it to be integrated with the sensors and other
application specific devices through its GPIOs with minimal development up-front and minimal loading
during runtime. Its high degree of on-chip integration allows for minimal external circuitry, including
the front-end module, is designed to occupy minimal PCB area. The ESP8266 supports APSD for VoIP
applications and Bluetooth co-existing interfaces, it contains a self-calibrated RF allowing it to work
under all operating conditions and requires no external RF parts.
There is an almost limitless fountain of information available for the ESP8266, all of which has
been provided by amazing community support. In the Documents section below you will find many
resources to aid you in using the ESP8266, even instructions on how to transforming this module into
an IoT (Internet of Things) solution! Note: The ESP8266 Module is not capable of 5-3V logic shifting
and will require an external Logic Level Converter. Please do not power it directly from your 5V dev
board.

DEPT OF ECE, RGMCET 25


FOOD QUALITY MONITORING SYSTEM

4.8.1 SPECIFICATIONS AND FEATURES: -

802.11 b/g/n

Wi-Fi Direct (P2P), soft-AP

Integrated TCP/IP protocol stack

Integrated TR switch, balun, LNA, power amplifier and matching network

Integrated PLLs, regulators, DCXO and power management units

+19.5dBm output power in 802.11b mode

Power down leakage current of <10uA

1MB Flash Memory

Dimensions: 25 x 15 x 11 mm (LxWxH)

PCB Thickness: 1mm

Weight: 2 gm

Integrated low power 32-bit CPU could be used as application processor

SDIO 1.1 / 2.0, SPI, UART

STBC, 1×1 MIMO, 2×1 MIMO

A-MPDU & A-MSDU aggregation & 0.4ms guard interval

Wake up and transmit packets in < 2ms

Standby power consumption of < 1.0mW (DTIM3)

DEPT OF ECE, RGMCET 26


FOOD QUALITY MONITORING SYSTEM USING IOT

4.9 Jumpers:

Jumper wires are simply wires that have connector pins at each end, allowing them to be used to connect
two points to each other without soldering. Jumper wires are typically used with breadboards and other
prototyping tools in order to make it easy to change a circuit as needed. Jumper wires are typically come
in three versions:

Male-to-Male.

Male-to-Female

Female-to-Female

FIGURE 4. 9:Real view of Jumper Wires

The difference between each is in the end point of the wire. Male ends have a pin protruding and can
plug into things, while female ends do not and are used to plug things into. Male-to-male jumper wires
are the most common and what you likely will use most often.
When connecting two ports on a breadboard, a male-to-male wire is what you’ll need. Female to female
jumper wires for connecting standard 2.54 Mm header pin and alsorelimate connector of different type
of development board. Pack consists 40 pcs of jumper wire in 10 different colors.

DEPT OF ECE, RGMCET 27


FOOD QUALITY MONITORING SYSTEM USING IOT

CHAPTER 5

PROJECT DESCRIPTION

5.1 CIRCUIT DESCRIPTION DIAGRAM

FIGURE 5. 1: food quality monitoring system

Connections need to be given to sensors on breadboard. Switch ON power supply. The Wi-Fi module
will be turn ON. From the mobile connect the Wi-Fi module through hotspot. Open Blynk app. The Wi-
Fi module connected to Blynk app cloud. In Blynk we need to create labeled value settings for detection
of temperature, humidity, gas, light with the pins desired pins. We need to confirm these settings. A gas
sensor is a device that measures the concentration of gas in the room and converts the concentration
variable to its equivalent voltage. Temperature sensors measure air temperature. while humidity sensors
measure relative humidity. Both sensors are often applied in combination to reduce cost. The light sensor
is used to sense the intensity of light. Type the Arduino sketch. Compile it. After Compiling if any errors
are found we need to rectify it. After that upload the code to Arduino. Before uploading In Arduino board
TX 0&1 need to remove connection. After that upload the code. Next click on serial monitor. In serial
monitor choose 115200 baud rates. Click on ok. It will send the values to cloud. The values will be
displayed on Lcd and Blynk app. The values of each sensor like humidity, temperature, gas and light
intensity will determine whether the quality of good or not

DEPT OF ECE, RGMCET 28


FOOD QUALITY MONITORING SYSTEM USING IOT

5.2 BLYNK APP


This guide will help you understand how to get started using Blynk and give a comprehensive overview
of all the features.

If you want to jump straight into playing with Blynk, check out Getting Started.

GETTING STARTED

How Blynk Works

Blynk was designed for the Internet of Things. It can control hardware remotely, it can display sensor
data, it can store data, visualize it and do many other cool things.

There are three major components in the platform:

Blynk App - allows to you create amazing interfaces for your projects using various widgets system
provide.

Blynk server-responsible for all the communications between the smartphone and hardware. You can use
our Blynk Cloud or run your private Blynk server locally. It’s open-source, could easily handle thousands
of devices and can even be launched on a Raspberry Pi.

Server and process all the incoming and out coming commands.

Now imagine: every time you press a Button in the Blynk app, the message travels to space the Blynk
Cloud, where it magically finds its way to your hardware. It works the same in the opposite direction and
everything happens in a blynk of an eye.

Blynk Libraries - for all the popular hardware platforms - enable communication

DEPT OF ECE, RGMCET 29


FOOD QUALITY MONITORING SYSTEM USING IOT

FIGURE 5. 2: BLYNK APP

5.2.1 FEATURES OF BLYNK APP:


Similar API & UI for all supported hardware & devices

Connection to the cloud using:

1. Wi-Fi

2. Bluetooth and BLE

3. Ethernet

4. USB (Serial)

5. GSM

6. Set of easy-to-use Widgets

7. Direct pin manipulation with no code writing

8. Easy to integrate and add new functionality using virtual pins

9. History data monitoring via History Graph widget

DEPT OF ECE, RGMCET 30


FOOD QUALITY MONITORING SYSTEM USING IOT

10. Device-to-Device communication using Bridge Widget

11. Sending emails, tweets, push notifications, etc.

12. new features are constantly added!

You can find example sketches covering basic Blynk Features. They are included in the library. All the
sketches are designed to be easily combined with each other.

5.2.2 CREATE A BLYNK ACCOUNT


After you download the Blynk App, you’ll need to create a New Blynk account. This account is
separate from the accounts used for the Blynk Forums; in case you already have one.

1.Need to create an account

An account is needed to save your projects and have access to them from multiple devices from
anywhere. It’s also a security measure.

You can always set up your own Private Blynk Server and have full control.

2. Create a New Project After successfully logged into your account, start by creating a new project.

FIGURE 5. 3:blynk app conditions

DEPT OF ECE, RGMCET 31


FOOD QUALITY MONITORING SYSTEM USING IOT

5.3 Construction Process

After designing the circuit diagram of the system, we constructed the system in a systematic manner. The
components used for the construction of the smart IOT food quality monitoring system are ESP32
microcontroller, a DHT-11 Sensor, LDR Light Sensor, MQ5 Gas Sensor, I2C LCD display, resistors,
connectors and a power supply module.
The test circuit was constructed in several stages. The microcontroller was first mountedon an Arduino
board to program it. The gas sensor was then interfaced with the WIFI Module. The LDR sensor and
DHT-11 Sensor were then added and interfaced with the microcontroller.

5.3.1 Gas Sensor Testing on breadboard

Arduino Uno board was used for ease of programming. It was then interfaced with the gas sensor.
The concentration of ethanol gas in the air was determined. The image below shows the gas sensor
connected to the Arduino Uno Board. The +5V terminal of the sensor connects into the 5V terminal of
the Arduino board.
The GND terminal of the sensor connects into the GND terminal of the Arduino. The analog pin of
sensor is connected to pin AO of Arduino. Digital pin is not used hence not connected.

FIGURE 5. 4: MQ5 testing on breadboard

DEPT OF ECE, RGMCET 32


FOOD QUALITY MONITORING SYSTEM USING IOT

5.3.2 DHT-11Sensor Testing on breadboard

DHT-11 Sensor was then added to the system by interfacing it with the Arduino Uno board. The
signal data pin was connected to pin 2 of the Arduino. The power pin was connected to +5V supply of
Arduino and GND pin connected to GND of the Arduino. Temperature and Humidity values were
observed in the serial monitor of the Arduino ide after programming

FIGURE 5. 5: DHT-11Sensor Testing on breadboard

5.3.3 LDR Sensor Testing on breadboard

The LDR Sensor was added to the system for testing as well. The LDR is used to sense the intensity
of light. The sensor is connected to the A1 pin of the Arduino board. The sensor is connected in a potential
divider circuit (10k resistor). The LDR provides an analog voltage which is converted to digital reading
by the in-built ADC. This value wasdisplayed in the serial monitor after programming.

5.3.4 LCD testing on breadboard

An I2C LCD 16x2 display was connected with Arduino Uno. With I2C module we were able toconnect
the LCD with Arduino board with only two cables. The i2c module has a built-in potentiometer which
we used for contrast adjustment.

DEPT OF ECE, RGMCET 33


FOOD QUALITY MONITORING SYSTEM USING IOT

The connections were as follows;

GND to GND
Vcc to 5V
SDA to pin 21
SCL to pin 22

5.4 Uploading code to ARDUINO software

#define BLYNK_PRINT Serial


#include<LiquidCrystal_I2C.h>V
LiquidCrystal_I2C lcd(0x27,16,2);
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <DHT.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "1gQEdBzLWFs9LmLkewhOUAfCtTSZzLKM";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xplore";
char pass[] = "xplore123";
// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial
// or Software Serial on Uno, Nano...
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(2, 3); // RX, TX
// Your ESP8266 baud rate:

DEPT OF ECE, RGMCET 34


FOOD QUALITY MONITORING SYSTEM USING IOT

#define ESP8266_BAUD 115200


ESP8266 wifi(&EspSerial);
#define DHTPIN 2
// What digital pin we're connected to
// Uncomment whatever type you're using!
#define DHTTYPE DHT11 // DHT 11
//#define DHTTYPE DHT22 // DHT 22, AM2302, AM2321
//#define DHTTYPE DHT21 // DHT 21, AM2301
DHT dht(DHTPIN, DHTTYPE);
BlynkTimer timer;
// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void sendSensor()
{
float h = dht.readHumidity();
float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V5, h);
Blynk.virtualWrite(V6, t);
delay(500);

DEPT OF ECE, RGMCET 35


FOOD QUALITY MONITORING SYSTEM USING IOT

int gas = analogRead(A0);


Blynk.virtualWrite(V1,gas);
delay(500);
int soil= analogRead(A1);
int sp=100- map(soil,0,1023,0,100);
Blynk.virtualWrite(V2,sp);
lcd.setCursor(0,0);
lcd.print("Temp: ");
lcd.print(t);
lcd.print("C");
lcd.setCursor(0,1);
lcd.print(" Humidity:");
lcd.print(h);
delay(500);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("gas=");
lcd.print(analogRead(A0));
lcd.setCursor(0,1);
lcd.print("light %=");
lcd.print(sp);
delay(500);
lcd.clear();
}
void setup()
{

DEPT OF ECE, RGMCET 36


FOOD QUALITY MONITORING SYSTEM USING IOT

// Debug console
Serial.begin(9600);
lcd.init();
lcd.backlight();
print(t);
lcd.print("C");
lcd.setCursor(0,1);
lcd.print(" Humidity:");
lcd.print(h);
delay(500);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("gas=");
lcd.print(analogRead(A0));
lcd.setCursor(0,1);
lcd.print("light %=");
lcd.print(sp);
delay(500);
lcd.clear();
}
void setup()
{
// Debug console
Serial.begin(9600);
lcd.init();
lcd.backlight();

DEPT OF ECE, RGMCET 37


FOOD QUALITY MONITORING SYSTEM USING IOT

// Set ESP8266 baud rate


EspSerial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, wifi, ssid, pass, "blynk-cloud.com", 80);
//Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8080);
dht.begin();
// Setup a function to be called every second
timer.setInterval(1000L, sendSensor);
}
void loop()
{
Blynk.run();
timer.run();
}

DEPT OF ECE, RGMCET 38


FOOD QUALITY MONITORING SYSTEM USING IOT

5.5 SENSORS PROGRAMMING

5.5.1 GAS SENSOR

The library containing all MQ5 functions is added to Arduino IDE then the analog data pin is specified
as pin A0. The program is as shown below;

FIGURE 5. 6: Programming the Gas Sensor

5.5.2 DHT 11 Sensor

Before the DHT11 is used on the Arduino, we installed the DHT library. It has all the functions
needed to get the humidity and temperature readings from the sensor. The program was then entered
as follows;

DEPT OF ECE, RGMCET 39


FOOD QUALITY MONITORING SYSTEM USING IOT

FIGURE 5. 7: Program for DHT 11 Sensor

DEPT OF ECE, RGMCET 40


FOOD QUALITY MONITORING SYSTEM USING IOT

5.5.3 Light Sensor

After installation of the right library for the LDR sensor, the program shown below wasused to display
the read analog value through the serial port so we could see what was happening on varying the intensity
of light through the serial monitor.

FIGURE 5. 8: Programming the Light Sensor

5.5.4 I2C 16*2 LCD

First, the required libraries are included. We included both the wire.h and the LiquidCrystal_I2C library.

The specification for the address, dimensions and partitioning of the lcd can be followedfrom the program
code as shown below.

DEPT OF ECE, RGMCET 41


FOOD QUALITY MONITORING SYSTEM USING IOT

DEPT OF ECE, RGMCET 42


FOOD QUALITY MONITORING SYSTEM USING IOT

FIGURE 5. 9: Programming the LCD

5.6 Testing and Result


The system is made up of many stages. Test point testing is done at each stage and the results
tabulated. The expected values are compared to the actual values and remarks made regarding the
deviation between the two.

5.6.1 Test Point Testing

Test points in electronic circuits are areas where the state of the system is monitored from. This is done
by injecting test signals in these areas and observing the results. Testpoint testing or partial testing is
used to check whether the system is working correctly.It can also be used to determine the faulty point
in a system during malfunction. The current output from the gas sensor, the amplified current from the
two transistors and the voltage and current output of ESP32 pins.

DEPT OF ECE, RGMCET 43


FOOD QUALITY MONITORING SYSTEM USING IOT

5.6.2 Power Supply

The current and voltage from the power supply module are measured both for the 5 V output and
the 3.3 V output and the results compared to the specified current and voltageoutput from the module.

5.6.3 RESULT

FIGURE 5. 10:READINGS ON LCD

DEPT OF ECE, RGMCET 44


FOOD QUALITY MONITORING SYSTEM USING IOT

FIGURE 5. 11: READINGS ON BLYNK APP

5.7 OBSERVATION

Fruits Optimal Storage Optimal Approximate


Temperature(F) Humidity(%)
Storage(days)

Apples 30-40 90-95 30-120

Banana(green) 62-70 85-95 7-28

Grapes 31-32 80-90 14-56

Guavas 45-50 90-95 14-21

Mangos 50-55 85-90 14-21

Orange 40-45 90-95 56-84

DEPT OF ECE, RGMCET 45


FOOD QUALITY MONITORING SYSTEM USING IOT

Vegetables Optimal Storage Optimal Approximate


Temperature(F) Humidity (%)
Storage(days)

Cucumbers 50-55 95 10-14

Lemons 52-55 85-90 30-180

Tomatoes 32 90-95 15-20


(green)
Tomatoes 50-70 90-95 8-10

(ripe)

5.8 Advantages

• Focuses on points of the food chain or processes that pose highest risk;

• Minimizes costs to food operators by reducing unnecessary inspection and testing costs;

• Promotes preventive rather than reactive approach to food control; an

• Optimizes the efficiency of food control and use of inspection resources.

5.9 Applications

The food quality monitoring system is applicable in areas such as;

• supermarket warehouses, supermarket shelf lives,

• farm output food stores and warehouses

• food production industries,

• food shipment containers

DEPT OF ECE, RGMCET 46


FOOD QUALITY MONITORING SYSTEM USING IOT

CHAPTER 6

CONCLUSION AND FUTURE SCOPE

6.1 CONCLUSION

Food wastage is one of the crucial crises in the world. One of the main reasons of food wastage is
improper warehouse management and this is a solvable problem to an extent with the current
technological advancement. Over referring to different researches and solutions to this problem, we have
come to a realization that the field of IoT can provide a very efficient solution to this problem. Therefore,
we have discussed a food quality monitoring system based on IoT that will control different
environmental factors such as light intensity, humidity and temperature that are necessary to be
maintained at a threshold value to prevent the food from spoilage. It also and at the same time get alerts
when the food is spoiled.

6.2 FUTURE SCOPE


• Detection of alcohol level in food substance to expand the sensing fields.

• For application in liquid process food streams, inclusion of Nano-Detect process will be used
to develop on-line and off-line monitoring systems (sensors) which combine the expertise
of sensitive molecular biological processes with the potency of nanotechnology.
• Usage of high precision sensors to increase area of sensing.

• Integration of two or more sensors for foods which display dual parameters.

• Based on amount of calorie consumption a pressure sensor is included which helps to maintain
balanced diet.

DEPT OF ECE, RGMCET 47


FOOD QUALITY MONITORING SYSTEM USING IOT

REFERENCES

[1] Y.P. Tsang, K.L. Choy, C.H. Wu G.T.S. Ho & H.Y. Lam, “An IOT based Shelf Life

Management System in Perishable Food E-Commerce Businesses”, IEEE, 19 Jan 2019.


[2] Rohan Wagle, Mayur Shah, Aditya Kadam & Ramgopal Sahu, “A Survey on Monitoring and
Control System for Food Storage using IoT”, International Journal of Innovative Research in
Computer and Communication Engineering, May 2017, Vol. 5, Issue 5.
[3] Professor Rajesh Kumar Kaushal, Harini. T, Pavithra Lency.D, Sandhya.T & Soniya.P, “IOT
based Smart Food Monitoring System”, Technical research organization India, 14 Jun 2019,
Vol. 6 Issue 6.
[4] B. Ravi Chander, P.A. Lovina & G. Shiva Kumari, “Food Quality Monitoring System by using
Arduino”, Journal of engineering sciences, Apr 2020, Vol. 11 Issue 4.
[5] O’Farrell, Elfed Lewis, Colin Flanagan, William B. Lyons & N. Jackman, “Design of a
System that uses Optical Fiber Sensors & Neural Networks to Control a Large-Scale Industrial
Oven by Monitoring the Food Quality Online”, IEEE, 6 Dec 2005, Vol.5 Issue 6.
[6] Robin Raju, Greg E. Bridges & Sharmistha Bhadra, “Wireless Passive Sensors for Food Quality
Monitoring”, IEEE, 1 Aug 2020.
[7] Bin Yu, Ping Zhan, Ming Lei, Fang Zhou & Peng Wang, “Food Quality Monitoring System
based on Smart Contracts and Evaluation Models”, IEEE, 13 Jan 2020, Vol.8

DEPT OF ECE, RGMCET 48


FOOD QUALITY MONITORING SYSTEM USING IOT

KNHH

You might also like