You are on page 1of 22

1

IoT BASED SMART JARS


Report submitted as a part of

ETL 605 Mini Project II


TE - Electronics and Telecommunication Engineering Semester V

by

Name Roll Nos.

Mr. Sonu Sunny 301449

Mr. Lawansh Singh 301458

Ms. Deeksha Tiwari 301461

Ms. Shriya Wadke 301462

Supervisor :

Mrs. Manita Rajput

Department of Electronics and Telecommunication Engineering


Fr. Conceicao Rodrigues Institute of Technology, Vashi

UNIVERSITY OF MUMBAI
2014-2018
2

Declaration

I declare that this written submission represents my ideas in my own words and
where others' ideas or words have been included, I have adequately cited and
referenced the original sources. I also declare that I have adhered to all principles of
academic honesty and integrity and have not misrepresented or fabricated or falsified
any idea/data/fact/source in my submission. I understand that any violation of the
above will be cause for disciplinary action by the Institute and can also evoke penal
action from the sources which have thus not been properly cited or from whom
proper permission has not been taken when needed.

Name & Roll Nos. Sign


Sonu Sunny (301449)

Lawansh Singh (301458)

Deeksha Tiwari (301461)

Shriya Wadke (301462)

Date:

Project Guide
(Date & Sign) :
3

Lawansh Singh, Shriya Wadke, Sonu Sunny, Deeksha Tiwari / Guide: Mrs. Manita Rajput
Title: IOT Based Smart Jars
T.E. Semester VI, Project-II Report
Department of Electronics & Telecommunication Engineering, Fr.C.R.IT, Vashi,
April 2017

ABSTRACT

One of the biggest issue and a constant headache that working women face in
todays day to day life is household chores. Nothing else makes them hit their
head every now and then, when they realize that they are out of their usual
commodities until they dont personally check them. Our project is a basic
remedy for all working mothers so as to solve their constant worrying of things
running out in their kitchen. It basically monitors the day to day life commodities
used in the kitchen and by easy configuration you can set a threshold for each
item and can check its availability anywhere anytime using IoT. The data then
syncs with our website to provide information about the content left in it. Thus,
informing the user if theyre running low on any food item and preventing the
user from last minute cooking emergency. This way the user can also check the
contents of these jars from the grocery store itself and accordingly buy what they
need if any content is less than a particular threshold set by them.
4

CONTENTS
Abstract 3
Contents 4
List of Abbreviations 5
List of Figures 6
Chapters
Chapter 1 INTRODUCTION 7
1.1 Problem overview
1.2 Problem Objective
Chapter 2 BASICS 8
2.1 Data Acquisition
2.2 Uploading the Data
2.3 GUI
Chapter 3 HARDWARE 9
3.1 Ultrasonic Sensors
3.2 Arduino Mega 2560
3.3 ESP8266 WIFI Module
Chapter 4 SOFTWARES 14
4.1 Arduino IDE
4.2 000webhost
4.3 ThingSpeak
4.4 MIT App Inventor 2
Chapter 5 ALGORITHM AND CALCULATIONS 18
5.1 Algorithm
5.2 Calculatons
Chapter 6 SUMMARY AND CONCLUSION 20
Chapter 7 REFERENCES 21
5

List of Abbreviations

Abbreviations Term
Iot Internet of Things
ID Identity Document
ICSP In-Circuit Serial Programming
UART Universal Asynchronous Receiver/Transmitter
TTL Transistor Transistor Logic
LED Light Emitting Diode
USB Universal Serial Bus
EEPROM Electrically Erasable Programmable Read-Only
Memory
SRAM Static Random Access Memory
SPI Serial Peripheral Interface
WIFI Wireless Fidelity
SOC System on Chip
TCP/IP Transmission Control Protocol/Internet Protocol
GPIO General-purpose input/output
IDE Integrated Development Environment
HTTP Hyper Text Transfer Protocol
6

List of Figures

Figure 3.1.1 Working of ultrasonic Sensor(i) 10

Figure 3.1.2 Working of ultrasonic Sensor(ii) 11

Figure 3.2.1 Arduino Mega top view 11

Figure 3.3.1 WIFI Module ESP8266 top view 13

Figure 4.1.1 Arduino IDE 14

Figure 4.2.1 Smart Jars website hosted on 000webhost 15

Figure 4.3.1 Readings from ThingSpeak 16

Figure 3.5.1 Login Page, Screen1 & Analysis as displayed on app 17

Figure 5.1.1 Algorithm 19


7

Chapter 1

INTRODUCTION
1.1 Problem overview

In todays life everything needs automation and so our project Smart Jars helps making
kitchen life easier for people. Now, people dont have to keep remembering if the
cereals in their kitchen are finished or not, they would have Smart Jars to remember
that for them. When people are in the grocery store and they have to buy something but
they dont really remember if they have it or not that is when they can look at their
phones and know. As Smart Jars keeps track of the content one has put in them through
ultrasonic sensors and these readings are sent to Thingspeak.com using esp8266 WIFI
module. These readings can be seen by the users using our website.

1.2 Project Objective

The objective of the Smart Jar is:

For detecting how much content is left in the Jar and storing it in the database.
To provide efficient kitchen life especially in restaurants as it will be more
needed there.
This way one is constantly updated for what one has in the kitchen so as to
know what all they can make out of the ingredients left.

In this project, we use ultrasonic sensors which are fit in the jar to take readings from
them. These readings are then sent to Thinspeak.com which is an open source IoT
application using WIFI module esp8266. These readings are then displayed to our
website which can be accessed by the user by their respective login ID and password.
8

Chapter 2

BASICS

2.1 Data Acquisition

The distance is measured using ultrasonic sensor and the data is sent to Arduino Mega
Board. The Mega analyzes the data and converts the same into percentage
.

2.2 Uploading the data

Arduino uploads the data to the ThingSpeak server. The data is analyzed and converted
to the MATLAB visualizations which is a feature of the above said server. This is
required for GUI since the data is represented in form of a progress bar. Many
visualization options are present in ThingSpeak.

2.3 GUI

The MATLAB visualization feature of ThingSpeak forms the basis of GUI for Smart
Jars project. Such visualizations is created while keeping the consumer in mind. It is
done so that the customer can understand the data easily. The GUI consists of a
website which is hosted using free hosting services available online so that the user can
access the data from anywhere in the world. The website fetches the visualization and
displays the same on the website.
9

Chapter 3

HARDWARE

3.1 Ultrasonic Sensors


We are using ultrasonic sensors for obstacle detection and interface it with Arduino.
The ultrasonic sensor which we are using is HC-SR04 its range is from 2cm-350cm
with 3mm accuracy. The module includes ultrasonic transmitter, receiver and control
circuit. The HC-SR04 range makes it ideally suited for object detection.

Working
Sensors typically operate by generating a high-frequency pulse of sound, and then
receiving and evaluating the properties of the echo pulse.

In reflection mode (also known as echo ranging), an ultrasonic transmitter emits a


short burst of sound i.e. 8 cycles of 40 kHz ultrasonic pulses from the trigger pin in a
particular direction. The pulse bounces off a target and returns to the receiver after a
time interval t. The receiver records the length of this time interval, and calculates the
distance travelled r based on the speed of sound c:

r=c*t
1
0

Figure 3.1.1 Working of Ultrasonic Sensor

The distance between the sensor and the object is calculated by measuring high level
time of the Echo pulse which can be retrieved from ECHO pin of the sensor module
and processing the high level time with the following formula,
Echo pulse (uS) / 58 = Distance in centimeters
Echo pulse (uS) / 148 = Distance in inch
Distance = (high level timevelocity of sound (i.e. 340M/S) / 2).

Figure 3.1.2 Working of Ultrasonic Sensor

3.2 ARDUINO MEGA 2560


The Mega 2560 is a microcontroller board based on the ATmega2560. It has 54 digital
input/output pins (of which 15 can be used as PWM outputs), 16 analog inputs, 4
UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a
power jack, an ICSP header, and a reset button. Arduino is an open-source physical
computing platform based on a simple I/O board and a development environment that
implements the Processing/Wiring language. Arduino can be used to develop stand-
alone interactive objects or can be connected to software. Its specifications are as
follows:
1
1

Figure 3.2.1 Arduino Mega top view

Microcontroller ATmega2560

Operating Voltage 5V

Input Voltage (recommended) 7-12V

Input Voltage (limit) 6-20V

Digital I/O Pins 54 (of which 15 provide PWM output)

Analog Input Pins 16

DC Current per I/O Pin 20 Ma

DC Current for 3.3V Pin 50 mA

Flash Memory 256 KB of which 8 KB used by bootloader

SRAM 8 KB

EEPROM 4 KB
1
2

Clock Speed 16 MHz

LED_BUILTIN 13

Length 101.52 mm

Width 53.3 mm

Weight 37 g

Table 3.2.1 Arduino Mega 2560 Specifications

The ATmega2560 on the Mega 2560 comes pre-programmed with a boot loader that
allows to upload new code to it without the use of an external hardware programmer. It
communicates using the original STK500 protocol.

One can also bypass the boot loader and program the microcontroller through the ICSP
(In-Circuit Serial Programming) header using Arduino ISP.

The ATmega2560 provides four hardware UARTs for TTL (5V) serial
communication. The Arduino Software (IDE) includes a serial monitor which allows
simple textual data to be sent to and from the board. The Receiver and Transmitter
LEDs on the board will flash when data is being transmitted via the
ATmega8U2/ATmega16U2 chip and USB connection to the computer (but not for
serial communication on pins 0 and 1).

A Software Serial library allows for serial communication on any of the Mega 2560's
digital pins.

The Mega 2560 also supports TWI and SPI communication. The Arduino Software
(IDE) includes a Wire library to simplify use of the TWI bus.
1
3

3.3 ESP8266 WIFI MODULE

Figure 3.3.1 WIFI Module ESP8266 top view

The ESP8266 WIFI Module is a self contained SOC with integrated TCP/IP protocol
stack that can give any microcontroller access to a WIFI 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, one can simply hook this up to an
Arduino device and get about as much WiFi-ability.

This module has a powerful on-board 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-existence 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.
1
4

Chapter 4
SOFTWARES

4.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. The Arduino Integrated Development Environment - or
Arduino Software (IDE) contains a text editor for writing code, a message area, a text
console, a toolbar with buttons for common functions and a series of menus. It
connects to the Arduino and Genuino hardware to upload programs and communicate
with them.
1
5

4.2 000webhost
A free website hosting is a free non-paid web hosting service. Free web hosts will
provide a sub domain (yoursite.example.com) or
a directory (www.example.com/~yourname).
In the mini project of this semester we have created a website
http://smartjars.000webhostapp.com/ which is hosted on a 000webhost.com.

Figure 4.2.1 Smart Jars website hosted on 000webhost

4.3 ThingSpeak
ThingSpeak is an open source Internet of Things (IoT) application and API to store
and retrieve data from things using the HTTP protocol over the Internet or via a Local
Area Network. ThingSpeak enables the creation of sensor logging applications,
location tracking applications, and a social network of things with status updates.

ThingSpeak was originally launched by ioBridge in 2010 as a service in support of IoT


applications.
1
6

ThingSpeak has integrated support from the numerical computing


software MATLAB from MathWorks. Allowing ThingSpeak users to analyze and
visualize uploaded data using Matlab without requiring the purchase of a Matlab
license from Mathworks. In fact, all of the ThingSpeak documentation is incorporated
into the Mathworks Matlab documentation site and even enabling registered
Mathworks user accounts as valid login credentials on the ThingSpeak website.

The information in the website http://smartjars.000webhostapp.com/ goes through


https://thingspeak.com/. Thingspeak gets the sensor readings from esp8266 wifi
module, this information then goes to our website. This data transfer uses TCP
protocol.

Figure 4.3.1 Readings from ThingSpeak


1
7

4.4 Smart Jars App

Figure4.4.1 Login Page, Screen1 & Analysis as displayed on app

App Inventor for Android is an open-source web application originally provided


by Google, and now maintained by the Massachusetts Institute of Technology (MIT).

It allows computer programming to create software applications for


the Android operating system (OS). It uses a graphical interface, which allows users
to drag-and-drop visual objects to create an application that can run on Android
devices. App Inventor and the projects on which it is based are informed
by constructionist learning theories, which emphasizes that programming can be a
vehicle for engaging powerful ideas through active learning.

App Inventor is a cloud-based tool, which means one can build apps in the web
browser.
1
8

Chapter 5
ALGORITHM

5.1 Algorithm

START

Take Ultrasonic
Readings

Convert Readings to
Percentage

Upload to
ThingSpeak cloud

Analyze Data

Publish results to Publish results to


Smart Jars app.
website.
Publish results to
app.
1
9

5.2 Calculations

1. For distance calculations,

343
=
2

2. For measuring the content of the jar,

15
= 100
15
2
0

Chapter 6

SUMMARY AND CONCLUSIONS

Hence we can summarize that our project "SMART JARS" acts as a remedy for all
people who are mostly working and cant really manage the perils of taking care of their
kitchen along with their office works. It helps us to monitor the availability of various
items or food commodities that we use everyday. All one has to do is sign into the
website specifically created for this purpose and the data is read from a user friendly
website called ThingsSpeak where the data is read and uploaded through the help of
this server.
Therefore we can gladly summarize that this projects acts as a very useful remedy for
working women and men who stay alone, since this project helps them to be aware
about what exactly they need to buy anytime and anywhere.
2
1

Chapter 7
REFERENCES

1. www.smartjars.com/

2. https://www.youtube.com/watch?v=c6VAEf9N1RY

3. https://play.google.com/store/apps/details?id=com.buzsikdev.pocketiot&hl=en

4. http://smartjars.000webhostapp.com/

5. https://thingspeak.com/
2
2

You might also like