Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

GP Report Y6, Ae, Az

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

GROUP PROJECT REPORT

on
IOT BASED SMART CONTAINER USING NODE-MCU
Submitted in the partial fulfilment of the requirements for
the award of the degree of

BACHELOR OF TECHNOLOGY
In
ELECTRONICS AND COMMUNICATION ENGINEERING

By

CH.MADHAN KUMAR 19311A04Y6


MD.FARDEEN 19311A04AE
P.ROHIT 19311A04AZ

UNDER THE GUIDANCEOF


MR.MANISH KUMAR MRS.B.PRIYANKA
ASSISTANT PROFESSOR,ECE ASSISTANT PROFESSOR,ECE
INTERNAL GUIDE CO-ORDINATOR

DEPARTMENT OF ELECTRONICS AND COMMUNICATIONS


ENGINEERING SREENIDHI INSTITUTE OF SCIENCE AND
TECHNOLOGY(Autonomous)
Yamnampet (V), Ghatkesar (M), Hyderabad – 501 301
SREENIDHI INSTITUTE OF SCIENCE AND TECHNOLOGY
(Affiliated to Jawaharlal Nehru Technological University,
Hyderabad)Yamnampet (V), Ghatkesar (M), Hyderabad – 501 301

Department of Electronics and Communication Engineering

CERTIFICATE

This is to certify that the Group project report entitled “IOT BASED SMARTCONTIAINER USING
NODE-MCU” is being submitted by
CHA.MADHAN KUMAR 19311A04Y6
MD.FARDEEN 19311A04AE
P.ROHIT 19311A04AZ
in partial fulfilment of the requirements for the award of Bachelor of Technology
degree in ELECTRONICS AND COMMUNICATIONS ENGINEERING to
Sreenidhi Institute of Science and Technology affiliated to Jawaharlal NehruTechnological
University, Hyderabad (Telangana). This record is a bonafide work carried out by them under
our guidance and supervision. The results embodied in the report have not been submitted to any
other University Or Institution for the award of any degree or diploma.

NAME OF GUIDE NAME OF COORDINATOR


MR.MANISH KUMAR MRS.B.PRIYANKA
ASSISTANT PROFESSOR,ECE ASSISTANT PROFESSOR,ECE

Head of the Department


Dr. S.P.V. SUBBA RAO
Professor, Department of ECE
DECLARATION

We hereby declare that the work described in this project report titled “ IOT BASEDSMART
CONTAINER USING NODE-MCU” which is being submitted by us in partial fulfilment for
the award of Bachelor of Technology in the Department of Computer Science Engineering,
Sreenidhi Institute Of Science and Technology is the result of investigations carried out by us
under the guidance of T. Sandeep , Assistant professor, Department of ECE, Sreenidhi Institute
of Science and Technology, Hyderabad.

Place: Hyderabad
Date:22-07-2022
ACKNOWLEDGEMENTS

Acknowledgements are always inadequate in a working of this kind and we wish to


express our heart full gratitude to all those who have made it possible for us to do this
project and submit this report.

We would like to extend our sincere thanks to B.PRIYANKA, Assistant professor our
project guide, in electronics and communication engineering Department, for guiding us in
carrying out project. We are great full to here for the valuable support and encouragement
given to us at all the stages of the project and ensuring that we work in systematic way. We
consider ourselves extremely fortunate to havethe opportunity of associating with him.

It is our privilege to thank DR. S.P.V.SUBBA RAO, Hod, Department of ECE


Department, for his encouragement during the progress of this project work.

We would like to express our deepest gratitude to director Prof. C V. TOMY and
DR.T.CH.SHIVA REDDY, principal of Sreenidhi Institute of Technology Management, for helping
usto develop self-perspective and work towards well defined goals.
We would like to thank our friends for being supportive all the time, and we are verymuch obliged
to them.
CONTENTS
S.NO. NAME PAGE.NO.
1. ABSTRACT 1
2. INTRODUCTION 2

3. ROLE OF IoT 3-7


i. What is IFTTT?
ii. How does IFTTT work?
iii. Creating your own applet?
iv. What is webhooks service?
4. COMPONENTS REQUIRED 8-11
A.NODE-MCU ESP 8266 8-9
1) How to start with NodeMCU?

2) How to write codes for NodeMCU?

3) NodeMCU with Arduino IDE

4) The difference in using ESPlorer and Arduino IDE

B.ULTRA SONIC SENSOR HCO5 10-11


1) working
2) applications
3) limitations
5. CIRCUIT DESIGN 12
6. WORKING PRINCIPLE 12-14
7. CODE 15

8. RESULT 17

9. DISADVANTAGES 18

10. APPLICATIONS 18

11. ADVANTAGES 18

12. FUTURE SCOPE 18

13. REFERENCES 19
1.ABSTRACT:
This paper is about building a smart container using NodeMCU and ultrasonic sensor to
track the contents in the container dynamically from anywhere in the world with the help of
internet.This smart container allows us to keep track of the stocks, and it is easily accessible
from using the internet. The Container includes an ultrasonic sensor at the top of it and uses
the ultrasonic reflected waves to figure out at what extent the Container is filled and how
much space is left inside the container. Whenever the amount of content changes in the jar, it
is sensed by the NodeMCU, and the same is updated on the web server. This can be helpful
to track supplies and plan for restocking from anywhere in the world.The container is smart
enough to send the level of container filled through email and warns when the conatiner is
empty or less than the threshold value set as per the requirement.It would be helpful for the
user to track the details of contents in the container with out their actual presence.
The smart jar enables us to keep track of the medicines stocks with the help of an android
app easily accessible anywhere with a simple internet connection. The jar contains an ultra-
sonic sound waves emitter and sensor which uses the reflected ultra-sonic waves to find out
what level the jar is filled to and how much empty space remains in jar yet to be filled. This
sensor is also connected to the internet and interfaced with the application so that as soon as
the level of content in the jar changes the data is updated to us in the application without any
delay. This helps us in monitoring the stocks and prepare for restocking from
anywhere,additionally it also provides important data such as the expiry date and the
manufactured data of the content in the jar. .
Keywords: NodeMCU ESP8266 Wifi Module,HC-05 Ultrasonic Sensor,Smartcontainer,
Arduino IDE,Iot architecture

2
2.INTRODUCTION:

Now a days, In our day to day life,people became more busy such that they
are much more immersed in their work schedule and are unable to concentrate or take care
of their household things.Most of the time people find it difficult to track their kitchen
items,because nowadays it has become a room of least visit. In a scenario,where people find
hard time to prepare their own food,it is even more difficult for them to track their grocery
items in their room.they even waste most of their time in ordering and tracking the
remaining items in kitchen room. In this project,I made an Iot based Smart jar using
NodeMCU ESP8266 Module and ultrasonic sensor that tracks the exact percentage of the
contents in the container.This helps the user to know the quantity of content in the jar and
can access the information through the Internet from anywhere in the world.It takes the
speed of the emitted waves and time taken to travel as the parameters and gives the actual
content of the container.

NodeMCU and ultrasonic sensor to track the contents in the jar dynamically from anywhere
in the world with the help of internet. This smart Jar allows us to keep track of the stocks,
and it is easily accessible from using the internet. The Jar includes an ultrasonic sensor at the
top of it and uses the ultra- sonic reflected waves to figure out at what extent the Jar is filled
and how much space is left inside the jar. Whenever the amount of content changes in the
jar, it is sensed by the NodeMCU, and the same is updated on the webserver. This can be
helpful to track supplies and plan for restocking from anywhere in the world. The jar is
smart enough to send the level of jar filled through email and warns when the jar is empty or
less than the threshold value set as per the requirement .It would be helpful for the user to
track the details of contents in the jar without their actual presence.

2
3.ROLE OF IoT:

when compared to other technologies ,is one of its kind,which has the maximum
capability.Other advantages include less human effort in the work field,reduction of
cost,enhancement in data collection and analysis.Iot is also capable in using the resources
effectively. The embedded system can be of type microcontroller or type microprocessor.
Both of these types contain an integrated circuit (IC). The essential component of the
embedded system is a RISC family microcontroller like Motorola 68HC11, PIC 16F84,
Atmel 8051 and many more. The most important factor that differentiates these
microcontrollers with the microprocessor like 8085 is their internal read and writable
memory. The essential embedded device components and system architecture are specified
below. The IoT ecosystem is not easy to define. It is also difficult to capture its proper image
due to the vastness and emerging possibility and the rapidity with which it is expanding in
the entire sector. However, the IoT ecosystem is a connection of various kind of devices that
sense and analyze the data and communicates with each other over the networks. In the IoT
ecosystem, the user uses smart Electronic copy available at:
https://ssrn.com/abstract=3915539 devices such as smartphones, tablet, sensors, etc. to send
the command or request to devices for information over the networks. The device response
and performs the command to send information back to the user through networks after
analyzed. The typical IoT ecosystem is shown in below image, where the smarter devices
send and receive data from the devices themselves in the environment that are integrate over
network and Cloud Computing.

1.what is IFTTT?

IFTTT allows you to do more with over 700 different apps and services,
including Twitter, Dropbox, Evernote, Fitbit, Amazon Alexa,
and Google Assistant.
 On IFTTT, we call these services. A list of all services on IFTTT can be found here

We bring services together into Applets, automations that allow you to do things your apps and

7
devices can't do on their own. 3

 For example, you could use IFTTT to sync Amazon Alexa to-dos with your Google
Calendar or create events in your iPhone Calendar via Google Assistant

IFTTT is short for 'If This Then That', and is pronounced like 'Gift' without the 'G'.

We used to be called 'if this, then that' because Applets would have one trigger and one action. If this
happens — then that happens.

 For example, when you come home, then turn on your Hue lights

Now we just go by IFTTT, because there's so much more you can do:

 Applets can have multiple actions (If this, then that, that, and that)
 Applets can run when you tell them to, at the touch of a Button (That!)
 And some Applets even have filters that mean they only run when a specific condition is met (If
this and this, then that)

You can turn on Applets that already exist, or you can make something custom for yourself.

2.How does IFTTT work?

IFTTT helps connect different apps and devices. When you sign up for a free account, you can enable
your apps and devices to work together to do things they couldn't otherwise do. For example, you
can back up your Instagram photos to Dropbox, have your lights turn on when you enter your home,
or automatically remind a Slack channel about a meeting.

Here's how it works:

1. Create a free account.


2. Browse the IFTTT website or app to find something that interests you.
3. Connect the services that are involved in the Applet or connection.
4. Find more Applets and connections, and repeat!

Applets and connections can be built by services or users from the Developer Dashboard. You also
have the power to create something custom for yourself! Go to ifttt.com/create to combine two
services and make your own Applet!

3.Creating your own Applet


How to find an Applet
There's millions of Applets, or automations, on IFTTT. Perhaps there's already one that does what you
need! Check out this list of 700+ services on IFTTT or search 🔎 for an existing Applet.

7
How to create an Applet
Haven't found the right one? Try building your own Applet via ifttt.com/create where you can
customize an automation for your specific requirements.
4

 IFTTT Pro users can create faster and powerful Applets with multiple actions. To add additional
actions, simply click the + button after adding your first action.
 IFTTT Pro+ and Legacy IFTTT Pro users can create even more powerful Applets with queries, filter
code, and multiple actions. IFTTT Pro+ users can now use multiple accounts to connect and integrate
them to the multiple criteria, multiple action Applets.

Here's a demo:

How to publish and share an Applet you created

Publishing your created Applets allows you to easily share them


with your friends, family, followers, and more. It also makes
them available for anyone else to discover and use. Go to
your Personal Applets or check out our publishing guide to get
started.

Why do some services not appear as a "this" or a "that"?


Many services only have triggers (this) while some only have
actions (that). For example, Google Assistant only supports
triggers, so you won't see it as an action.

Why can't I make an Applet with a certain trigger/action combination?


We aim for full interoperability between services but not all actions and triggers can be designed to
work together. There may be technical limitations based on the service, or the combination is
something the service does not allow IFTTT to do.

For example, Twitter restricts the ways new tweets can be posted using IFTTT, and does not allow
Applets to be created using the New tweet from a specific user trigger and the Post a tweet action.

💡Note: Due to the countless varieties of Applet combinations on IFTTT, we can't assist with making
an individual Applet directly. Check out our help section on best practices or post a request in
the communities of IFTTT experts on Reddit and Hackster.io. We encourage users to lean on those
communities for help if you can't find a specific Applet configuration you're seeking, or if you need
one custom built.

Webhooks service FAQ

4.What is the Webhooks service?


The Webhooks service allows you to integrate other services on IFTTT with your DIY projects via
simple web requests.

7
The Webhooks service uses realtime triggers, so Webhooks Applets normally run within a few
seconds.

Where do I find my Webhooks key?

Head to the Webhooks service page and click Documentation.


5

How do I pass values to Webhooks?


You can pass up to 3 values to the Webhooks - Receive a web request trigger with either a JSON body:

{ "value1" : "", "value2" : "", "value3" : "" }

or x-www-form-urlencoded data:

https://maker.ifttt.com/trigger/{event}/with/key/{webhooks_key}?value1=value1&value2=value2&v
alue3=value3

The Webhooks - Receive a web request with a JSON payload trigger accepts JSON, and requests
should include the header Content-Type: application/json:

curl -X POST -H "Content-Type: application/json" -d '{"this":[{"is":{"some":["test","data"]}}]}'


http://maker.ifttt.com/trigger/{event}/json/with/key/{webhooks_key}

How do I add custom headers to my Webhooks action?


The Webhooks - Make a web request action has an optional field for custom headers. Any custom
header is acceptable, except Content-Type, which is set in the Content Type field.

An example of how the custom headers field might look:

From: biffmcifttt@example.com
Some-Header: someCustomValue; someOtherValue
Warning: Over 9000

The Mozilla Developer Network has a list of standard HTTP headers, but any key/value pairs will
work in the Additional Headers field.

Can I use IPv6 addresses in the URL field?


You sure can! IPv6 addresses should conform to certain standards:

 Like any other URL, they must start with a protocol (http://or https://)
 The IPv6 address itself must be [surrounded by brackets].
 Like any other URL, they can include a port (:1234) and a pathname (/my/awesome/path).

Examples of valid IPv6 URLs:

http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html

7
https://[1080:0:0:0:8:800:200C:417A]/index.html
http://[3ffe:2a00:100:7031::1]

Can I publish an Applet with Webhooks?


No, Webhooks is for personal use only.

What if I want to build a service on IFTTT?


If you're interested in building a service on IFTTT, head to the Developer Dashboard and become a
partner.6

Is there a fixed range of IP addresses for Webhooks?


No, IFTTT does not set a fixed IP or range of IPs for Webhooks or any other services.

How do I get support for Webhooks?


If you are struggling to trigger your Webhooks Applets, the first troubleshooting step we always
recommend is simply regenerating your Webhooks key. To do so, head
to https://ifttt.com/maker_webhooks/settings and click Regenerate key. If applicable, update your
Webhooks actions with the new key, then perform a few tests.

If you're still having trouble, we recommend that you join the IFTTT communities
on Reddit and Hackster.io. They are large and engaged communities where users can connect with
each other to get help with their projects and troubleshoot issues together.

For outbound webhooks, you can also check out our Troubleshooting outbound webhooks help article.















4

7
.COMPONENTS REQUIRED :

A. NODE MCU ESP8266 :

The NodeMCU ESP8266 development board consists of microprocessor that supports


RTOS and operates between 80 MHz and 160MHz
range clock frequency.It has 128 KB RAM to store
the programmable data memory.It has inbuilt deep
sleep operating feature hence makes it convenient to
use for wide range Iot projects.It can be powered
using MicroUSB pin or External powersupply pin.
The NodeMCU is programmed using Arduino IDE.
NodeMCU finds various applications in Iot
projects,projects that require low power
consumption and where there is a requirement of multiple input and output pins.
As Arduino.cc began developing new MCU boards based on non-AVR processors like the
ARM/SAM MCU and used in the Arduino Due, they needed to modify the Arduino IDE so
that it would be relatively easy to change the IDE to support alternate toolchains to allow
Arduino C/C++ to be compiled for these new processors. They did this with the introduction
of the Board Manager and the SAM Core. A "core" is the collection of software components
required by the Board Manager and the Arduino IDE to compile an Arduino C/C++ source
file for the target MCU's machine language. Some ESP8266 enthusiasts developed an
Arduino core for the ESP8266 WiFi SoC, popularly called the "ESP8266 Core for the
Arduino IDE".[18] This has become a leading software development platform for the
various ESP8266-based modules and development boards, including NodeMCUs.

1.How to start with NodeMCU?


NodeMCU Development board is featured with wifi capability, analog pin, digital pins, and serial
communication protocols.

To get started with using NodeMCU for IoT applications first we need to know about how to
write/download NodeMCU firmware in NodeMCU Development Boards. And before that where this
NodeMCU firmware will get as per our requirement.

There are online NodeMCU custom builds available using which we can easily get our custom
NodeMCU firmware as per our requirement.

To know more about how to build custom NodeMCU firmware online and download it refer to Getting
started with NodeMCU

2.How to write codes for NodeMCU?

After setting up ESP8266 with Node-MCU firmware, let’s see the IDE (Integrated Development
Environment) required for the development of NodeMCU.

7
NodeMCU with ESPlorer IDE

Lua scripts are generally used to code the NodeMCU. Lua is an open-source, lightweight, embeddable
scripting language built on top of C programming language.

For more information about how to write Lua script for NodeMCU refer to Getting started with
NodeMCU using ESPlorerIDE

3.NodeMCU with Arduino IDE

Here is another way of developing NodeMCU with a well-known IDE i.e. Arduino IDE. We can also
develop applications on NodeMCU using the Arduino development environment. This makes it easy
for Arduino developers than learning a new language and IDE for NodeMCU.

For more information about how to write Arduino sketch for NodeMCU refer to Getting started with
NodeMCU using ArduinoIDE

4.The difference in using ESPlorer and Arduino IDE

Well, there is a programming language difference we can say while developing an application for
NodeMCU using ESPlorer IDE and Arduino IDE.

We need to code in C\C++ programming language if we are using Arduino IDE for developing
NodeMCU applications and Lua language if we are using ESPlorer IDE.

Basically, NodeMCU is Lua Interpreter, so it can understand Lua script easily. When we write Lua
scripts for NodeMCU and send/upload it to NodeMCU, then they will get executes sequentially. It will
not build a binary firmware file of code for NodeMCU to write. It will send Lua script as it is to
NodeMCU to get executed.

In Arduino IDE when we write and compile code, the ESP8266 toolchain in the background creates a
binary firmware file of code we wrote. And when we upload it to NodeMCU then it will flash all
NodeMCU firmware with newly generated binary firmware code. In fact, it writes the complete
firmware.

That’s the reason why NodeMCU not accept further Lua scripts/code after it is getting flashed by
Arduino IDE. After getting flashed by Arduino sketch/code it will be no more Lua interpreter and we
got an error if we try to upload Lua scripts. To again start with Lua script, we need to flash it with
NodeMCU firmware. Since Arduino IDE compiles and upload/writes complete firmware, it takes
more time than ESPlorer IDE.

B. ULTRASONIC SENSOR HC05:

7
An ultrasonic sensor is a device that transmits and receives ultrasonic waves and converts
them into electrical signals.It is mainly used to tell how far away is the object.The ultrasonic
waves travel faster than the sound waves. The ultrasonic sensor has basically two parts: one
is transitter and the other is receiver. The transmitter emits the ultrasonic waves towards the
targeted object.The waves hit the target object and return towards the sensor within a specific
time.The receiver of the ultrasonic sensor receives these reflected waves.The sensor
calculates the time taken between the transimission and receiving of the signal waves. The
distance is calculated by the formula distance=time*(speed of the wave).
The working principle, applications and limitations of ultrasonic sensors

The ultrasonic sensor (or transducer) works on the same principles as a radar system. An ultrasonic
sensor can convert electrical energy into acoustic waves and vice versa. The acoustic wave signal is an
ultrasonic wave traveling at a frequency above 18kHz. The famous HC SR04 ultrasonic sensor
generates ultrasonic waves at 40kHz frequency.

Typically, a microcontroller is used for communication with an ultrasonic sensor. To begin measuring
the distance, the microcontroller sends a trigger signal to the ultrasonic sensor. The duty cycle of this
trigger signal is 10µS for the HC-SR04 ultrasonic sensor. When triggered, the ultrasonic sensor
generates eight acoustic (ultrasonic) wave bursts and initiates a time counter. As soon as the reflected
(echo) signal is received, the timer stops. The output of the ultrasonic sensor is a high pulse with the
same duration as the time difference between transmitted ultrasonic bursts and the received echo
signal.

Theoretically, the distance can be calculated using the TRD


(time/rate/distance) measurement formula. Since the calculated
distance is the distance traveled from the ultrasonic transducer to
the object—and back to the transducer—it is a two-way trip. By
dividing this distance by 2, you can determine the actual distance
from the transducer to the object. Ultrasonic waves travel at the
speed of sound (343 m/s at 20°C). The distance between the
object and the sensor is half of the distance traveled by the sound
wave.[iv] The following equation calculates the distance to an
object placed in front of an ultrasonic sensor:

7
The microcontroller interprets the time signal into distance using the following functions:

Limitations of ultrasonic sensors

Ultrasonic sensors such as the HC-SR04 can efficiently measure distances up to 400 cm with a slight
tolerance of 3 mm. [xiii] However, if a target object is positioned such that the ultrasonic signal is
deflected away rather than reflected back to the ultrasonic sensor, the calculated distance can be
incorrect. In some cases, the target object is so small that the reflected ultrasonic signal is insufficient
for detection, and the distance cannot be measured correctly.

Furthermore, objects like fabric and carpet can absorb acoustic signals. If the signal is absorbed in the
target object’s end, it cannot reflect back to the sensor, and hence, the distance cannot be measured.

7
5.CIRCUIT DESIGN :
The following are the electronic components were used to design and develop the Iot based
smart Jar.

● NodeMCU ESP8266 Wifi Module- 1 No.

● Ultrasonic Sensor HC05- 1 No.

● Jar - 1 No.

● Breadboard-1 No.

● Jumper Wires -4 No.

● Arduino IDE

Figure 4: circuit for iot based smart container

7
6.WORKING PRINCIPLE:
The circuit connections are shown in the above circuit diagram,The D5 pin of the NodeMCU is
connected to the Triger pin of the ultrasonic sensor and the D6 pin isconnected to the Echo pin of the
sensor. The Vin pin of the NodeMCU is connected to the Vcc pin of the ultrasonic sensor whereas the
ground pin oif the sensor is connected to the ground pin of the NodeMCU. The NodeMCU is powered
by the 5V power supply. When the jar is set up and the set up is connected to a power supply,the
ultrasonic sensor emits the waves and hits the level upto which the jar is filled.After that ,it reflects
back and travels in opposite direction towards the sensors and the sensor receives these waves through
the receiver. This is considered as the input to the system and this input is send to theNodeMcu through
the echo pin. A pre-programmed code is already installed in the NodeMCU and as soon as ot receives
input from the echo pin it calculates the distance travelled with speed and time formula and
simultaneously compares this with the total length of the jar and gives the percentage of jar is
empty.This in turn conveys How much percent the jar is filled and this Ouput is displayed in the
system.

7
7.CODE:

#include <ESP8266WiFi.h>
const int trigPin = D5;
const int echoPin = D6;
long duration;
int distance;
float level;
const char* ssid = "vivo 1920";
const char* password = "1234567890";
void send_event(const char *event);
const char *host = "maker.ifttt.com";
const char *privateKey = "jLjfDTBqvEhArpA6BFSuiTRk6W65m842RLu57Lh0Lcq";
WiFiServer server(80);
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin(9600);
Serial.print("Connecting to Wifi Network");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("Successfully connected to WiFi.");
Serial.println("IP address is : ");
Serial.println(WiFi.localIP());
server.begin();
Serial.println("Server started");
}
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = duration * 0.0340 / 2;
Serial.println("Distance");
Serial.println(distance);
level =((18-distance)/18.0)*100;
Serial.println("level");
Serial.println(level);
delay(1000);
WiFiClient client = server.available();
if (client)
{
Serial.println("Web Client connected ");
String request = client.readStringUntil('\r');
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connection: close"); // the connection will be closed after completion of the response
client.println("Refresh: 10"); // update the page after 10 sec
client.println();
client.println("<!DOCTYPE HTML>");
client.println("<html>");
client.println("<style>html { font-family: Cairo; display: block; margin: 0px auto; text-align:
center;color: #333333; background-color: ##f3ffee;}");
client.println("body{margin-top: 50px;}");
client.println("h1 {margin: 50px auto 30px; font-size: 50px; text-align: center;}");
client.println(".side_adjust{display: inline-block;vertical-align: middle;position: relative;}");
client.println(".text1{font-weight: 180; padding-left: 5px; font-size: 50px; width: 170px; text-align:
left; color: #3498db;}");
client.println(".data1{font-weight: 180; padding-left: 1px; font-size: 50px;color: #3498db;}");
client.println(".data{padding: 1px;}");
client.println("</style>");
client.println("</head>");
client.println("<body>");
client.println("<div id=\"webpage\">");
client.println("<h1>IoT Based Container</h1>");
client.println("<div class=\"data\">");
client.println("<div class=\"side_adjust text1\">Status:</div>");
client.println("<div class=\"side_adjust data1\">");
client.print(level);
client.println("<div class=\"side_adjust text1\">% filled</div>");
client.println("</div>");
client.println("</div>");
client.println("</body>");
client.println("</html>");
//client.println("<h1>Level Indicator</h1>");
if ( level <= 10) {
send_event("container_event");
}
}
}
void send_event(const char *event)
{
Serial.print("Connecting to ");
Serial.println(host);
// Use WiFiClient class to create TCP connections
WiFiClient client;
const int httpPort = 80;
if (!client.connect(host, httpPort)) {
Serial.println("Connection failed");
return;
}
// We now create a URI for the request
String url = "/trigger/";
url += event;
url += "/with/key/";
url += privateKey;
Serial.print("Requesting URL: ");
Serial.println(url);
// This will send the request to the server
client.print(String("GET ") + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"Connection: close\r\n\r\n");
while(client.connected())
{
if(client.available())
{
String line = client.readStringUntil('\r');
Serial.print(line);
} else {
// No data yet, wait a bit
delay(50);
};
}
Serial.println();
Serial.println("closing connection");
client.stop();
}

8.RESULT:
9.APPLICATION AREA :
required for their cooking and how much quantity of groceries they need to buy.

10.DISADVANTAGES:

Needs frequent internet connection. Contents should be placed in safe


environment so that the setup doesn’t get damaged easily. .. VIII. CONCLUSION The Iot
based Smart Jar helps to track the availability of stock from anywhere in the world and
saves a lot of manual labour and also time.The quantity of the jar cautions the user and
hence the user can automatically know the data without actually being there.Especially,in
medical industry,where people deal with quantity of medicine,it is more useful.It
ultimately saves time and effort of the consumer in this mordernised world.

11.ADVANTAGES:
The smart jar can be used to track the exact contents of the jar from anywhere.It is mostly
useful for those people who find it difficult to know the amount of content

12.FUTURE SCOPE:
The jar can be developed for multi-purpose usage such as measuring the liquidquantity of
some chemical solutions in a container.It can be made completely wireless with the
availability of latest technology then.Synchronizing of one omore jars of similar kind
would help the user optimally access various range of stocks and buy according to
availability

This technology can also be used to track the quantity of medicine for patients who suffer
from diseases like diabetes and who need to have regular medicine update.This jar saves
them falling short of medicine and helps them keep their medicines in the jar updated. For
merchants who own general store and who are away from their shop,this technology helps
them to instantly order the amount of stock required for them to order by modifying the jar
formula for bigger containers.The percentage of container filled would make their work
easier. VI.

13.REFERENCES:

[1]T. K. Gannavaram V, R. Bejgam, S. B. Keshipeddi, S. Sunkari and V. K. Aluvala,


"Conversion of Sound Energy into Electrical Energy in Highly Populated Areas," 2021 6th
International Conference on Communication and Electronics Systems (ICCES), 2021, pp.
32-36, doi: 10.1109/ICCES51350.2021.9489219.

[2]T. K. Gannavaram V and R. Bejgam, "Brief Study and Review on the Next Revolutionary
Autonomous Vehicle Technology," 2021 International Conference on Advance Computing
and Innovative Technologies in Engineering (ICACITE), 2021, pp. 34-37, doi:
10.1109/ICACITE51222.2021.9404763.

[3]T. K. Gannavaram V, R. Bejgam, S. B. Keshipeddi, A. Banda and G. Bollu, "Study of


Automobile Safety Technology Development using Vehicular Safety Device (VSD)," 2021
6th International Conference on Inventive Computation Technologies (ICICT), 2021, pp.
240-244, doi: 10.1109/ICICT50816.2021.9358670.

[4]T. K. Gannavaram V, U. Maheshwar Kandhikonda, R. Bejgam, S. B. Keshipeddi and S.


Sunkari, "A Brief Review on Internet of Things (IoT)," 2021 International Conference on
Computer Communication and Informatics (ICCCI), 2021, pp. 1-6, doi:
10.1109/ICCCI50826.2021.9457009.

[5]T. K. Gannavaram V, U. M. Kandhikonda, R. Bejgam, S. B. Keshipeddi and S. Sunkari,


"A Brief Review on Internet of Things (IoT)," 2021 InternationalConference on Computer
Communication and Informatics (ICCCI), 2021, pp. 1-6, doi:
10.1109/ICCCI50826.2021.9451163.

[6] Tummanapally, Shraddha Shree and Sunkari, Saideep, Smart Vehicle Tracking
System using GPS and GSM Technologies (July 12, 2021). Available at SSRN:
https://ssrn.com/abstract=3884903 or http://dx.doi.org/10.2139/ssrn.3884903

[7] Tummanapally, Shraddha Shree and Sunkari, Saideep, Traffic Data Collection and
Analysis based on Wireless Sensor Network (July 12, 2021). Available at SSRN:
https://ssrn.com/abstract=3885102 or http://dx.doi.org/10.2139/ssrn.3885102

[8] Gannavaram V, Tulasi Krishna & Singh, Akhilesh & Gannavaram, Venkat
Praveen & Gannavaram, Venkat Chinmai Sai & Ohene-Akoto, Justice & Keshipeddi, Sai
& Chandel, Garima & Sangem, Raviteja & Koul, Sumit & A., Sabarivani & Deo, Rajesh
& A., Ambikapathy. (2021). IoT and Machine Learning- based Headlight Intensity
Changing device for Electrical Vehicles.

[9] Gannavaram V, Tulasi Krishna & Gannavaram, Venkat Praveen & Gannavaram,
Venkat Chinmai Sai & Reddy, G. & Prabhakar, Girija & Kama, Ramudu & Budda,
Jagadish & Rao, Vadithala & Vuppu, Shankar & Laxman, Srinivas & Bushan, Phridviraj &
Pratapagiri, Sreenivas & Kolluri, Johnson. (2021). SOLAR PARK MONITORING AND
FAULT DETECTION SYSTEM USING IOT AND MACHINE LEARNING.

[10] Gannavaram V, Tulasi Krishna & Gannavaram, Venkat Praveen & Gannavaram,
Venkat Chinmai Sai & Rao, Vadithala & Reddy, G. & Polala, Niranjan & Pakala, Shireesha
& Madugula, Sujatha & Madupu, Ram & Rangu, Seshu & Saideep, Sunkari &
Kandhikonda, Uma & Gannavaram, Srivani. (2021). AI and IoT enabled Smart Medicine
Box.

You might also like