0% found this document useful (0 votes)
131 views57 pages

MQTT Based Environment Monitoring in Factories For Employee Safety

This document proposes an MQTT-based system to monitor environmental factors like temperature, humidity, smoke, and proximity in factories to improve employee safety. Sensors would detect these factors and upload data to the Losant IoT platform for monitoring and alerts. The existing system has security issues like exposed data and DOS vulnerabilities. The proposed system uses an ESP8266 microcontroller with sensors to monitor the factory environment over MQTT and improve safety.

Uploaded by

Prabhu R
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views57 pages

MQTT Based Environment Monitoring in Factories For Employee Safety

This document proposes an MQTT-based system to monitor environmental factors like temperature, humidity, smoke, and proximity in factories to improve employee safety. Sensors would detect these factors and upload data to the Losant IoT platform for monitoring and alerts. The existing system has security issues like exposed data and DOS vulnerabilities. The proposed system uses an ESP8266 microcontroller with sensors to monitor the factory environment over MQTT and improve safety.

Uploaded by

Prabhu R
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 57

MQTT Based Environment Monitoring In Factories

for Employee Safety

Abstract
Safety of employees, in any industry, especially at the factory level is one
of the most important aspects to be considered by businesses. This is of
paramount importance, both for the well-being of the employees and that of the
corporation as a whole. In factories where working conditions are harsh and
employees need to take great caution while going about their work, it is
common for mishaps to occur. With numbers going as high as into the
thousands it is important that there is a measure of safety for the employees
from any possible hazardous situations. As a solution to this problem, a
monitoring system to be installed in factories. With this system, we will be able
to monitor critical safety parameters of the working environment in these
factories so that we are well-aware of the safety situation and the possibility of
occurrence of any mishap. For the design of this system, we use an ESP8266
Wi-Fi chip enabled microcontroller NodeMCU.To this are connected three
sensors - one to monitor temperature and humidity ( DHT sensor ), an ultrasonic
sensor ( HC-04 ) and a smoke sensor( MQ2 sensor ). these sensors continually
monitor the environment in the workplace and upload the data onto the Losant
IoT Platform, which is one of the most powerful cloud platforms which help
monitor data by different visualizations and further provisions.

To monitor the changes around the people and predicting by an alarming


senses for an every single movement. We propose to monitor the person’s
health-care (BP, Pulse rate, Heart rate, Temperature) and indicate to the doctor
when there is fall or increase in the changes by an alarming system. Thus we
provide a solution based on IOT based on environmental parameters,
monitoring and alarming system using MQTT and this MQTT will collect all
the necessary data from the sensor. The values collected from the DHT11
sensor is being sent to the server and the server which contains the value is
being stored in the database that is the MQTT library which acts as a cloud for
storing all the values and from the database all the values are being sent to the
Raspberry pi3 B+ model board for monitoring the values. We can save the
people when there is an increase or fall in the movements. People in danger can
be monitored using an alarming system, when there is an increase or fall in the
persons healthcare(BP, Pulse rate, Heart rate, Temperature)it can be monitored
using DHT11 sensor and is being alarmed using an alarming system or the
alarming sensor.

Introduction
With rapid industrial development, there have been a drastically increased
number of factories all over India in all sectors. With this development, the
spurious outburst of factories have unfortunately not been accompanied by the
required and regulated safety standards set by the National Policy on Safety,
Health and Environment at Workplace. There are plenty of problems that plague
the workers working in factories with hazardous environments. The main
problems that affect the workers in a typical factory are the environmental
conditions, namely, temperature and humidity, the presence of potentially
harming and dangerous equipment used in the factory, and the possibility of a
fire outbreak itself in the factory. So for a more employee-friendly and safe
atmosphere to prevent accidents there is the need for a system which can
continually monitor the situation in the factory and send the data in an
understandable way to the concerned authorities so that they can monitor it and
accordingly act when there is any mishap to avoid escalation of the problem or
when there is the possibility of an accident and alert the concerned people to
prevent it. The Internet of Things is what comes to the rescue here with us being
able to monitor the environment with several sensors and upload the data so that
it can be monitored.

Temperature and humidity are two of the most basic aspects to be


considered and maintained at specific levels so that employees do not feel
uncomfortable and be prone to health risks. Most people feel comfortable in the
temperature range of 20 to 27◦C and a humidity range of 35-60%. Typically
extreme levels of temperature and humidity cause workers to suffocate and
prevent them from putting in their maximum effort. Some of the problems
caused include muscle cramps, fatigue, irritation and headache. So there is a
need to constantly monitor these parameters. Another main cause for factory
accidents is the fact that employees tend to walk into areas where there are
automated machinery. This leads to accidents where the workers stray into the
range of the machine and are hit by it while it is working. Implementing sensors
to detect if someone is approaching a possibly hazardous machine and warning
him or her in advance would save the life of the employee and prevent these
kinds of accidents. Most factories operate with the help of heavy machinery and
high power electricity to operate. This gives cause for a possible fire to break
out with any deviation from normal working conditions. So we need to
continuously monitor the factory for signs of a fire breaking out. This is done by
smoke sensors which sense the presence of smoke when there is a fire.

The NodeMCU based on ESP8266 and monitors the various parameters


for signs of possible accidents or mishaps in the factory and aggregates all this
data for further evaluation and processing to reach intelligent decisions. The
data is uploaded on one of the most powerful and most popular IoT platform,
Losant for aggregation and can be displayed in a user-friendly and easy-to-
understand pattern, using their Dashboard option. Communication is done using
the MQTT protocol which is lightweight in memory and consequently power
consumption so that the system can be widely implemented at low costs one
large scale.

Existing system
We also outlined design issues and implementation vulnerabilities, which
can contribute to the number of unsecure deployments that we found. A design
issue that we discovered (designated as CVE-2017-7653 for Mosquito, the most
popular broker), for instance, can allow a malicious client to supply invalid
data. By using the message-retain option and modifying the quality of service
(Quos), an attacker can lead clients to be flooded with the same (retained)
message over and over. Unsecure endpoints, moreover, can expose records and
leak information, some of which we found to be related to critical sectors, for
any casual attacker to see. Vulnerable endpoints can also run the risk of denial-
of-service (DoS) attacks or even be taken advantage of to gain full control.

We also found instances of data exposure related to the manufacturing


sector. Records were leaked by a programmable logic controller (PLC), which
was sending out telemetry data via an open MQTT broker. Exposed records
could indicate names assigned to particular control systems, details of the
manufacturing processes, and even urgent maintenance.

Such information can be used for target reconnaissance so that connected


machines or employees of potentially high-profile companies can be tracked.
These are just two examples of how exposed data in smart cities, factories, and
even certain sectors could allow an attacker to prepare for an attack with the
help of leaked sensitive data. The protocol used, MQTT, is a lightweight
application-layer communication protocol that uses the concept of publish-
subscribe method for messaging. Our device, as a client, publishes data which
can be collected and stored on our Losant accounts by subscribing to the topics
the data has been published in. Losant provides an MQTT broker whose
services we can use to bridge. The DHT sensor has a single digital output which
cans be connected to any digital GPIO of the NodeMCU. With this we can read
the values of temperature and humidity directly in the factory without any
calibration needed, due to the presence of onboard processing availability on the
DHT sensor. The ultrasonic sensor has two pins, the trigger pin (Trig) and the
echo pin (Echo) which need to be connected to two digital GPIOs of the
NodeMCU. The trigger pin is used to trigger a pulse of a predefined type which
will be sent out, and if reflected back and received, will be done so by the echo
pin. Here, again, there is onboard processing to calculate the time between the
trigger and echo reception, to calculate the distance the obstacle is from the
sensor. This will help us detect if a person is straying into a dangerous zone
which is off-limits for safety purposes

Disadvantages
Message Queuing Telemetry Transport (MQTT) is a communication
protocol widely used in both IoT and IIoT deployments. MQTT is a publish-
subscribe protocol that facilitates one-to-many communication mediated by
brokers. Clients can publish messages to a broker and/or subscribe to a broker to
receive certain messages. Messages are organized by topics, which essentially
are “labels” that act as a system for dispatching messages to subscribers. An
internet-wide scan on exposed MQTT endpoints conducted by IO Active’s
Lucas Lundgren between 2016 and 2017 presented a clear deployment problem
among tens of thousands of unsecure MQTT hosts. A smart-home-centric
MQTT research was also released by vast this year, highlighting the lack of
secure configurations and the likelihood of misconfigurations in home devices
that use MQTT. We decided to look into the same problem include. What we
found was striking: Hundreds of thousands of MQTT host is reachable via
public-facing IP addresses. Overall, this provides attackers with millions of
exposed records. Finding exposed endpoints in virtually every country is
feasible due to the inherent openness of the protocols and publicly searchable
deployments.
Proposed system
In a nutshell, implements an MQTT protocol based communication to
send data to the cloud. The various sensors keep pushing data to the NodeMCU
which stores them temporarily in predefined variables. Then it uploads all this
data to the Losant IoT platform by publishing the data through MQTT. The
Losant account to which data is being published to will already have subscribed
to the topics which the NodeMCU. NodeMCU is an open source IoT platform.
It includes firmware which runs on the ESP8266 Wi-Fi So C from Espresso if
Systems, and hardware which is based on the ESP-12module. It is quite
compact and also affordable, making it one of the most popular choices for
many people working on IoT applications. With a RAM of 128kB and a storage
space of 4MB, it is quite light on memory and power consumption. It has one
analog and eight digital GPIOs, thus making it quite convenient to run a variety
of different applications integrating sensors and actuators with it. It is very
comfortable to work with, as it is a quite versatile device and also there is a lot
of documentation available on it on the Internet. Owing to its advantages with
respect to size, memory and power consumption, it has become one of the most
popular microcontrollers in the IoT scenario. The DHT11 sensor is a low-cost
and low-power sensor to measure the temperature and humidity in the
atmosphere. It is very inexpensive but on the downside the sensor is very basic
and slow to work, often involving a delay of around two seconds. The DHT
sensor is made up of two parts, the capacitive humidity sensor and a thermistor.
These are the two components mainly responsible for sensing humidity and
temperature respectively. The DHT sensor also includes analog to digital
conversion and sends out data in the form of a digital signal. This makes it easy
for us to read the data directly without having to do calibrations of any sort for
temperature or humidity. HC SR-04, an ultrasonic sensor is used to measure the
distance of any person approaching. The modules involved in this operation
include ultra sonic transmitter, a receiver and the requisite control circuit. The
module automatically sends ultrasonic waves which, if there is an obstacle, get
reflected back from the obstacle and reach. DHT Temperature and Humidity
Sensor back to the receiver module of the sensor. If a signal is received back,
the time taken between the transmission and reception is calculated and the
distance is accordingly calculated from the speed of the waves and the time. The
HC SR-04 operates at a voltage of 5V and draws a current of 15mA. Its
minimum range is 2cm and maximum is 400cm. The MQ2 is a sensor we use to
detect the presence of combustible gas and smoke. This sensor uses a small
heater inside with an electrochemical sensor. It is sensitive to a range of gases
and is used indoors at room temperature. It is an analog sensor which outputs an
analog value which directly corresponds to a change in voltage according to the
amount of smoke those envelopes the sensor. Higher the amount of smoke,
higher will be the value which can be read from the smoke sensor, thus enabling
us to detect the presence of smoke by setting a safe threshold value. It has a
wide detecting scope, high sensitivity and fast response time. It is a simple
design sensor with a long life and stability.
The SSD1306 OLED Display module is a 128x64 single-chip CMOS
OLED Driver with controller for organic light emitting dot matrix graphic
display system. It consists of128 segments and 64 commons. It has a 256-step
brightness control and communication with any general MCU can be done
through Serial Peripheral Interface (SPI) or I2C (Inter-Integrated Circuit). It
operates at a voltage of 1.65-3.3V.
The Losant IOT Platform is one of the most popular and powerful cloud
platforms that help users effortlessly integrate their solutions with their cloud
services to store potentially massive amounts of raw data and process them to
make sense out of them. It supports communication from billions of devices and
uses the lightweight MQTT protocol for communication. It provides robust data
collection, aggregation and different ways to visualize our accumulated data in
an easily understandable way.

Block Diagram
Advantages
The hardware and software have been appropriately set up and the code
has been successfully uploaded onto the NodeMCU, we check the results.
Firstly the updating of events including connecting to Wi-Fi, Losant platform
and publishing the sensor data via MQTT can be seen on the Serial Monitor of
the Arduino IDE. It also shows the values of sensor readings obtained, and also
the course of action being taken when a connection has not been established
successfully. This helps us analyze how the application is working and allows
us to properly editor code so that we can further optimize it. Next we open the
Losant IoT Platform and navigate to Dashboards under the Application. On the
dashboard we can see all the sensor data coming from various sensors on one
platform. So it is easy for us to gather all this data into one place and visualize it
on a user-friendly interface. This integrating of devices with the Internet of
Things makes monitoring easy and more efficient, paving the path for
improvements and consequent large-scale implementation of the application.
MQTT is one of the most popular protocols for the Internet of Things
(IoT) systems – devices connected to the internet – and for mobile web apps.
This article explores why it works so well for smart buildings. In the smart
buildings industry, where most devices will be small, mobile and have relatively
low battery power, efficiency is vital. MQTT’s messages can be as small as
2mb and are capped at a maximum size of 256mb, meaning it uses less data and
therefore less energy than some protocols, helping to conserve battery life. The
small message sizes also make it perfect for instances where bandwidth is
constrained, another important consideration for IoT systems. Because MQTT
is so well suited to use in IoT it is one of the most commonly-used protocols
and is used by some of the biggest platforms such as IBM Watson IoT and
Microsoft Azure. This means devices that use MQTT are likely to easily sync
with your existing systems. MQTT is an open protocol which means multiple
devices from different manufacturers can talk to one another. This gives you
more flexibility in designing your smart building systems and makes it easier to
adopt across a wide variety of IoT devices and platforms. Closed protocols
require you to buy all your components from one specific manufacturer in order
for them to speak to one another. In an arena where real-time data is crucial,
you need a protocol that will get information to where it’s needed as quickly as
possible. There’s little point using a smart sensor to monitor the air quality in a
room if it’s likely to have changed by the time the data appears on your
software platform. If a protocol is the method used to get data from one place to
another then MQTT could be considered as the electric car of protocols –
lightweight, fast and energy efficient. Other protocols such as HTTP are more
like diesel-powered buses better at transporting larger volumes of data from
one place to another but guzzling more fuel in the process. In the IoT world,
where speed, efficiency and agility are key, it’s easy to see why MQTT is one
of the most popular protocols if you’re looking for smart-building technology
that uses MQTT, check out our smart gateway. It converts sensor data into
MQTT protocol and makes it securely available locally or via the cloud.

SYSTEM REQUIRMENTS
Hardware Requirements
• Node MCU

• Ultrasonic Sensor

• Temperature Sensor

• Gas Sensor

• LCD Display

• Power Supply
Software Requirements
• Arduino IDE
• SQLITE Database

• IOT Web Server

Hardware Requirements
Node MCU
The ESP8266 is a low-cost Wi-Fi microchip,with a full TCP/IP
tack and microcontroller capability, produced by Espressif Systems in
Shanghai, China.
ESP8266
The chip first came to the attention of Western makers in August 2014 with
the ESP-01 module, made by a third-party manufacturer Ai-Thinker. This small
module allows microcontrollers to connect to a Wi-Fi network and make simple
TCP/IP connections using Hayes-style commands. However, at first there was
almost no English-language documentation on the chip and the commands it
accepted. The very low price and the fact that there were very few external
components on the module, which suggested that it could eventually be very
inexpensive in volume, attracted many hackers to explore the module, the chip,
and the software on it, as well as to translate the Chinese documentation.
The ESP8285 is an ESP8266 with 1 MiB of built-in flash, allowing the building
of single-chip devices capable of connecting to Wi-Fi.
These microcontroller chips have been succeeded by the ESP32 family of
devices, including the pin-compatible ESP32-C3.
Features

 Processor: L106 32-bit RISC microprocessor core based on


the Tensilica Xtensa Diamond Standard 106Micro running at 80 MHz[5]
 Memory:
o 32 KiB instruction RAM
o 32 KiB instruction cache RAM
o 80 KiB user-data RAM
o 16 KiB ETS system-data RAM
 External QSPI flash: up to 16 MiB is supported (512 KiB to 4 MiB
typically included)
 IEEE 802.11 b/g/n Wi-Fi
o Integrated TR switch, balun, LNA, power amplifier and matching
network
o WEP or WPA/WPA2 authentication, or open networks
 16 GPIO pins
 SPI
 I²C (software implementation)[6]
 I²S interfaces with DMA (sharing pins with GPIO)
 UART on dedicated pins, plus a transmit-only UART can be enabled on
GPIO2
 10-bit ADC (successive approximation ADC)

Pinout of ESP-01
The pinout is as follows for the common ESP-01 module:
ESP-01

1. GND, Ground (0 V)
2. GPIO 2, General-purpose input/output No. 2
3. GPIO 0, General-purpose input/output No. 0
4. RX, Receive data bit X, also GPIO3
5. VCC, Voltage (+3.3 V; can handle up to 3.6 V)
6. RST, Reset
7. CH_PD, Chip power-down
8. TX, Transmit data bit X, also GPIO1
When power is applied to the module you should see the red power light turn on
and the blue serial indicator light flicker briefly.
With FTDI 3.3V Board (Legit)
If you have a 3.3V FTDI Serial to USB board you can get started without fear
of destroying your new ESP8266 Wi-Fi module. Do note that many FTDI
boards have a solder jumper to convert from 3.3V to 5V operation so ensure it is
set to enable 3.3V operation.
Serial Control
With the hardware connections in place you can communicate with the Wi-Fi
module through a serial terminal.
Using Arduino IDE Serial Monitor
If you already have the Arduino IDE installed the easiest way to get started is to
use the built-in Serial Monitor:
• Plug in the Wi-Fi module.
• Choose the correct serial port from the Tools > Serial Port menu.
• Open the Serial Monitor via the Tools menu or “magnifying glass” icon
on the editor window.
• For the default firmware version (00160901), ensure Carriage return is
selected in the line ending pop-up menu at the bottom of the serial monitor. (For
later versions it must be set to Both NL & CR)
• For the default firmware version, ensure the communication speed is set
to 115200 baud.
Using GNU Screen
It’s possible to use GNU Screen out of the box with the default version of the
firmware (00160901)
which expects Carriage-Return-only line endings, e.g. (on OS X): screen
/dev/tty.usbserial-AB12345 115200
Unfortunately the updated firmware versions require Carriage-Return-and-New-
Line line endings and
there appears to be no way to configure screen to send both with one key press.
Instead, you need to press <enter> or Ctrl-M then follow that with Ctrl-J.
You might have more success with something like minicom or picocom with
later firmware versions.
Acting as a Wi-Fi Access Point
In addition to connecting to Wi-Fi Access Points the module can also act as an
Access Point–this means you can connect devices to the module without any
other network infrastructure in place. Ideal for a local private shared “drop box”
perhaps…
1. The module comes with an access point pre-defined (SSID of “ESP_…”)
but you can define your own with:
AT+CWSAP="NoWorriESSID","password",3,0
The first parameter is the SSID name; the second parameter is the password; the
third the Wi-Fi channel–pick one not used in your area; and, the final parameter
is the encryption standard to use. An encryption value of 0 turns encryption off
which means the password is ignored–but it still can’t be an empty value. I
couldn’t get any encryption to work though (it would always create an
unencrypted network) you might have more luck–possibly with a more recent
firmware…
2. To actually enable the network to be created you need to set the “Wi-Fi
mode” of the module to “AP” (2) or “Both” (3):
AT+CWMODE=3
Now you will be able to connect to your module as an access point from another
device (e.g. a laptop or a phone).
3. You can list the IP address etc. of any device connected to the network
with:

Ultrasonic Sensor
Introduction
The HCSR04 ultrasonic sensor uses sonar to determine distance to an object
like bats or dolphins do. It offers excellent noncontact range detection with high
accuracy and stable readings in an easytouse package. From 2cm to 400 cm or
1” to 13 feet. It operation is not affected by sunlight or black material like Sharp
rangefinders are (although acoustically soft materials like cloth can be difficult
to detect). It comes complete with ultrasonic transmitter and receiver module.

Ultrasonic Sensor Pin Configuration


Pin Pin Description
Number Name
1 Vcc The Vcc pin powers the sensor, typically with +5V
2 Trigger Trigger pin is an Input pin. This pin has to be kept high for
10us to initialize measurement by sending US wave.
3 Echo Echo pin is an Output pin. This pin goes high for a period of
time which will be equal to the time taken for the US wave
to return back to the sensor.
4 Ground This pin is connected to the Ground of the system.
 
HC-SR04 Sensor Features
 Operating voltage: +5V
 Theoretical Measuring Distance: 2cm to 450cm
 Practical Measuring Distance: 2cm to 80cm
 Accuracy: 3mm
 Measuring angle covered: <15°
 Operating Current: <15mA
 Operating Frequency: 40Hz

Equivalent distance measuring Sensors


US transmitter Receiver pair, IR sensor module, IR sensor pair, IR Analog
distance sensor,

HC-SR04 Ultrasonic Sensor - Working

As shown above the HC-SR04 Ultrasonic (US) sensor is a 4 pin module, whose
pin names are Vcc, Trigger, Echo and Ground respectively. This sensor is a
very popular sensor used in many applications where measuring distance or
sensing objects are required. The module has two eyes like projects in the front
which forms the Ultrasonic transmitter and Receiver. The sensor works with the
simple high school formula that

Distance = Speed × Time

The Ultrasonic transmitter transmits an ultrasonic wave, this wave travels in air
and when it gets objected by any material it gets reflected back toward the
sensor this reflected wave is observed by the Ultrasonic receiver module as
shown in the picture below
Ultrasonic Sensor Working

Now, to calculate the distance using the above formulae, we should know the
Speed and time. Since we are using the Ultrasonic wave we know the universal
speed of US wave at room conditions which is 330m/s. The circuitry inbuilt on
the module will calculate the time taken for the US wave to come back and
turns on the echo pin high for that same particular amount of time, this way we
can also know the time taken. Now simply calculate the distance using a
microcontroller or microprocessor.

How to use the HC-SR04 Ultrasonic Sensor

HC-SR04 distance sensor is commonly used with both microcontroller and


microprocessor platforms like Arduino, ARM, PIC, Raspberry Pie etc. The
following guide is universally since it has to be followed irrespective of the type
of computational device used.

Power the Sensor using a regulated +5V through the Vcc ad Ground pins of
the sensor. The current consumed by the sensor is less than 15mA and hence
can be directly powered by the on board 5V pins (If available). The Trigger and
the Echo pins are both I/O pins and hence they can be connected to I/O pins of
the microcontroller. To start the measurement, the trigger pin has to be made
high for 10uS and then turned off. This action will trigger an ultrasonic wave at
frequency of 40Hz from the transmitter and the receiver will wait for the wave
to return. Once the wave is returned after it getting reflected by any object the
Echo pin goes high for a particular amount of time which will be equal to the
time taken for the wave to return back to the sensor.

The amount of time during which the Echo pin stays high is measured by the
MCU/MPU as it gives the information about the time taken for the wave to
return back to the Sensor. Using this information the distance is measured as
explained in the above heading.

Applications
Used to avoid and detect obstacles with robots like biped robot, obstacle avoider
robot, path finding robot etc.

Used to measure the distance within a wide range of 2cm to 400cm

Can be used to map the objects surrounding the sensor by rotating it

Depth of certain places like wells, pits etc can be measured since the waves can
penetrate through water

Temperature Sensor
INTRODUCTION
Humidity is the concentration of water vapor present in the air. Water vapor, the
gaseous state of water, is generally invisible to the human eye. Humidity
indicates the likelihood for precipitation, dew, or fog to be present. The amount
of water vapor needed to achieve saturation increases as the temperature
increases. As the temperature of a parcel of air decreases it will eventually reach
the saturation point without adding or losing water mass. The amount of water
vapor contained within a parcel of air can vary significantly. For example, a
parcel of air near saturation may contain 28 grams of water per cubic metre of
air at 30 °C, but only 8 grams of water per cubic metre of air at 8 °C.

Three primary measurements of humidity are widely employed: absolute,


relative and specific. Absolute humidity describes the water content of air and is
expressed in either grams per cubic metre or grams per kilogram. Relative
humidity, expressed as a percentage, indicates a present state of absolute
humidity relative to a maximum humidity given the same temperature. Specific
humidity is the ratio of water vapor mass to total moist air parcel mass.
DHT 22 HUMIDITY SENSOR

Humidity plays an important role for surface life. For animal life dependent on
perspiration (sweating) to regulate internal body temperature, high humidity
impairs heat exchange efficiency by reducing the rate of moisture evaporation
from skin surfaces. This effect can be calculated using a heat index table, also
known as a humidex.

DHT 22 HUMIDITY SENSOR:

The digital temperature and humidity sensor DHT11 is a composite sensor that
contains a calibrated digital signal output of temperature and humidity. The
technology of a dedicated digital modules collection and the temperature and
humidity sensing technology are applied to ensure that the product has high
reliability and excellent long-term stability.

The sensor includes a resistive sense of wet component and an NTC


temperature measurement device, and is connected with a high-performance 8-
bit microcontroller. The schematic diagram of the Humiture Sensor Module is
as shown following:
Absolute humidity:

Absolute humidity is the total mass of water vapor present in a given volume or
mass of air. It does not take temperature into consideration. Absolute humidity
in the atmosphere ranges from near zero to roughly 30 grams per cubic metre
when the air is saturated at 30 °C (86 °F).

Absolute humidity is the mass of the water vapor {\displaystyle


(m_{H_{2}O})}{\displaystyle (m_{H_{2}O})}, divided by the volume of the
air and water vapor mixture {\displaystyle (V_{net})}{\displaystyle
(V_{net})}, which can be expressed as:

{\displaystyle AH={\frac {m_{H_{2}O}}{V_{net}}}.}{\displaystyle


AH={\frac {m_{H_{2}O}}{V_{net}}}.}

The absolute humidity changes as air temperature or pressure changes, if the


volume is not fixed. This makes it unsuitable for chemical engineering
calculations, e.g. in drying, where temperature can vary considerably. As a
result, absolute humidity in chemical engineering may refer to mass of water
vapor per unit mass of dry air, also known as the humidity ratio or mass mixing
ratio (see "specific humidity" below), which is better suited for heat and mass
balance calculations. Mass of water per unit volume as in the equation above is
also defined as volumetric humidity. Because of the potential confusion, British
Standard BS 1339 suggests avoiding the term "absolute humidity". Units should
always be carefully checked. Many humidity charts are given in g/kg or kg/kg,
but any mass units may be used. The field concerned with the study of physical
and thermodynamic properties of gas–vapor mixtures is named psychrometrics.

Relative humidity
The relative humidity {\displaystyle (RH}{\displaystyle (RH} or
{\displaystyle \phi )}{\displaystyle \phi )} of an air-water mixture is defined as
the ratio of the partial pressure of water vapor {\displaystyle (p_{H_{2}O})}
{\displaystyle (p_{H_{2}O})} in the mixture to the equilibrium vapor pressure
of water {\displaystyle (p_{H_{2}O}^{*})}{\displaystyle (p_{H_{2}O}^{*})}
over a flat surface of pure water at a given temperature:

{\displaystyle \phi ={p_{H_{2}O} \over p_{H_{2}O}^{*}}}{\displaystyle \phi


={p_{H_{2}O} \over p_{H_{2}O}^{*}}}

Relative humidity is normally expressed as a percentage; a higher percentage


means that the air-water mixture is more humid.

Relative humidity is an important metric used in weather forecasts and reports,


as it is an indicator of the likelihood of precipitation, dew, or fog. In hot
summer weather, a rise in relative humidity increases the apparent temperature
to humans (and other animals) by hindering the evaporation of perspiration
from the skin. For example, according to the Heat Index, a relative humidity of
75% at air temperature of 80.0 °F (26.7 °C) would feel like 83.6 °F ±1.3 °F
(28.7 °C ±0.7 °C).

Specific humidity

Specific humidity (or moisture content) is the ratio of the mass of water vapor
to the total mass of the air parcel. Specific humidity is approximately equal to
the mixing ratio, which is defined as the ratio of the mass of water vapor in an
air parcel to the mass of dry air for the same parcel. As temperature decreases,
the amount of water vapor needed to reach saturation also decreases. As the
temperature of a parcel of air becomes lower it will eventually reach the point
of saturation without adding or losing water mass.

Gas Sensor
Electrochemical gas sensors are gas detectors that measure the
concentration of a target gas by oxidizing or reducing the target gas at an
electrode and measuring the resulting current.

GAS SENSORS

Construction

The sensors contain two or three electrodes, occasionally four, in


contact with an electrolyte. The electrodes are typically fabricated by fixing a
high surface area precious metal on to the porous hydrophobic membrane.
The working electrode contacts both the electrolyte and the ambient air to be
monitored usually via a porous membrane. The electrolyte most commonly
used is a mineral acid, but organic electrolytes are also used for some sensors.
The electrodes and housing are usually in a plastic housing which contains a
gas entry hole for the gas and electrical contacts.

THEORY OF OPERATION

The gas diffuses into the sensor, through the back of the porous
membrane to the working electrode where it is oxidized or reduced. This
electrochemical reaction results in an electric current that passes through the
external circuit. In addition to measuring, amplifying and performing other
signal processing functions, the external circuit maintains the voltage across
the sensor between the working and counter electrodes for a two electrode
sensor or between the working and reference electrodes for a three electrode
cell. At the counter electrode an equal and opposite reaction occurs, such that
if the working electrode is an oxidation, then the counter electrode is a
reduction.

Diffusion controlled response


The magnitude of the current is controlled by how much of the target
gas is oxidized at the working electrode. Sensors are usually designed so that
the gas supply is limited by diffusion and thus the output from the sensor is
linearly proportional to the gas concentration. This linear output is one of the
advantages of electrochemical sensors over other sensor technologies, (e.g.
infrared), whose output must be linearized before they can be used. A linear
output allows for more precise measurement of low concentrations and much
simpler calibration (only baseline and one point are needed).

Diffusion control offers another advantage. Changing the diffusion


barrier allows the sensor manufacturer to tailor the sensor to a particular target
gas concentration range. In addition, since the diffusion barrier is primarily
mechanical, the calibration of electrochemical sensors tends to be more stable
over time and so electrochemical sensor based instruments require much less
maintenance than some other detection technologies. In principle, the
sensitivity can be calculated based on the diffusion properties of the gas path
into the sensor, though experimental errors in the measurement of the
diffusion properties make the calculation less accurate than calibrating with
test gas.

Cross sensitivity

For some gases such as ethylene oxide, cross sensitivity can be a


problem because ethylene oxide requires a very active working electrode
catalyst and high operating potential for its oxidation. Therefore gases which
are more easily oxidized such as alcohols and carbon monoxide will also give
a response. Cross sensitivity problems can be eliminated though through the
use of a chemical filter, for example filters that allows the target gas to pass
through unimpeded, but which reacts with and removes common
interferences.

While electrochemical sensors offer many advantages, they are not


suitable for every gas. Since the detection mechanism involves the oxidation
or reduction of the gas, electrochemical sensors are usually only suitable for
gases which are electrochemically active, though it is possible to detect
electrochemically inert gases indirectly if the gas interacts with another
species in the sensor that then produces a response. Sensors for carbon
dioxide are an example of this approach and they have been commercially
available for several years.

CIRCUIT DIAGRAM

CIRCUIT DIAGRAM OF GAS SENSORS

CIRCUIT DESCRIPTION

The gas sensor is the special sensor which designed for sense the gas
leakage. In the gas sensor the supply voltage is given to input terminal. The
gas sensor output terminals are connected to non inverting input terminal of
the comparator.

Here the comparator is constructed with operational amplifier LM 358.


The reference voltage is given to inverting input terminal. The reference
voltage is depends on the desired gas intensity. When there is no leakage the
non inverting input is grater then inverting input so the output of the
comparator is positive voltage which is given to the base of the switching
transistor BC 547. Hence the transistor is conducting. Here the transistor is
act as switch so the collector and emitter will be closed. The output is taken
from collector terminal. Now the output is zero which is given to hex inverter
40106. When there is gas leakage the inverting input voltage is greater than
non inverting input. Now the comparator output is -12V so the transistor is
cutoff region. The 5v is given to hex inverter 40106 IC. Then the final output
data is directly given to microcontroller to determine the gas leakage.

LCD Display
LIQUID CRYSTAL DISPLAY(LCD)
A liquid-crystal display (LCD) is a flat panel display, electronic visual
display, or video display that uses the light modulating properties of liquid
crystals. Liquid crystals do not emit light directly.
LCDs are available to display arbitrary images (as in a general-purpose
computer display) or fixed images which can be displayed or hidden, such as
preset words, digits, and 7-segment displays as in a digital clock. They use the
same basic technology, except that arbitrary images are made up of a large
number of small pixels, while other displays have larger elements.
LCDs are used in a wide range of applications including computer
monitors, televisions, instrument panels, aircraft cockpit displays, and signage.
They are common in consumer devices such as DVD players, gaming
devices, clocks, watches, calculators, and telephones, and have replaced cathode
ray tube (CRT) displays in most applications. They are available in a wider
range of screen sizes than CRT and plasma displays, and since they do not use
phosphors, they do not suffer image burn-in. LCDs are, however, susceptible
to image persistence.
The LCD screen is more energy efficient and can be disposed of more
safely than a CRT. Its low electrical power consumption enables it to be used
in battery-powered electronic equipment. It is an electronically modulated
optical device made up of any number of segments filled with liquid
crystals and arrayed in front of a light source (backlight) or reflector to produce
images in color or monochrome. 

16×2 LCD is named so because; it has 16 Columns and 2 Rows. There are a lot
of combinations available like, 8×1, 8×2, 10×2, 16×1, etc. But the most used
one is the 16*2 LCD, hence we are using it here.
LCD Display

All the above mentioned LCD display will have 16 Pins and the programming
approach is also the same and hence the choice is left to you. Below is the
Pinout and Pin Description of 16x2 LCD Module:

Sr.
Pin No. Pin Name Pin Type Pin Description Pin Connection
No
Connected to the
This is a ground pin ground of the
1 Pin 1 Ground Source Pin
of LCD MCU/ Power
source
Connected to the
This is the supply
2 Pin 2 VCC Source Pin supply pin of
voltage pin of LCD
Power source
Connected to a
Adjusts the contrast
3 Pin 3 V0/VEE Control Pin variable POT that
of the LCD.
can source 0-5V
4 Pin 4 Register Control Pin Toggles between Connected to a
Select Command/Data MCU pin and gets
Register either 0 or 1.

0 -> Command
Mode

1-> Data Mode


Connected to a
MCU pin and gets
either 0 or 1.
Toggles the LCD
5 Pin 5 Read/Write Control Pin between Read/Write 0 -> Write
Operation Operation

1-> Read
Operation
Must be held high to Connected to
6 Pin 6 Enable Control Pin perform Read/Write MCU and always
Operation held high.
In 4-Wire Mode

Only 4 pins (0-3)


is connected to
Pins used to send
Pin 7- Data Bits (0- Data/Comman
7 Command or data to MCU
14 7) d Pin
the LCD. In 8-Wire Mode

All 8 pins(0-7) are


connected to MCU
Normal LED like
8 Pin 15 LED Positive LED Pin operation to Connected to +5V
illuminate the LCD
Normal LED like
operation to Connected to
9 Pin 16 LED Negative LED Pin
illuminate the LCD ground
connected with GND.

It is okay if you do not understand the function of all the pins, I will be
explaining in detail below. Now, let us turn back our LCD:

Okay, what is this two black circle like things on the back of our LCD?
These black circles consist of an interface IC and its associated components to
help us use this LCD with the MCU. Because our LCD is a 16*2 Dot matrix
LCD and so it will have (16*2=32) 32 characters in total and each character will
be made of 5*8 Pixel Dots.  A Single character with all its Pixels enabled is
shown in the below picture.

So Now, we know that each character has (5*8=40) 40 Pixels and for 32
Characters we will have (32*40) 1280 Pixels. Further, the LCD should also be
instructed about the Position of the Pixels.

It will be a hectic task to handle everything with the help of MCU, hence an
Interface IC like HD44780 is used, which is mounted on LCD Module itself.
The function of this IC is to get the Commands and Data from the MCU and
process them to display meaningful information onto our LCD Screen.

Let’s discuss the different type of mode and options available in our LCD that
has to be controlled by our Control Pins. 

4-bit and 8-bit Mode of LCD:

The LCD can work in two different modes, namely the 4-bit mode and the 8-bit
mode. In 4 bit mode we send the data nibble by nibble, first upper nibble and
then lower nibble. For those of you who don’t know what a nibble is: a nibble is
a group of four bits, so the lower four bits (D0-D3) of a byte form the lower
nibble while the upper four bits (D4-D7) of a byte form the higher nibble. This
enables us to send 8 bit data.

Whereas in 8 bit mode we can send the 8-bit data directly in one stroke since we
use all the 8 data lines.

Now you must have guessed it, Yes 8-bit mode is faster and flawless than 4-bit
mode. But the major drawback is that it needs 8 data lines connected to the
microcontroller. This will make us run out of I/O pins on our MCU, so 4-bit
mode is widely used. No control pins are used to set these modes. It's just the
way of programming that change. 

Read and Write Mode of LCD:


As said, the LCD itself consists of an Interface IC. The MCU can either read or
write to this interface IC. Most of the times we will be just writing to the IC,
since reading will make it more complex and such scenarios are very rare.
Information like position of cursor, status completion interrupts etc. can be read
if required, but it is out of the scope of this tutorial.

The Interface IC present in most of the LCD is HD44780U, in order to program


our LCD we should learn the complete datasheet of the IC. The datasheet is
given here.

 LCD Commands:

There are some preset commands instructions in LCD, which we need to send to
LCD through some microcontroller. Some important command instructions are
given below:

Hex Code Command to LCD Instruction Register


0F LCD ON, cursor ON
01 Clear display screen
02 Return home
04 Decrement cursor (shift cursor to left)
06 Increment cursor (shift cursor to right)
05 Shift display right
07 Shift display left
0E Display ON, cursor blinking
80 Force cursor to beginning of first line
C0 Force cursor to beginning of second line
38 2 lines and 5×7 matrix
83 Cursor line 1 position 3
3C Activate second line
08 Display OFF, cursor OFF
C1 Jump to second line, position 1
OC Display ON, cursor OFF
C1 Jump to second line, position 1
C2 Jump to second line, position 2

Power Supply
SMPS
A switched-mode power supply (switching-mode power supply, switch-mode
power supply, switched power supply, SMPS, or switcher) is an electronic
power supply that incorporates a switching regulator to convert electrical power
efficiently. Like other power supplies, an SMPS transfers power from a DC or
AC source (often mains power) to DC loads, such as a personal computer, while
converting voltage and current characteristics. Unlike a linear power supply, the
pass transistor of a switching-mode supply continually switches between low-
dissipation, full-on and full-off states, and spends very little time in the high
dissipation transitions, which minimizes wasted energy.. Voltage regulation is
achieved by varying the ratio of on-to-off time (also known as duty cycles). In
contrast, a linear power supply regulates the output voltage by continually
issipating power in the pass transistor.

Switching regulators are used as replacements for linear regulators when higher
efficiency, smaller size or lighter weight are required. They are, however, more
complicated; their switching currents can cause electrical noise problems if not
carefully suppressed, and simple designs may have a poor power factor.

Explanation:
A linear power supply (non-SMPS) uses a linear regulator to provide the desired
output voltage by dissipating excess power in ohmic losses (e.g., in a resistor or
in the collector–emitter region of a pass transistor in its active mode). A linear
regulator regulates either output voltage or current by dissipating the excess
electric power in the form of heat, and hence its maximum power efficiency is
voltage-out/voltage-in since the volt difference is wasted.

BLOCK DIAGRAM OF SMPS

In contrast, a SMPS changes output voltage and current by switching ideally


lossless storage elements, such as inductors and capacitors, between different
electrical configurations. Ideal switching elements (approximated by transistors
operated outside of their active mode) have no resistance when "on" and carry
no current when "off", and so converters with ideal components would operate
with 100% efficiency (i.e., all input power is delivered to the load; no power is
wasted as dissipated heat). In reality, these ideal components do not exist, so a
switching power supply cannot be 100% efficient, but it is still a significant
improvement in efficiency over a linear regulator.

For example, if a DC source, an inductor, a switch, and the corresponding


electrical ground are placed in series and the switch is driven by a square wave,
the peak-to-peak voltage of the waveform measured across the switch can
exceed the input voltage from the DC source. This is because the inductor
responds to changes in current by inducing its own voltage to counter the
change in current, and this voltage adds to the source voltage while the switch is
open. If a diode-and-capacitor combination is placed in parallel to the switch,
the peak voltage can be stored in the capacitor, and the capacitor can be used as
a DC source with an output voltage greater than the DC voltage driving the
circuit.
This boost converter acts like a step-up transformer for DC signals. A buck–
boost converter works in a similar manner, but yields an output voltage which is
opposite in polarity to the input voltage. Other buck circuits exist to boost the
average output current with a reduction of voltage.

In a SMPS, the output current flow depends on the input power signal, the
storage elements and circuit topologies used, and also on the pattern used (e.g.,
pulse-width modulation with an adjustable duty cycle) to drive the switching
elements. The spectral density of these switching waveforms has energy
concentrated at relatively high frequencies. As such, switching transients and
ripple introduced onto the output waveforms can be filtered with a small LC
filter.

Advantages and disadvantages


The main advantage of the switching power supply is greater efficiency (up to
96%) than linear regulators because the switching transistor dissipates little
power when acting as a switch.

Other advantages include smaller size, lower noise, and lighter weight from the
elimination of heavy line-frequency transformers, and comparable heat
generation. Standby power loss is often much less than transformers.

The transformer in a switching power supply is also smaller than a traditional


line frequency (50 Hz or 60 Hz depending on region) transformer, and therefore
requires smaller amounts of expensive raw materials, like copper.

Disadvantages include greater complexity, the generation of high-amplitude,


high-frequency energy that the low-pass filter must block to avoid
electromagnetic interference (EMI), a ripple voltage at the switching frequency
and the harmonic frequencies thereof.

Very low cost SMPSs may couple electrical switching noise back onto the
mains power line, causing interference with devices connected to the same
phase, such as A/V equipment.

Non-power-factor-corrected SMPSs also cause harmonic distortion.


Software Requirements
Arduino IDE
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.

Arduino IDE
Writing Sketches
Programs written using Arduino Software (IDE) are called sketches. These
sketches are written in the text editor and are saved with the file extension .ino.
The editor has features for cutting/pasting and for searching/replacing text. The
message area gives feedback while saving and exporting and also displays
errors. The console displays text output by the Arduino Software (IDE),
including complete error messages and other information. The bottom right-
hand corner of the window displays the configured board and serial port. The
toolbar buttons allow you to verify and upload programs, create, open, and save
sketches, and open the serial monitor.

NB: Versions of the Arduino Software (IDE) prior to 1.0 saved sketches with
the extension .pde. It is possible to open these files with version 1.0, you will be
prompted to save the sketch with the .ino extension on save.

Verify

Checks your code for errors compiling it.

Upload

Compiles your code and uploads it to the configured board.


See uploading below for details.

Note: If you are using an external programmer with your board, you can
hold down the "shift" key on your computer when using this icon. The
text will change to "Upload using Programmer"

New
Creates a new sketch.

Open

Presents a menu of all the sketches in your sketchbook. Clicking one will
open it within the current window overwriting its content.

Note: due to a bug in Java, this menu doesn't scroll; if you need to open a
sketch late in the list, use the File | Sketchbook menu instead.

Save
Saves your sketch.

Serial Monitor
Opens the serial monitor.
Additional commands are found within the five menus:
File, Edit, Sketch, Tools, Help. The menus are context sensitive, which means
only those items relevant to the work currently being carried out are available.

File
• New

Creates a new instance of the editor, with the bare minimum structure of a
sketch already in place.

• Open

Allows to load a sketch file browsing through the computer drives and folders.

• Open Recent

Provides a short list of the most recent sketches, ready to be opened.

• Sketchbook

Shows the current sketches within the sketchbook folder structure; clicking on
any name opens the corresponding sketch in a new editor instance.

• Examples

Any example provided by the Arduino Software (IDE) or library shows up in


this menu item. All the examples are structured in a tree that allows easy access
by topic or library.

• Close

Closes the instance of the Arduino Software from which it is clicked.

• Save

Saves the sketch with the current name. If the file hasn't been named before, a
name will be provided in a "Save as” window.

• Save as...

Allows to save the current sketch with a different name.

• Page Setup

It shows the Page Setup window for printing.


• Print

Sends the current sketch to the printer according to the settings defined in Page
Setup.

• Preferences

Opens the Preferences window where some settings of the IDE may be
customized, as the language of the IDE interface.

• Quit

Closes all IDE windows. The same sketches open when Quit was chosen will be
automatically reopened the next time you start the IDE.

Edit
• Undo/Redo

Goes back of one or more steps you did while editing; when you go back, you
may go forward with Redo.

• Cut

Removes the selected text from the editor and places it into the clipboard.

• Copy

Duplicates the selected text in the editor and places it into the clipboard.

• Copy for Forum

Copies the code of your sketch to the clipboard in a form suitable for posting to
the forum, complete with syntax coloring.

• Copy as HTML

Copies the code of your sketch to the clipboard as HTML, suitable for
embedding in web pages.

• Paste

Puts the contents of the clipboard at the cursor position, in the editor.

• Select All
Selects and highlights the whole content of the editor.

• Comment/Uncomment

Puts or removes the // comment marker at the beginning of each selected line.

• Increase/Decrease Indent

Adds or subtracts a space at the beginning of each selected line, moving the text
one space on the right or eliminating a space at the beginning.

• Find

Opens the Find and Replace window where you can specify text to search inside
the current sketch according to several options.

• Find Next

Highlights the next occurrence - if any - of the string specified as the search
item in the Find window, relative to the cursor position.

• Find Previous

Highlights the previous occurrence - if any - of the string specified as the search
item in the Find window relative to the cursor position.

Sketch
• Verify/Compile

Checks your sketch for errors compiling it; it will report memory usage for code
and variables in the console area.

• Upload

Compiles and loads the binary file onto the configured board through the
configured Port.

• Upload Using Programmer

This will overwrite the bootloader on the board; you will need to use Tools >
Burn Bootloader to restore it and be able to Upload to USB serial port again.
However, it allows you to use the full capacity of the Flash memory for your
sketch. Please note that this command will NOT burn the fuses. To do so a
Tools -> Burn

Bootloader command must be executed.

• Export Compiled Binary

Saves a .hex file that may be kept as archive or sent to the board using other
tools.

• Show Sketch Folder

Opens the current sketch folder.

• Include Library

Adds a library to your sketch by inserting #include statements at the start of


your code. For more details, see libraries below. Additionally, from this menu
item you can access the Library Manager and import new libraries from .zip
files.

• Add File...

Adds a source file to the sketch (it will be copied from its current location). The
new file appears in a new tab in the sketch window. Files can be removed from
the sketch using the tab menu accessible clicking on the small triangle icon
below the serial monitor one on the right side of the toolbar.

Tools

• Auto Format

This formats your code nicely: i.e. indents it so that opening and closing curly
braces line up, and that the statements inside curly braces are indented more.

• Archive Sketch

Archives a copy of the current sketch in .zip format. The archive is placed in the
same directory as the sketch.
• Fix Encoding & Reload

Fixes possible discrepancies between the editor char map encoding and other
operating systems char maps.

• Serial Monitor

Opens the serial monitor window and initiates the exchange of data with any

connected board on the currently selected Port. This usually resets the board, if
the board supports Reset over serial port opening.

• Board

Select the board that you're using. See below for descriptions of the various
boards.

• Port

This menu contains all the serial devices (real or virtual) on your machine. It
should automatically refresh every time you open the top-level tools menu.

• Programmer

For selecting a hardware programmer when programming a board or chip and


not using the on-board USB-serial connection. Normally you won't need this,
but if you're burning a bootloader to a new microcontroller, you will use this.

• Burn Bootloader

The items in this menu allow you to burn a bootloader onto the microcontroller
on an Arduino board. This is not required for normal use of an Arduino or
Genuino board but is useful if you purchase a new ATmega microcontroller
(which normally come without a bootloader). Ensure that you've selected the
correct board from

the Boards menu before burning the bootloader on the target board. This
command also set the right fuses.

Help

Here you find easy access to a number of documents that come with the
Arduino Software (IDE). You have access to Getting Started, Reference, this
guide to the IDE and other documents locally, without an internet connection.
The documents are a local copy of the online ones and may link back to our
online website.

• Find in Reference

This is the only interactive function of the Help menu: it directly selects the
relevant page in the local copy of the Reference for the function or command
under the cursor Sketchbook

The Arduino Software (IDE) uses the concept of a sketchbook: a standard place
to store your programs (or sketches). The sketches in your sketchbook can be
opened from the File > Sketchbook menu or from the Open button on the
toolbar. The first time you run the Arduino software, it will automatically create
a directory for your sketchbook. You can view or change the location of the
sketchbook location from with the Preferences dialog.

Beginning with version 1.0, files are saved with a .ino file extension. Previous
versions use the .pde extension. You may still open .pde named files in version
1.0 and later, the software will automatically rename the extension to .ino. Tabs,
Multiple Files, and Compilation

Allows you to manage sketches with more than one file (each of which appears
in its own tab). These can be normal Arduino code files (no visible extension),
C files (.c extension), C++ files (.cpp), or header files (.h).

Uploading
Before uploading your sketch, you need to select the correct items from the
Tools > Board and Tools > Port menus. The boards are described below. On the
Mac, the serial port is probably something like /dev/tty.usbmodem241 (for a
Uno or Mega2560 or Leonardo) or /dev/tty.usbserial-1B1 (for a Duemilanove or
earlier USB board), or/dev/tty.USA19QW1b1P1.1 (for a serial board connected
with a Key span USB-to-Serial adapter). On Windows, it's probably COM1 or
COM2 (for a serial board) or COM4, COM5, COM7, or higher (for a USB
board) - to find out, you look for USB serial device in the ports section of the
Windows Device Manager. On Linux, it should be /dev/ttyACMx,
/dev/ttyUSBx or similar. Once you've selected the correct serial port and board,
press the upload button in the toolbar or select the Upload item from the
File menu. Current Arduino boards will reset automatically and begin the
upload. With older boards (pre-Decimal) that lack auto-reset, you'll need to
press the reset button on the board just before starting the upload. On most
boards, you'll see the RX and TX LEDs blink as the sketch is uploaded. The
Arduino Software (IDE) will display a message when the upload is complete, or
show an error.

When you upload a sketch, you're using the Arduino bootloader, a small
program that has been loaded on to the microcontroller on your board. It allows
you to upload code without using any additional hardware. The bootloader is
active for a few seconds when the board resets; then it starts whichever sketch
was most recently uploaded to the microcontroller. The bootloader will blink
the on-board (pin 13) LED when it starts (i.e. when the board resets).

Libraries

Libraries provide extra functionality for use in sketches, e.g. working with
hardware or manipulating data. To use a library in a sketch, select it from the
Sketch

Import Library menu. This will insert one or more #include statements at the top
of the sketch and compile the library with your sketch. Because libraries are
uploaded to the board with your sketch, they increase the amount of space it
takes up. If a sketch no longer needs a library, simply delete its #include
statements from the top of your code.

There is a list of libraries in the reference. Some libraries are included with the
Arduino software. Others can be downloaded from a variety of sources or
through the Library Manager. Starting with version 1.0.5 of the IDE, you do can
import a library from a zip file and use it in an open sketch. See these
instructions for installing a third-party library.

Third-Party Hardware

Support for third-party hardware can be added to the hardware directory of your
sketchbook directory. Platforms installed there may include board definitions
(which appear in the board menu), core libraries, bootloaders, and programmer
definitions. To install, create the hardware directory, then unzip the third-party
platform into its own sub-directory. (Don't use "arduino" as the sub-directory
name or you'll override the built-in Arduino platform.) To uninstall, simply
delete its directory.
Serial Monitor

Displays serial data being sent from the Arduino or Genuino board (USB or
serial board). To send data to the board, enter text and click on the "send" button
or press enter. Choose the baud rate from the drop-down that matches the rate
passed to Serial. Begin in your sketch. Note that on Windows, Mac or Linux,
the Arduino or Genuino board will reset (rerun your sketch execution to the
beginning) when you connect with the serial monitor.

Preferences

Some preferences can be set in the preferences dialog (found under the
Arduino menu on the Mac, or File on Windows and Linux). The rest can be
found in the preferences file, whose location is shown in the preference dialog.

Language Support
Since version 1.0.1, the Arduino Software (IDE) has been translated into 30+
different languages. By default, the IDE loads in the language selected by your
operating system. (Note: on Windows and possibly Linux, this is determined by
the locale setting which controls currency and date formats, not by the language
the operating system is displayed in.)

If you would like to change the language manually, start the Arduino Software
(IDE) and open the Preferences window. Next to the Editor Language there is a
dropdown menu of currently supported languages. Select your preferred
language

from the menu, and restart the software to use the selected language. If your
operating system language is not supported, the Arduino Software (IDE) will
default to English.

You can return the software to its default setting of selecting its language based
on your operating system by selecting System Default from the Editor
Language drop-down. This setting will take effect when you restart the Arduino
Software (IDE). Similarly, after changing your operating system's settings, you
must restart the Arduino Software (IDE) to update it to the new default
language.

Boards
The board selection has two effects: it sets the parameters (e.g. CPU speed and
baud rate) used when compiling and uploading sketches; and sets and the file
and fuse settings used by the burn bootloader command. Some of the board
definitions differ only in the latter, so even if you've been uploading
successfully with a particular selection you'll want to check it before burning the
bootloader. You can find a comparison table between the various boards here.

Arduino Software (IDE) includes the built in support for the boards in the
following list, all based on the AVR Core. The Boards Manager included in the
standard installation allows to add support for the growing number of new
boards based on different cores like Arduino Due, Arduino Zero, Edison, and
Galileo and soon.

SQLITE Database
SQLite is a relational database management system (RDBMS) contained
in a C library. In contrast to many other database management systems, SQLite
is not a client–server database engine. Rather, it is embedded into the end
program.

SQLite is ACID-compliant and implements most of the SQL standard, generally


following PostgreSQL syntax. However, SQLite uses a dynamically and weakly
typed SQL syntax that does not guarantee the domain integrity.

This means that one can, for example, insert a string into a column defined as an
integer. SQLite will attempt to convert data between formats where appropriate,
the string "123" into an integer in this case, but does not guarantee such
conversions and will store the data as-is if such a conversion is not possible.

SQLite is a popular choice as embedded database software for local/client


storage in application software such as web browsers. It is arguably the most
widely deployed database engine, as it is used today by several widespread
browsers, operating systems, and embedded systems (such as mobile phones),
among others. SQLite has bindings to many programming languages.

DESIGN

Unlike client–server database management systems, the SQLite engine has no


standalone processes with which the application program communicates.
Instead, the SQLite library is linked in and thus becomes an integral part of the
application program. Linking may be static or dynamic. The application
program uses SQLite's functionality through simple function calls, which reduce
latency in database access: function calls within a single process are more
efficient than inter-process communication.

SQLite stores the entire database (definitions, tables, indices, and the data itself)
as a single cross-platform file on a host machine. It implements this simple
design by locking the entire database file during writing. SQLite read operations
can be multitasked, though writes can only be performed sequentially.

Due to the server-less design, SQLite applications require less configuration


than client–server databases. SQLite is called zero-conF because it does not
require service management (such as startup scripts) or access control based on
GRANT and passwords. Access control is handled by means of file-system
permissions given to the database file itself. Databases in client–server systems
use file-system permissions that give access to the database files only to the
daemon process.
Another implication of the serverless design is that several processes may not be
able to write to the database file. In server-based databases, several writers will
all connect to the same daemon, which is able to handle its locks internally.
SQLite, on the other hand, has to rely on file-system locks. It has less
knowledge of the other processes that are accessing the database at the same
time. Therefore, SQLite is not the preferred choice for write-intensive
deployments. However, for simple queries with little concurrency, SQLite
performance profits from avoiding the overhead of passing its data to another
process.

SQLite uses PostgreSQL as a reference platform. "What would PostgreSQL do"


is used to make sense of the SQL standard. One major deviation is that, with the
exception of primary keys, SQLite does not enforce type checking; the type of a
value is dynamic and not strictly constrained by the schema (although the
schema will trigger a conversion when storing, if such a conversion is
potentially reversible). SQLite strives to follow Postel's rule.

IOT WEB SERVER

In computing, a server is a piece of computer hardware or software (computer


program) that provides functionality for other programs or devices, called
"clients". This architecture is called the client–server model. Servers can
provide various functionalities, often called "services", such as sharing data or
resources among multiple clients, or performing computation for a client. A
single server can serve multiple clients, and a single client can use multiple
servers. A client process may run on the same device or may connect over a
network to a server on a different device. Typical servers are database servers,
file servers, mail servers, print servers, web servers, game servers, and
application servers.

Client–server systems are today most frequently implemented by (and often


identified with) the request–response model: a client sends a request to the
server, which performs some action and sends a response back to the client,
typically with a result or acknowledgment. Designating a computer as "server-
class hardware"

implies that it is specialized for running servers on it. This often implies that it
is more powerful and reliable than standard personal computers, but
alternatively, large computing clusters may be composed of many relatively
simple, replaceable server components.

CLIENT –SERVER MODEL

OPRATION

Strictly speaking, the term server refers to a computer program or process


(running program). Through metonymy, it refers to a device used for (or a
device dedicated to) running one or several server programs. On a network,
such a device is called a host. In addition to server, the words serve and service
(as noun and as verb) are frequently used, though servicer and servant are not.
The word service (noun) may refer to either the abstract form of functionality,
e.g. Web service. Alternatively, it may refer to a computer program that turns a
computer into a server, e.g. Windows service.

Originally used as "servers serve users" (and "users use servers"), in the sense
of "obey", today one often says that "servers serve data", in the same sense as
"give". For instance, web servers "serve [up] web pages to users" or "service
their requests".
The server is part of the client–server model; in this model, a server serves data
for clients. The nature of communication between a client and server is request
and response. This is in contrast with peer-to-peer model in which the
relationship is on-demand reciprocation. In principle, any computerized process
that can be used or called by another process (particularly remotely, particularly
to share a resource) is a server, and the calling process or processes is a client.
Thus any general-purpose computer connected to a network can host servers.
For example, if files on a device are shared by some process, that process is a
file server. Similarly, web server software can run on any capable computer,
and so a laptop or a personal computer can host a web server.

While request–response is the most common client-server design, there are


others, such as the publish–subscribe pattern. In the publish-subscribe pattern,
clients register with a pub-sub server, subscribing to specified types of
messages; this initial registration may be done by request-response. Thereafter,
the pub-sub server forwards matching messages to the clients without any
further requests: the server pushes messages to the client, rather than the client
pulling messages from the server as in request-response.

MQTT

MQTT (MQ Telemetry Transport [failed verification] or Message Queuing


Telemetry Transport) is an open OASIS and ISO standard (ISO/IEC 20922)
lightweight, publish-subscribe network protocol that transports messages
between devices. The protocol usually runs over TCP/IP; however, any network
protocol that

provides ordered, lossless, bi-directional connections can support MQTT. It is


designed for connections with remote locations where a "small code footprint"
is required or the network bandwidth is limited.

The MQTT protocol defines two types of network entities: a message broker
and a number of clients. An MQTT broker is a server that receives all messages
from the clients and then routes the messages to the appropriate destination
clients. An MQTT client is any device (from a micro controller up to a full-
fledged server) that runs an MQTT library and connects to an MQTT broker
over a network.
MQTT connection

Information is organized in a hierarchy of topics. When a publisher has a new


item of data to distribute, it sends a control message with the data to the
connected broker. The broker then distributes the information to any clients that
have subscribed to that topic. The publisher does not need to have any data on
the number or locations of subscribers, and subscribers, in turn, do not have to
be configured with any data about the publishers.

If a broker receives a message on a topic for which there are no current


subscribers, the broker discards the message unless the publisher of the message
designated the message as a retained message. A retained message is a normal
MQTT message with the retained flag set to true. The broker stores the last
retained message and the corresponding QoS for the selected topic. Each client
that subscribes to a topic pattern that matches the topic of the retained message
receives the retained message immediately after they subscribe. The broker
stores only one retained message per topic. This allows new subscribers to a
topic to receive the most current value rather than waiting for the next update
from a publisher.

When a publishing client first connects to the broker, it can set up a default
message to be sent to subscribers if the broker detects that the publishing client
has unexpectedly disconnected from the broker.

Clients only interact with a broker, but a system may contain several broker
servers that exchange data based on their current subscribers' topics.

A minimal MQTT control message can be as little as two bytes of data. A


control message can carry nearly 256 megabytes of data if needed. There are
fourteen defined message types used to connect and disconnect a client from a
broker, to publish data, to acknowledge receipt of data, and to supervise the
connection between client and server.

MQTT relies on the TCP protocol for data transmission. A variant, MQTT-SN,
is used over other transports such as UDP or Bluetooth.

MQTT sends connection credentials in plain text format and does not include
any measures for security or authentication. This can be provided by using TLS
to encrypt and protect the transferred information against interception,
modification or forgery.

The default unencrypted MQTT port is 1883. The encrypted port is 8883.

HTTP SERVER
The Hypertext Transfer Protocol (HTTP) is an application layer protocol for
distributed, collaborative, hypermedia information systems. HTTP is the
foundation of data communication for the World Wide Web, where hypertext
documents include hyperlinks to other resources that the user can easily access,
for example by a mouse click or by tapping the screen in a web browser.

Development of HTTP was initiated by Tim Berners-Lee at CERN in 1989.


Development of early HTTP Requests for Comments (RFCs) was a coordinated
effort by the Internet Engineering Task Force (IETF) and the World Wide Web
Consortium (W3C), with work later moving to the IETF.
HTTP/1.1 was first documented in RFC 2068 in 1997. That specification was
obsoleted by RFC 2616 in 1999, which was likewise replaced by the RFC 7230
family of RFCs in 2014.

HTTP/2 is a more efficient expression of HTTP's semantics "on the wire", and
was published in 2015; it is now supported by virtually all web browsers and
major web servers over Transport Layer Security (TLS) using an Application-
Layer Protocol Negotiation (ALPN) extension where TLS 1.2 or newer is
required.

HTTP/3 is the proposed successor to HTTP/2, which is already in use on the


web, using UDP instead of TCP for the underlying transport protocol. Like
HTTP/2, it does not obsolete previous major versions of the protocol. Support
for HTTP/3 was added to Cloudflare and Google Chrome in September 2019,
and can be enabled in the stable versions of Chrome and Firefox.

A web server is server software, or hardware dedicated to running this software,


that can satisfy client requests on the World Wide Web. A web server can, in
general, contain one or more websites. A web server processes incoming
network requests over HTTP and several other related protocols.

The primary function of a web server is to store, process and deliver web pages
to clients. The communication between client and server takes place using the
Hypertext Transfer Protocol (HTTP). Pages delivered are most frequently
HTML documents, which may include images, style sheets and scripts in
addition to the text content.

Multiple web servers may be used for a high traffic website; here, Dell servers
are installed together being used for the Wikimedia Foundation.

A user agent, commonly a web browser or web crawler, initiates


communication by making a request for a specific resource using HTTP and the
server responds with the content of that resource or an error message if unable
to do so. The resource is typically a real file on the server's secondary storage,
but this is not necessarily the case and depends on how the web server is
implemented.

While the major function is to serve content, a full implementation of HTTP


also includes ways of receiving content from clients. This feature is used for
submitting web forms, including uploading of files.
Many generic web servers also support server-side scripting using Active Server
Pages (ASP), PHP (Hypertext Preprocessor), or other scripting languages. This
means that the behaviour of the web server can be scripted in separate files,
while the actual server software remains unchanged. Usually, this function is
used to generate HTML documents dynamically ("on-the-fly") as opposed to
returning static documents.

The former is primarily used for retrieving or modifying information from


databases. The latter is typically much faster and more easily cached but cannot
deliver dynamic content.

Web servers can frequently be found embedded in devices such as printers,


routers, webcams and serving only a local network. The web server may then be
used as a part of a system for monitoring or administering the device in
question.

This usually means that no additional software has to be installed on the client
computer since only a web browser is required (which now is included with
most operating systems).

Literature review

A Lost Cost Smart Irrigation System using MQTT Protocol:


The Indian economy is also greatly affected by agricultural, as about 50
percent of total population is directly or indirectly depend on the agricultural
related activities. A farmer has to go to the farm to check the water level in the
field and to turn on and turn off the water pump, sometimes even in the middle
of the night. A Message Queue Telemetry Transport protocol is used for
transmitting and receiving sensor information. Depending on a status of soil
moisture content NodeMCU-12E controls a water pump action and displays the
soil moisture sensor data and water pump status on a web page or mobile
application. In this way, a secure, flexible, trust-able and economical system is
developed to solve above mentioned agricultural irrigation problem.

IoT Based Weather Station:


A weather station can be described as an instrument or device, which
provides us with the information of the weather in our neighbouring
environment. For example it can provide us with details about the surrounding
temperature, barometric pressure, humidity, etc. Hence, this device basically
senses the temperature, pressure, humidity, light intensity, rain value. There are
various types of sensors present in the prototype, using which all the
aforementioned parameters can be measured. It can be used to monitor the
temperature or humidity of a particular room/place. With the help of
temperature and humidity we can calculate other data parameters, such as the
dew point. In addition to the above mentioned functionalities, we can monitor
the light intensity of the place as well. We have also enabled to monitor the
atmospheric pressure of the room. We can also monitor the rain value. The
brain of the prototype is the ESP8266 based Wi-Fi module NodeMCU (12E).
Four sensors are connected to the NodeMCU namely temperature and humidity
sensor (DHT11), pressure sensor (BMP180), raindrop module, and light
dependent resistor (LDR). Whenever these values exceed a chosen threshold
limit for each an SMS, an E-mail and a Tweet post is published alerting the
owner of the appliance to take necessary measures.

IoT based soil moisture monitoring on Losant platform:


The Internet of Things (IoT) is converting the agriculture industry and
solving the immense problems or the major challenges faced by the farmers
today’s in the field. India is one of the 13th countries in the world having
scarcity of water resources. Due to ever increasing of world population, we are
facing difficulties in the shortage of water resources, limited availability of land,
difficult to manage the costs while meeting the demands of increasing
consumption needs of a global population that is expected to grow by 70% by
the year 2050. The influence of population growth on agriculture leads to a
miserable impact on the farmer’s livelihood. To overcome the problems we
design a low cost system for monitoring the agriculture farm which
continuously measure the level of soil moisture of the plants and alert the
farmers if the moisture content of particular plants is low via sms or an email.
This system uses an esp8266 microcontroller and a moisture sensor using
Losant platform. Losant is a simple and most powerful IoT cloud platform for
the development of coming generation. It offers the real time data visualization
of sensors data which can be operate from any part of the world irrespective of
the position of field.

A low cost implementation of MQTT using ESP8266:


Technology is great growling engine of the change and Internet of Things
(IoT) is the backbone of such revolutionary engines. Basically, in the real world
the things having sensor capability, sufficient power supply and connectivity to
internet makes field like Internet of Things (IoT) possible. For such rapid
growing technology, it is the necessity to have very light, inexpensive and
minimum bandwidth protocol like Message Queuing Telemetry Transport
(MQTT) Protocol. Because of such non-established protocol it is easy for the
clients to publish or/and subscribe the desire topic through the host acting as
server of the network also known to be the broker. Communication between the
low power ESP8266 WiFi as client with the clients on smart phones and laptop
using an MQTT protocol becomes easier and more reliable. The WiFi enabled
ESP8266 board interfaces with DHT11 sensor and LDR sensor to monitor the
ambient condition and according to the light intensity level the brightness level
of 8*8 Neopixel matrixes is controlled. The adafruit.io is the MQTT server i.e.,
broker which also provides the facility of monitoring system through the
dashboard. The clients on Smartphone and laptop subscribe to the topics of
temperature, humidity and light intensity level gets the respective update. The
main objective of the paper is to implement the idea for the smart home
appliance, street light system for the smart cities, fire alert systems, whether
monitoring system and so.

A Review on Safe Human-Robot Collaboration in Industrial


Environments:
After many years of rigid conventional procedures of production,
industrial manufacturing is going through a process of change toward flexible
and intelligent manufacturing. Human-robot collaboration has an important role
in smart factories since it contributes to the achievement of higher productivity
and greater efficiency. However, this evolution means breaking with the
established safety procedures as the separation of workspaces between robot
and human is removed. These changes are reflected in safety standards related
to industrial robotics since the last decade, and have led to the development of a
wide field of research focusing on the prevention of human-robot impacts
and/or the minimization of related risks or their consequences. The main safety
systems that have been proposed and applied in industrial robotic environments
that contribute to the achievement of safe collaborative human-robot work.
Additionally, a review is provided of the current regulations along with new
concepts that have been introduced in them. Then multidisciplinary approaches,
such as techniques for estimation and the evaluation of injuries in human-robot
collisions, mechanical and software devices designed to minimize the
consequences of human-robot impact, impact detection systems, and strategies
to prevent collisions or minimize their consequences when they occur.

An MQTT-Based Context-Aware Wearable Assessment Platform for


Smart Watches:

Smart watches offer a unique opportunity to enact ubiquitous learning


scenarios. The various built-in sensors in these watches provide contextual
information that can be directly incorporated into ubiquitous learning designs.
The design and implementation of a wearable assessment platform based on the
Samsung Gear S2 Smart Watch. Implemented using the IoT MQTT protocol,
this platform allows the system to automatically subscribe to and publish
questions to students based on their current context. For example, students will
get notified on their smart watch with a question related to their location or
situation derived from the smart watch sensor data. The system uses. The
PONTE MQTT server and is integrated with Google's Classroom.

Low cost ambient monitoring using ESP8266:

A different language is different vision of life. Micro python is the open


source scripting language and an interpreter that expresses the concepts in fewer
lines of codes. This high level language possesses clear and expressive codes
which are designed to respond to the actions. It is a lean and efficient
implementation of python 3 programming language that comes with the quick
language feedback and is optimized for interactive input to run on
microcontroller or embedded systems. This functional and dynamic
programming language is ported to ESP8266 board. The DHT11 sensor is
interfaced with ESP8266 board to sense the ambient conditions like temperature
and humidity. The DHT module which is confined to DHT sensor is being
imported to perform its programming task. The OLED display used here have
dimensions of 128×64, it has an I2C interface and can be driven by SSD1306
driver. Firstly, the library for the SSD1306 driver of the chip needs to be
imported. The ESP8266 board have two connections, one with the DHT11
sensor to sense the temperature and humidity, and the second with OLED
display to show the collected information of temperature and humidity from
DHT11 sensor on to the screen. These all are implemented using lean and
efficient Micro python language and thus it is easy to control hardware and
connected devices using Micro python.
A MQTT Protocol Message Push Server Based on Rocket MQ:

With the rapid development of the Internet, especially in recent years, the
development of mobile Internet is increasingly rapid. Message push, which is an
important way for mobile client to publish information and make
communication, plays a significant role in mobile Internet. MQTT protocol is
one of the implementation technologies of message push in Android system
with low power consumption and high scalability. In addition, it can save
internet traffic, so it has been used in many applications. Meanwhile, as a
distributed message queue, Rocket MQ has great advantages in distributed
deployment of servers. It has the characteristics of high performance, high
reliability and high real time ability. The MQTT protocol and the application of
Rocket MQ, and implements a MQTT protocol message push server based on
Rocket MQ through the combination of Rocket MQ and Mosquito.

Infusion monitoring using WiFi (802.11) through MQTT protocol:

Infusion is part of treatment to get drugs or vitamins into body. This is


efficient way to accelerate treatment because it faster while absorbed in body
and can avoid impact on digestion. If the dosage given does not match or fluids
into the body getting too much, it causing disruption to the patient's health. The
main objective of this paper is to provide information on the speed and volume
of the infusion that being used by each patient using a photodiode sensor and
node.js server can distinguish each incoming data by utilizing topic features on
MQTT. Topic feature used to exchange data using ESP8266 identity and the
data being sent is the volume and velocity of the infusion. Topics, one of
features on MQTT, can be used to manage the data from multiple infusions into
the server. Additionally, the system provides warning information of the
residual volume and velocity limit when the infusion rate exceeds the normal
limit that has been specified by the user.

Smart dog feeder design using wireless communication, MQTT and


Android client:

Regular feeding is one of the problems in dog's maintenance. Owners


often forget to feed their pets because of their work. Smart Dog Feeder is the
answer to these problems. This device can provide regular feeding without
disrupting owner's work. Owners can monitor feeding process with their
Android smart phone virtually. Smart Dog Feeder can give authentication with
RFID, set feeding time and portion per serving through Android smart phone,
send feeding report (eaten or partially eaten), and dog arrival when the feeding
time has arrived. Every setting about feeding time, portion, stock and waiting
time will be set on Android with minimum requirement of Jelly Bean version,
SDK 18 and has been installed with Appliance Hub application. Smart Dog
Feeder has stock information, feed schedule, waiting time and owner's name
from server uses MQTT protocol. All information will be sent in JSON format
and will be processed by Smart Dog Feeder, Android and server. Smart Dog
Feeder will save the schedule and set RTC alarm which will interrupt when the
feed time has arrived. Authentication process is done by checking RFID tag
which is attached on dog collar. Food will be served based on user's setting and
be measured by load cell. Experiment is done by seeing punctuality, portion
congruence, delivery of settings and notification within devices. The result of
experiment is Smart Dog Feeder can receive messages from server and do
feeding at the right time. Next development can be done by adding other
devices in Appliance Hub system.

Conclusion

Integrating IoT with solutions to empower worker safety and a safe


workplace for them is viable and can be done on a large scale with the help of
the powerful tools mentioned in this project. With this development, it can be
said that in the years to come there will be a massive improvement in the safety
standards in hazardous factories so that employees can work peacefully without
the risk of loss of life hanging over their heads. This can be further expanded to
include suitable actions to implement safety measures automatically without
any human intervention at all, making it a completely automatic safety
implementation system. Home environment monitoring and automation helps to
secure the home from accidental hazards and provides convenience to the user.
Due to the recent technological developments in the field of communications,
several authors are implementing Internet of Things (IoT) based embedded
systems. We implement an embedded system based on IoT consisting two
subsystems, one subsystem for monitoring various home environment
parameters such as temperature, humidity, gas leakage, occurrence of any fire
accident, and rain, and another subsystem for automatic lighting control in the
home based on the measurement of light intensity. The system is built using
Arduino Mega 2560, several sensors and NodeMCU as a Wi-Fi module. The
necessary software is developed in Embedded C using the Arduino Integrated
Development Environment (IDE). The sensor data is fed to the Arduino which
checks the set threshold conditions, and then uploads the information about each
environment parameter on to the Cloud Message Queue Telemetry Transport
(MQTT) web server as well as MQTT dashboard android application. PIR
sensor detects any motion in the room and turns on the light in the presence of a
living being inside the room. This helps saving the energy consumption. The
SSR dimmer circuit and light dependent resistor (LDR) are used to control the
light intensity of the bulb based on the lighting in the room. A Home
environment monitoring and automatic lighting control system is implemented
to secure the home and turn on the lights in the presence of living beings in the
room. The environment parameters and other sensor data can be monitored on
the Cloud MQTT web server as well as MQTT dashboard App. The Cloud
MQTT web server / MQTT dashboard can be accessed remotely using an
internet enabled device such as smart phone or laptop.

Reference

[[1] Ravi Kishore Kodali, Borade Samar Sarjerao, A Lost Cost Smart Ir-rigation
System using MQTT Protocol, IEEE Region 10 Symposium(TENSYMP), 14-
16 July, 2017. Cochin, India.
[2] Ravi Kishore Kodali, Snehashish Mandal, IoT Based Weather Station,2016
International Conference on Control, Instrumentation, Communication and
Computation Technologies (ICCICCT), 16-17 December, 2016.Kumaracoil,
India.
[3] Ravi Kishore Kodali, Archana Sahu, An IoT based soil moisture monitoring on
Losant platform, 2nd International Conference on Contemporary Computing
and Informatics (IC3I), 14-17 Dec. 2016. Noida, India.
[4] Ravi Kishore Kodali; Kopulwar Shishir Mahesh, A low cost implementation of
MQTT using ESP8266, 2nd International Conference on Contemporary
Computing and Informatics (IC3I), 14-17 Dec. 2016,Noida, India.
[5] S. Robla-Gmez; V. M. Becerra; J. R. LLata; E. Gonzlez-Sarabia; C.Torre-
Ferrero; J. Prez-Oria, Working Together: A Review on Safe Human-Robot
Collaboration in Industrial Environments, IEEE Access, , 2017.
[6] Mohammed Al-Soh; Imran A. Zualkernan, An MQTT-Based Context-Aware
Wearable Assessment Platform for Smart Watches, IEEE 17thInternational
Conference on Advanced Learning Technologies (ICALT),2017, Timisoara,
Romania.
[7] Ravi Kishore Kodali; Kopulwar Shishir Mahesh, Low cost ambient monitoring
using ESP8266, 2nd International Conference on Contemporary Computing and
Informatics (IC3I), 14-17 Dec. 2016, Noida, India.
[8] Ma Yue; Yan Ruiyang; Sun Jianwei; Yao Kaifeng A MQTT Protocol Message
Push Server Based on RocketMQ, 10th International Conference on Intelligent
Computation Technology and Automation (ICICTA), 2017,Changsha, China.
[9] Naili Shofa; Andrian Rakhmatsyah; Siti Amatullah Karimah, Infusion
monitoring using WiFi (802.11) through MQTT protocol, 5th Inter-national
Conference on Information and Communication Technology(ICoIC7), 2017,
Malacca City, Malaysia.
[10] Vania; Kanisius Karyono; I. Hargyo Tri Nugroho, Smart dog feeder design
using wireless communication, MQTT and Android client, International
Conference on Computer, Control, Informatics and its Applications(IC3INA),
2016, Tangerang, Indonesia.

You might also like