Intelligent Weighing Container Development

5589 words (22 pages) Essay

23rd Sep 2019 Internet Reference this

Disclaimer: This work has been submitted by a university student. This is not an example of the work produced by our Essay Writing Service. You can view samples of our professional work here.

Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of UKEssays.com.

Intelligent Weighing Container

Abstract:

The project aims to build a real time intelligent weighing container which provides the real time monitoring the measurement of the container. There is a requirement for more proficient approach to screen the measure of materials left for the inevitable days and in the event of shop it is important to profit the expected amount to enhance the business. The proposed Internet of Things (IoT) framework recognizes the below the threshold value, by transmitting the amount of accessible sustenance to the user through versatile application. It gives an alarm to the user to put in a request if the weight falls below the threshold value. The proposed system detects the shortage of items in the store and transmits the weight of the item through various functionality. Also, its monitor’s the measurement for every five seconds, the email alert is passed below set threshold value. The historical data is passed through mobile application to view the ongoing current weight measurement in the container. The webserver is created to display the current weight and historical data with date and time can be displayed. The local machine is also used to view the historical data on real time basis.

INTRODUCTION:

The term “Internet of Things” refers to connecting all things, sensors and gadgets to the Internet. IOT is transforming our world to enhancing our lives style, business, industry and society. This project is based on sensing the current weight of container and send the data to the web server and access all the historical data displayed through cloud. It helps to the manager to predict the value and replenishment in exact time. This issue was overlooked commonly, managers do not know the extract measurement left in the container. This problem appears more in the big market due to increasing consumption and usage of certain specific item. Due to this issue, the smart container is constructed to new innovative technology of the IOT. The sensor checks the weight of the container and alert to the market manager to order when the stock is going to low. Smart container components are enabled through Raspberry pi to connect to various devices of IOT including web page, data storage, email alert notification, real time display, cloud and mobile application. Smart container can automatically measure the current weight and display in the web page and we can check containers current weight from everywhere using the Internet.

Design Considerations:

The system is designed to be user friendly and cost-effective in real time implementation for big departmental store or food counter where refilling needs to take in every frequent of time. The main design consideration for measuring the weight between 0 to 50 Kg are:

a) Monitoring real time display of the current weight.

b) Email alert sent to appropriate person if the weight goes less than the specified threshold value.

c) To view the real time weight and the historical data in the local machine connected with the HTTP webserver.

 After detail consideration of design, it would be appropriate to display the weight from any place so the project was added even more design consideration and they are:

a) To view the historical data from any machine which is connected with Epizy webserver which was designed to develop for smart container.

b) Display the historical data in Mobile application which is connected with MQTT dashboard connected with cloud.

c) Save the historical data in cloud as textile file and generate report on everyday basis.

d) The database was connected using Raspberry Pi is enabled, and hence we can store data in database online and can view the database from anyplace and export the data for future analysis.

The design is mainly relied on the weight sensor and the load cell module which is attached with the Raspberry pi. The design can be implemented to almost any standard for measuring the weight and frequent notification of weight of the container.

The main two system design requirement are on:

  • Hardware
  • Software

Hardware:  The basic hardware requirement is for the project can be listed below

  • Raspberry Pi
  • Load cell
  • HX711 load amplifier
  • 16*2 Module LCD
  • Connecting wires
  • Resistance
  • Bread Board

Software:

The software used for communication the hardware devices are:

  • Python
  • HTML
  • Sql Database
  • MQTT
  • Epizy webserver
  • Db4free.net

The system mainly relies on the Raspberry Pi, according to Raspberry Pi data sheet it acts like single computer, using advanced level processor attached in it and integrated with voltage regulator of 5V power supply. Raspberry Pi supports various operating system and it acts like a system-on-chip based multimedia processor which is heart of the Raspberry pi contains board arm processor [1]. The GPIO pins can easily interact with weight sensor and for display it is connected with HDMI cable and Internet connect is connected through Wi-fi or LAN cable and the USB ports are used for serial communication.

Design Description:

The Smart Container for store product with sensor functionality inside. In the Smart container we are considering the raspberry Pi, LCD (Liquid Crystal Display), Load cell and HX711 Load cell Amplifier Module are using as sensor to check the weight and for connection we are using the wires, breadboard and nut bolts. We have fixed a wooden board with Load cell with nut bolts. LCD pins are connected with GPIO Pin number of Raspberry Pi. HX711 and are directly connected with Load cell. The flowchart below explains how the intelligent weighing container works.

Figure1: Flow chart of Intelligent weighing container

Block Diagram:

Figure 2: Block diagram of Intelligent weighing container

The architecture of our Smart container of IOT project is illustrated in Figure.2. It shows the block diagram Smart container of Load cell(sensor) is connected to Raspberry Pi. We are using Raspberry Pi to control the process between the sensor and LCD (Liquid Crystal Display). Load cell senses the weight of the intelligent container and sends the analogue signal voltage to the H.×711 Load Amplifier Module, and it converts the Analog signal into digital form. Load Amplifier Modules pass the value to the Raspberry Pi. Then it converts into the weight value and displays in the LCD (Liquid Crystal Display). After this process, the weight value is checked and compared with a presumed threshold value (50) in python code using the Raspberry Pi and if weight capacity less than 15 kg and Raspberry Pi send email alert “smart container is empty”. Here we are using MQTT to send the data from Raspberry Pi to cloud (Epizy) over the network. The web page is automatically refreshed after five seconds and we can get the update and historical value. With the help of MQTT (Message Queuing Telemetry Transport), we can get the data in the mobile App and webpage in anywhere.

Working Flow:

a)     The main focus is to build using Raspberry Pi Smart container using Load cell and HX711 weight sensor. The load cell weight sensor (senses the real time weight) which plays major role in sensing the weight which is connected with load cell amplifies which amplifier the real time weight present in the container.

                       Figure 3: Connection between device

b) Display the current weight and historical data in the local machine by connecting with the Raspberry Pi. the weight of the container can monitor and the weight gets updated every five seconds, this duration can be changed in HTML code written.

Figure 4: Historical data on web client

c) We have set a threshold value of about 50 KG; the limit can also be changed according the requirement of the buyer the notification is received below threshold set value 15KG by sending email alert to specified address email address.

Figure 5: Email Alert by Raspberry Pi

d) We can monitor the weight of container in real time free web browser and real display as well using LCD, you can monitor the LCD value by connecting with Raspberry pi.

Figure 6: LCD Display

e) Next step is webserver is connected with the cloud called epizy free web server dashboard and hence we can view the historical data displayed in the any machine and in anyplace.

f) The Raspberry pi is connected with MQTT cloud dash board, then after downloading the free mobile application MQTT, then connecting with cloud, we can view the historical data and current display in mobile.

Figure 6: Dashboard MQTT on Mobile

g) For overview report of the previous day sales of the item, we have connected Raspberry Pi with database and where able to pull the previous day record as text file.

                    Figure 7: Text file record of weight

h) The free database enabled using sql connector with raspberry Pi, the website used for db4free.net hence the data are stored in database and data can be exported as well.

Discussion:

Firstly, we were working only to measure the weight in grams and then after lots of consideration we decided to change the process and measure the weight in Kilogram and maximum range is approximately 50 Kilogram and minimum weight is 0 kilogram. Eventually we decided to send the email alert when the container is empty. However, this is not the best way to send alert email when is it empty, and so we decided to send the email alert when the weight is reached to 15 Kilogram so the appropriate person gets the notification before ahead. This functionality is improved our project. Third, functionality which has changed we started to work only the current weight display, hence after considering it would gain more preference that displays the current value to the historical value, we give preference to historical data because it shows the details of the smart container, how many times we need to fill the container and it really benefits for the manager. Additionally, we send the data only at the one web client page (HTTP) and later we sent the data into the cloud(epizy) by MQTT (Message Queuing Telemetry Transport) and even added mobile application so now we can download the app of MQTT in android mobile and check the details of the smart container any time. This advanced feature makes our project better and everyone is familiar with the mobile app and easy to download and use it. We even discussed only to show single day historical data we have added a functionality by storing the data as text file and view previous day record, so we can have a look how the business of the particular product has increased or decreased. A sql database enabled to store the data in DB so the data can be pushed to database and can enabled to view any machine at anyplace how the data is stored and data can be exported from anyplace. Moreover, it is saving the time of the team members and these were the effective discussions made doing our project design. The problem we faced were couldn’t find the load cell amplifier in local store and need to order through online it took nearly one month to deliver the load cell.

Conclusion:

In this project we have introduced, intelligent weighing container with multimedia capability. The proposed smart container for replenishment of product at appropriate time. The various functionality added to it can perform email alert notification, record of the historical data in the various webpage and mobile application. With the help of smart container different stores can save time and obtain the statics of viewing which product have sold more frequent. The most valuable in design in this product they can retrieve the historical data measurement. The concept of intelligent container notified to user in charge  and  team members if required, hence so it is cost effective  user friendly and profitable in real time implementation.

Future scope:

A smart container has proposed project for sensing the weight of the container which is placed in the various racks. Thus, system save the times and effort. In future expansion of the product, different functionality can be added by implementing geofencing technology and display in which geo location the replenishment needs to take and in particular store the product ran out and needs additional stock to be refilled. That will give the product description and location so, it is more effective to save time and manpower.

Appendix:

Project Phases

Project Status

Date

Week1

Research on project gathering and discussion making

10/08/2018

Week2

Research on Smart container and relevant papers

17/08/2018

Week3

Requirement gathering

24/08/2018

Week4

System design prototyping setup

31/08/2018

Week5

Collecting components and design considerations

7/09/2018

Week6

Implementation of connecting Raspberry Pi with components

14/09/2018

Week7

Implementation of Real time LCD display and Client webpage

21/09/2018

Week8

Software written for MQTT and cloud webpage

28/09/2108

Week9

Implementation of email alert and coding written for different users

5/10/2018

Week10

Connecting all hardware and software module

12/10/2018

Week11

Implementation and discussion for saving historical data in cloud

19/10/2018

Week12

Demonstration with random inputs and checking all have been implemented appropriate

21/10/2018

Python code:

import time

import Adafruit_CharLCD as lcd

from random import randint

import smtplib

from email.mime.text import MIMEText

import paho.mqtt.client as mqttClient

import datetime

import os.path

import mysql.connector

# MQTT configuration

def on_connect(client, userdata, flags, rc):

  if rc == 0:

    print(“Connected to broker”)

    global Connected  #Use global variable

    Connected = True                #Signal connection

    global currentCap

    global maxCap

    global emailSent

    global isRefill

  else:

    print(“Connection failed”)

# mysql initiation

mydb = mysql.connector.connect(

  host=”db4free.net”,

  port=”3306″,

  user=”myiotproject”,

  passwd=”100%myproject”,

  database=”myiotproject”

)

mycursor = mydb.cursor()

Connected = False   #global variable for the state of the connection

emailSent = False

isRefill = False

broker_address= “m15.cloudmqtt.com”

port = 14761

user = “ggswehay”

password = “2ssAV4htBodh”

client = mqttClient.Client(“Python”)               #create new instance

client.username_pw_set(user, password=password)    #set username and password

client.on_connect= on_connect                      #attach function to callback

client.connect(broker_address, port=port)          #connect to broker

client.subscribe(“report”)

def on_message(client, userdata, message):

  if (message.payload == “refill”):

    currentCap = maxCap

    emailSent = False

    isRefill = False

    print “Message received : ” + message.payload

client.loop_start()        #start the loop

while Connected != True:    #Wait for connection

    time.sleep(0.1)

# Raspberry Pi pin configuration:

lcd_rs        = 14

lcd_en        = 15

lcd_d4        = 18

lcd_d5        = 23

lcd_d6        = 24

lcd_d7        = 25

lcd_backlight = 4

# Define LCD column and row size for 16×2 LCD.

lcd_columns = 16

lcd_rows    = 2

# Initialize the LCD using the pins above.

lcd = lcd.Adafruit_CharLCD(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7,

                           lcd_columns, lcd_rows, lcd_backlight)

# Initialize maximum and minimum random value

randMin = 0

randMax =9

# Initialize maximum and minimum capacity

maxCap = 50

minCap = 0

# Initialize minimum treshold

minTreshold = 10

# Initialize current capacity

currentCap = maxCap

# Initialize looping state

moreLoop = True

# Printing information on LCD

lcd.message (“Smart Container ***************”)

time.sleep(5)

lcd.clear()

lcd.message (“Max Cpcty: %d Min Trshld: %d”%(maxCap, minTreshold))

time.sleep(5)

# Begin looping

while (moreLoop):

  client.on_message=on_message

  # Save current capacity to txt file

  dt = datetime.datetime.now().strftime(“%d_%m_%y”)

  dtl = datetime.datetime.now().strftime(“%d-%m-%y;%H:%M:%S”)

  filename = dt + “.txt”

  if (os.path.isfile(filename)):

    print “file exist”

    f = open(filename, “a”)

    f.write(dtl)

    f.write(“;”)

    f.write(str(currentCap))

    f.write(“ ”)

    f.close()

  else:

    print “file not exist”

    f = open(filename, “w+”)

    f.write(dtl)

    f.write(“;”)

    f.write(str(currentCap))

    f.write(“ ”)

    f.close()

  # Save current capacity to mysql database

  sql = “insert into container(capacity) values(%s)”%(str(currentCap))

  val = (’56’)

  mycursor.execute(sql)

  mydb.commit()

  print(mycursor.rowcount, ” record inserted.”)

  # Generating random value

  chop = randint(randMin,randMax)

  # Temporary value after deducting random value from current capacity

  temp = currentCap – chop

  # If temporary value drop below zero

  if (temp < 0):

    chop = currentCap

  # Obtaining current capacity

  currentCap = currentCap – chop

  # If current capacity is below minimum treshold

  if (currentCap < minTreshold):

    msg = “Low Capacity Current Cap: %d”%(currentCap)

    # Sending data via MQTT

    client.publish(“report”,currentCap)

  else:

    msg = “Subtract: %d Current Cap: %d”%(chop, currentCap)

    # Sending data via MQTT

    client.publish(“report”,currentCap)

  # If current capacity is zero

  if (currentCap == 0):

    moreLoop = False

    lcd.clear()

    client.disconnect()

    client.loop_stop()

    # Sending email

    if (emailSent == False):

      msg = “Container Empty Sending email.”

      lcd.message (msg)

      server = smtplib.SMTP(‘smtp.gmail.com’, 587)

      server.starttls()

      server.login(“[email protected]”, “100%myproject”)

      emsg = MIMEText(“””This mail sent from IoT Smart Container System. Your Smart Container is Empty.”””)

      sender = ‘[email protected]

      recipients = [‘[email protected]’, ‘[email protected]’,’[email protected]’]

      emsg[‘Subject’] = “[Testing] Smart Container Notification”

      emsg[‘From’] = sender

      emsg[‘To’] = “, “.join(recipients)

      server.sendmail(sender, recipients, emsg.as_string())

      server.quit()

      msg = “Container Empty Email sent..”

      emailSent=True

      isRefill = False

  lcd.clear()

  lcd.message (msg)

  time.sleep(5)

HTML code:

<!DOCTYPE html>

<html>

   <head>

      <meta charset=”utf-8″>

      <title>Smart Container Monitor</title>

      <link rel=”stylesheet” href=”style.css”>

      <script src=”https://cdnjs.cloudflare.com/ajax/libs/paho-mqtt/1.0.2/mqttws31.min.js” type=”text/javascript”></script>

      <script src=”demo.js” type=”text/javascript”></script>

   </head>

   <body>

      <div class=”wrapper”>

         <h1>Smart Container</h1>

         <form id=”connection-information-form”>

            <input type=”button” onclick=”startConnect()” value=”Connect”>

            <input type=”button” onclick=”startDisconnect()” value=”Disconnect”>

         </form>

         <div id=”report”></div>

         <div id=”messages”></div>

      </div>

   </body>

</html>

MQTT code:

import paho.mqtt.client as mqttClient

import time

def on_connect(client, userdata, flags, rc):

  if rf == 0:

    print(“Connected to broker”)

    global Connected

    Connected = True

  else:

    print(“Connection failed”)

Connected = False

broker_address= “m15.cloudmqtt.com”

port = 14169

user = “wsoskphh”

password = “RMnrhsLxCOkZ”

client = mqttClient.Client(“Python”)               #create new instance

client.username_pw_set(user, password=password)    #set username and password

client.on_connect= on_connect                      #attach function to callback

client.connect(broker_address, port=port)          #connect to broker

client.loop_start()        #start the loop

while Connected != True:    #Wait for connection

    time.sleep(0.1)

try:

    while True:

        value = raw_input(‘Enter the message:’)

        client.publish(“python/test”,value)

except KeyboardInterrupt:

    client.disconnect()

    client.loop_stop()

Sources to use smart container application:

  1. Websites for smart container:

Smartcontainer.epizy.com

  1. To download database data:

https://www.db4free.net/phpMyAdmin/sql.php?db=myiotproject&table=container&pos=0.

  1. Mobile Application:

https://play.google.com/store/apps/details?id=com.thn.iotmqttdashboard&rdid=com.thn.iotmqttdashboard

References:

1. https://circuitdigest.com/microcontroller-projects/iot-raspberry-pi-smart-container.

2. Hsin-Han Wu, Yung-Ting Chuang, “Low-Cost Smart Refrigerator”, Edge Computing (EDGE) 2017 IEEE International Conference on, pp. 228-231, 2017.

3. Vignesh Mahalingam Suresh, Rishi Sidhu, Prateek Karkare, Aakash Patil, Zhang Lei, Arindam Basu, “Powering the IoT through embedded machine learning and LoRa”, Internet of Things (WF-IoT) 2018 IEEE 4th World Forum on, pp. 349-354, 2018.

4. Food and Agriculture Organization of the United Nations. (2017). Food Wastage Footprint: Impacts on natural resources. Retrieved Mar., 2017, from http://www.fao.org/docrep/018/i3347e/i3347e.pdf.

5. Floarea, A. D., & Sgârciu, V. (2016, June). Smart refrigerator: A next generation refrigerator connected to the IoT. In Electronics, Computers and Artificial Intelligence (ECAI), 2016 8th International Conference on (pp. 1-6). IEEE.

6. Shih, Y. S., Samani, H., & Yang, C. Y. (2016, July). Internet of Things for human—Pet interaction. In System Science and Engineering (ICSSE), 2016 International Conference on (pp. 1-4).

7. https://www.raspberrypi.org/forums/viewtopic.php?t=82896.

8. Shady Salama, Amr B. Eltawil, “A Decision Support System Architecture Based on Simulation Optimization for Cyber-Physical Systems”, Procedia Manufacturing, vol. 26, pp. 1147, 2018.

9. Wu Fang, Yuan Haojie, Zhong Haihua, Chen Jinan., “Design and Implementation of Intelligent Refrigerator Based on Internet of Things,” Modern Computer (Professional Edition), pp. 55-61, 2011.

10. Tongzhang Yu, Gang Tong, “Based on the Internet of things intelligent refrigerator control system design,” Internet of things technology, pp. 79-82, 2014.

Intelligent Weighing Container

Abstract:

The project aims to build a real time intelligent weighing container which provides the real time monitoring the measurement of the container. There is a requirement for more proficient approach to screen the measure of materials left for the inevitable days and in the event of shop it is important to profit the expected amount to enhance the business. The proposed Internet of Things (IoT) framework recognizes the below the threshold value, by transmitting the amount of accessible sustenance to the user through versatile application. It gives an alarm to the user to put in a request if the weight falls below the threshold value. The proposed system detects the shortage of items in the store and transmits the weight of the item through various functionality. Also, its monitor’s the measurement for every five seconds, the email alert is passed below set threshold value. The historical data is passed through mobile application to view the ongoing current weight measurement in the container. The webserver is created to display the current weight and historical data with date and time can be displayed. The local machine is also used to view the historical data on real time basis.

INTRODUCTION:

The term “Internet of Things” refers to connecting all things, sensors and gadgets to the Internet. IOT is transforming our world to enhancing our lives style, business, industry and society. This project is based on sensing the current weight of container and send the data to the web server and access all the historical data displayed through cloud. It helps to the manager to predict the value and replenishment in exact time. This issue was overlooked commonly, managers do not know the extract measurement left in the container. This problem appears more in the big market due to increasing consumption and usage of certain specific item. Due to this issue, the smart container is constructed to new innovative technology of the IOT. The sensor checks the weight of the container and alert to the market manager to order when the stock is going to low. Smart container components are enabled through Raspberry pi to connect to various devices of IOT including web page, data storage, email alert notification, real time display, cloud and mobile application. Smart container can automatically measure the current weight and display in the web page and we can check containers current weight from everywhere using the Internet.

Design Considerations:

The system is designed to be user friendly and cost-effective in real time implementation for big departmental store or food counter where refilling needs to take in every frequent of time. The main design consideration for measuring the weight between 0 to 50 Kg are:

a) Monitoring real time display of the current weight.

b) Email alert sent to appropriate person if the weight goes less than the specified threshold value.

c) To view the real time weight and the historical data in the local machine connected with the HTTP webserver.

 After detail consideration of design, it would be appropriate to display the weight from any place so the project was added even more design consideration and they are:

a) To view the historical data from any machine which is connected with Epizy webserver which was designed to develop for smart container.

b) Display the historical data in Mobile application which is connected with MQTT dashboard connected with cloud.

c) Save the historical data in cloud as textile file and generate report on everyday basis.

d) The database was connected using Raspberry Pi is enabled, and hence we can store data in database online and can view the database from anyplace and export the data for future analysis.

The design is mainly relied on the weight sensor and the load cell module which is attached with the Raspberry pi. The design can be implemented to almost any standard for measuring the weight and frequent notification of weight of the container.

The main two system design requirement are on:

  • Hardware
  • Software

Hardware:  The basic hardware requirement is for the project can be listed below

  • Raspberry Pi
  • Load cell
  • HX711 load amplifier
  • 16*2 Module LCD
  • Connecting wires
  • Resistance
  • Bread Board

Software:

The software used for communication the hardware devices are:

  • Python
  • HTML
  • Sql Database
  • MQTT
  • Epizy webserver
  • Db4free.net

The system mainly relies on the Raspberry Pi, according to Raspberry Pi data sheet it acts like single computer, using advanced level processor attached in it and integrated with voltage regulator of 5V power supply. Raspberry Pi supports various operating system and it acts like a system-on-chip based multimedia processor which is heart of the Raspberry pi contains board arm processor [1]. The GPIO pins can easily interact with weight sensor and for display it is connected with HDMI cable and Internet connect is connected through Wi-fi or LAN cable and the USB ports are used for serial communication.

Design Description:

The Smart Container for store product with sensor functionality inside. In the Smart container we are considering the raspberry Pi, LCD (Liquid Crystal Display), Load cell and HX711 Load cell Amplifier Module are using as sensor to check the weight and for connection we are using the wires, breadboard and nut bolts. We have fixed a wooden board with Load cell with nut bolts. LCD pins are connected with GPIO Pin number of Raspberry Pi. HX711 and are directly connected with Load cell. The flowchart below explains how the intelligent weighing container works.

Figure1: Flow chart of Intelligent weighing container

Block Diagram:

Figure 2: Block diagram of Intelligent weighing container

The architecture of our Smart container of IOT project is illustrated in Figure.2. It shows the block diagram Smart container of Load cell(sensor) is connected to Raspberry Pi. We are using Raspberry Pi to control the process between the sensor and LCD (Liquid Crystal Display). Load cell senses the weight of the intelligent container and sends the analogue signal voltage to the H.×711 Load Amplifier Module, and it converts the Analog signal into digital form. Load Amplifier Modules pass the value to the Raspberry Pi. Then it converts into the weight value and displays in the LCD (Liquid Crystal Display). After this process, the weight value is checked and compared with a presumed threshold value (50) in python code using the Raspberry Pi and if weight capacity less than 15 kg and Raspberry Pi send email alert “smart container is empty”. Here we are using MQTT to send the data from Raspberry Pi to cloud (Epizy) over the network. The web page is automatically refreshed after five seconds and we can get the update and historical value. With the help of MQTT (Message Queuing Telemetry Transport), we can get the data in the mobile App and webpage in anywhere.

Working Flow:

a)     The main focus is to build using Raspberry Pi Smart container using Load cell and HX711 weight sensor. The load cell weight sensor (senses the real time weight) which plays major role in sensing the weight which is connected with load cell amplifies which amplifier the real time weight present in the container.

                       Figure 3: Connection between device

b) Display the current weight and historical data in the local machine by connecting with the Raspberry Pi. the weight of the container can monitor and the weight gets updated every five seconds, this duration can be changed in HTML code written.

Figure 4: Historical data on web client

c) We have set a threshold value of about 50 KG; the limit can also be changed according the requirement of the buyer the notification is received below threshold set value 15KG by sending email alert to specified address email address.

Figure 5: Email Alert by Raspberry Pi

d) We can monitor the weight of container in real time free web browser and real display as well using LCD, you can monitor the LCD value by connecting with Raspberry pi.

Figure 6: LCD Display

e) Next step is webserver is connected with the cloud called epizy free web server dashboard and hence we can view the historical data displayed in the any machine and in anyplace.

f) The Raspberry pi is connected with MQTT cloud dash board, then after downloading the free mobile application MQTT, then connecting with cloud, we can view the historical data and current display in mobile.

Figure 6: Dashboard MQTT on Mobile

g) For overview report of the previous day sales of the item, we have connected Raspberry Pi with database and where able to pull the previous day record as text file.

                    Figure 7: Text file record of weight

h) The free database enabled using sql connector with raspberry Pi, the website used for db4free.net hence the data are stored in database and data can be exported as well.

Discussion:

Firstly, we were working only to measure the weight in grams and then after lots of consideration we decided to change the process and measure the weight in Kilogram and maximum range is approximately 50 Kilogram and minimum weight is 0 kilogram. Eventually we decided to send the email alert when the container is empty. However, this is not the best way to send alert email when is it empty, and so we decided to send the email alert when the weight is reached to 15 Kilogram so the appropriate person gets the notification before ahead. This functionality is improved our project. Third, functionality which has changed we started to work only the current weight display, hence after considering it would gain more preference that displays the current value to the historical value, we give preference to historical data because it shows the details of the smart container, how many times we need to fill the container and it really benefits for the manager. Additionally, we send the data only at the one web client page (HTTP) and later we sent the data into the cloud(epizy) by MQTT (Message Queuing Telemetry Transport) and even added mobile application so now we can download the app of MQTT in android mobile and check the details of the smart container any time. This advanced feature makes our project better and everyone is familiar with the mobile app and easy to download and use it. We even discussed only to show single day historical data we have added a functionality by storing the data as text file and view previous day record, so we can have a look how the business of the particular product has increased or decreased. A sql database enabled to store the data in DB so the data can be pushed to database and can enabled to view any machine at anyplace how the data is stored and data can be exported from anyplace. Moreover, it is saving the time of the team members and these were the effective discussions made doing our project design. The problem we faced were couldn’t find the load cell amplifier in local store and need to order through online it took nearly one month to deliver the load cell.

Conclusion:

In this project we have introduced, intelligent weighing container with multimedia capability. The proposed smart container for replenishment of product at appropriate time. The various functionality added to it can perform email alert notification, record of the historical data in the various webpage and mobile application. With the help of smart container different stores can save time and obtain the statics of viewing which product have sold more frequent. The most valuable in design in this product they can retrieve the historical data measurement. The concept of intelligent container notified to user in charge  and  team members if required, hence so it is cost effective  user friendly and profitable in real time implementation.

Future scope:

A smart container has proposed project for sensing the weight of the container which is placed in the various racks. Thus, system save the times and effort. In future expansion of the product, different functionality can be added by implementing geofencing technology and display in which geo location the replenishment needs to take and in particular store the product ran out and needs additional stock to be refilled. That will give the product description and location so, it is more effective to save time and manpower.

Appendix:

Project Phases

Project Status

Date

Week1

Research on project gathering and discussion making

10/08/2018

Week2

Research on Smart container and relevant papers

17/08/2018

Week3

Requirement gathering

24/08/2018

Week4

System design prototyping setup

31/08/2018

Week5

Collecting components and design considerations

7/09/2018

Week6

Implementation of connecting Raspberry Pi with components

14/09/2018

Week7

Implementation of Real time LCD display and Client webpage

21/09/2018

Week8

Software written for MQTT and cloud webpage

28/09/2108

Week9

Implementation of email alert and coding written for different users

5/10/2018

Week10

Connecting all hardware and software module

12/10/2018

Week11

Implementation and discussion for saving historical data in cloud

19/10/2018

Week12

Demonstration with random inputs and checking all have been implemented appropriate

21/10/2018

Python code:

import time

import Adafruit_CharLCD as lcd

from random import randint

import smtplib

from email.mime.text import MIMEText

import paho.mqtt.client as mqttClient

import datetime

import os.path

import mysql.connector

# MQTT configuration

def on_connect(client, userdata, flags, rc):

  if rc == 0:

    print(“Connected to broker”)

    global Connected  #Use global variable

    Connected = True                #Signal connection

    global currentCap

    global maxCap

    global emailSent

    global isRefill

  else:

    print(“Connection failed”)

# mysql initiation

mydb = mysql.connector.connect(

  host=”db4free.net”,

  port=”3306″,

  user=”myiotproject”,

  passwd=”100%myproject”,

  database=”myiotproject”

)

mycursor = mydb.cursor()

Connected = False   #global variable for the state of the connection

emailSent = False

isRefill = False

broker_address= “m15.cloudmqtt.com”

port = 14761

user = “ggswehay”

password = “2ssAV4htBodh”

client = mqttClient.Client(“Python”)               #create new instance

client.username_pw_set(user, password=password)    #set username and password

client.on_connect= on_connect                      #attach function to callback

client.connect(broker_address, port=port)          #connect to broker

client.subscribe(“report”)

def on_message(client, userdata, message):

  if (message.payload == “refill”):

    currentCap = maxCap

    emailSent = False

    isRefill = False

    print “Message received : ” + message.payload

client.loop_start()        #start the loop

while Connected != True:    #Wait for connection

    time.sleep(0.1)

# Raspberry Pi pin configuration:

lcd_rs        = 14

lcd_en        = 15

lcd_d4        = 18

lcd_d5        = 23

lcd_d6        = 24

lcd_d7        = 25

lcd_backlight = 4

# Define LCD column and row size for 16×2 LCD.

lcd_columns = 16

lcd_rows    = 2

# Initialize the LCD using the pins above.

lcd = lcd.Adafruit_CharLCD(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7,

                           lcd_columns, lcd_rows, lcd_backlight)

# Initialize maximum and minimum random value

randMin = 0

randMax =9

# Initialize maximum and minimum capacity

maxCap = 50

minCap = 0

# Initialize minimum treshold

minTreshold = 10

# Initialize current capacity

currentCap = maxCap

# Initialize looping state

moreLoop = True

# Printing information on LCD

lcd.message (“Smart Container ***************”)

time.sleep(5)

lcd.clear()

lcd.message (“Max Cpcty: %d Min Trshld: %d”%(maxCap, minTreshold))

time.sleep(5)

# Begin looping

while (moreLoop):

  client.on_message=on_message

  # Save current capacity to txt file

  dt = datetime.datetime.now().strftime(“%d_%m_%y”)

  dtl = datetime.datetime.now().strftime(“%d-%m-%y;%H:%M:%S”)

  filename = dt + “.txt”

  if (os.path.isfile(filename)):

    print “file exist”

    f = open(filename, “a”)

    f.write(dtl)

    f.write(“;”)

    f.write(str(currentCap))

    f.write(“ ”)

    f.close()

  else:

    print “file not exist”

    f = open(filename, “w+”)

    f.write(dtl)

    f.write(“;”)

    f.write(str(currentCap))

    f.write(“ ”)

    f.close()

  # Save current capacity to mysql database

  sql = “insert into container(capacity) values(%s)”%(str(currentCap))

  val = (’56’)

  mycursor.execute(sql)

  mydb.commit()

  print(mycursor.rowcount, ” record inserted.”)

  # Generating random value

  chop = randint(randMin,randMax)

  # Temporary value after deducting random value from current capacity

  temp = currentCap – chop

  # If temporary value drop below zero

  if (temp < 0):

    chop = currentCap

  # Obtaining current capacity

  currentCap = currentCap – chop

  # If current capacity is below minimum treshold

  if (currentCap < minTreshold):

    msg = “Low Capacity Current Cap: %d”%(currentCap)

    # Sending data via MQTT

    client.publish(“report”,currentCap)

  else:

    msg = “Subtract: %d Current Cap: %d”%(chop, currentCap)

    # Sending data via MQTT

    client.publish(“report”,currentCap)

  # If current capacity is zero

  if (currentCap == 0):

    moreLoop = False

    lcd.clear()

    client.disconnect()

    client.loop_stop()

    # Sending email

    if (emailSent == False):

      msg = “Container Empty Sending email.”

      lcd.message (msg)

      server = smtplib.SMTP(‘smtp.gmail.com’, 587)

      server.starttls()

      server.login(“[email protected]”, “100%myproject”)

      emsg = MIMEText(“””This mail sent from IoT Smart Container System. Your Smart Container is Empty.”””)

      sender = ‘[email protected]

      recipients = [‘[email protected]’, ‘[email protected]’,’[email protected]’]

      emsg[‘Subject’] = “[Testing] Smart Container Notification”

      emsg[‘From’] = sender

      emsg[‘To’] = “, “.join(recipients)

      server.sendmail(sender, recipients, emsg.as_string())

      server.quit()

      msg = “Container Empty Email sent..”

      emailSent=True

      isRefill = False

  lcd.clear()

  lcd.message (msg)

  time.sleep(5)

HTML code:

<!DOCTYPE html>

<html>

   <head>

      <meta charset=”utf-8″>

      <title>Smart Container Monitor</title>

      <link rel=”stylesheet” href=”style.css”>

      <script src=”https://cdnjs.cloudflare.com/ajax/libs/paho-mqtt/1.0.2/mqttws31.min.js” type=”text/javascript”></script>

      <script src=”demo.js” type=”text/javascript”></script>

   </head>

   <body>

      <div class=”wrapper”>

         <h1>Smart Container</h1>

         <form id=”connection-information-form”>

            <input type=”button” onclick=”startConnect()” value=”Connect”>

            <input type=”button” onclick=”startDisconnect()” value=”Disconnect”>

         </form>

         <div id=”report”></div>

         <div id=”messages”></div>

      </div>

   </body>

</html>

MQTT code:

import paho.mqtt.client as mqttClient

import time

def on_connect(client, userdata, flags, rc):

  if rf == 0:

    print(“Connected to broker”)

    global Connected

    Connected = True

  else:

    print(“Connection failed”)

Connected = False

broker_address= “m15.cloudmqtt.com”

port = 14169

user = “wsoskphh”

password = “RMnrhsLxCOkZ”

client = mqttClient.Client(“Python”)               #create new instance

client.username_pw_set(user, password=password)    #set username and password

client.on_connect= on_connect                      #attach function to callback

client.connect(broker_address, port=port)          #connect to broker

client.loop_start()        #start the loop

while Connected != True:    #Wait for connection

    time.sleep(0.1)

try:

    while True:

        value = raw_input(‘Enter the message:’)

        client.publish(“python/test”,value)

except KeyboardInterrupt:

    client.disconnect()

    client.loop_stop()

Sources to use smart container application:

  1. Websites for smart container:

Smartcontainer.epizy.com

  1. To download database data:

https://www.db4free.net/phpMyAdmin/sql.php?db=myiotproject&table=container&pos=0.

  1. Mobile Application:

https://play.google.com/store/apps/details?id=com.thn.iotmqttdashboard&rdid=com.thn.iotmqttdashboard

References:

1. https://circuitdigest.com/microcontroller-projects/iot-raspberry-pi-smart-container.

2. Hsin-Han Wu, Yung-Ting Chuang, “Low-Cost Smart Refrigerator”, Edge Computing (EDGE) 2017 IEEE International Conference on, pp. 228-231, 2017.

3. Vignesh Mahalingam Suresh, Rishi Sidhu, Prateek Karkare, Aakash Patil, Zhang Lei, Arindam Basu, “Powering the IoT through embedded machine learning and LoRa”, Internet of Things (WF-IoT) 2018 IEEE 4th World Forum on, pp. 349-354, 2018.

4. Food and Agriculture Organization of the United Nations. (2017). Food Wastage Footprint: Impacts on natural resources. Retrieved Mar., 2017, from http://www.fao.org/docrep/018/i3347e/i3347e.pdf.

5. Floarea, A. D., & Sgârciu, V. (2016, June). Smart refrigerator: A next generation refrigerator connected to the IoT. In Electronics, Computers and Artificial Intelligence (ECAI), 2016 8th International Conference on (pp. 1-6). IEEE.

6. Shih, Y. S., Samani, H., & Yang, C. Y. (2016, July). Internet of Things for human—Pet interaction. In System Science and Engineering (ICSSE), 2016 International Conference on (pp. 1-4).

7. https://www.raspberrypi.org/forums/viewtopic.php?t=82896.

8. Shady Salama, Amr B. Eltawil, “A Decision Support System Architecture Based on Simulation Optimization for Cyber-Physical Systems”, Procedia Manufacturing, vol. 26, pp. 1147, 2018.

9. Wu Fang, Yuan Haojie, Zhong Haihua, Chen Jinan., “Design and Implementation of Intelligent Refrigerator Based on Internet of Things,” Modern Computer (Professional Edition), pp. 55-61, 2011.

10. Tongzhang Yu, Gang Tong, “Based on the Internet of things intelligent refrigerator control system design,” Internet of things technology, pp. 79-82, 2014.

Cite This Work

To export a reference to this article please select a referencing stye below:

Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.

Related Services

View all

DMCA / Removal Request

If you are the original writer of this essay and no longer wish to have your work published on the UKDiss.com website then please: