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

INDORE INSTITUTE OF SCIENCE AND TECHNOLOGY

TRAINING REPORT ON

“INTERNET OF THINGS”

An Industrial Training Report submitted on

“INTERNET OF THINGS”

Fulfilled as a part of VII semester curriculum in

Bachelor of Engineering (Electronics and Communication) for

Rajiv Gandhi Proudyogiki Vishwavidyalaya, Bhopal

Session-2018-19

Submitted To: Submitted By:

Mr. Anand Mantri Yash Sharma

Dept. of Electronics and Communication (0818EC151032)

IIST Indore

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING, INDORE INSTITUTE OF SCIENCE


AND TECHNOLOGY,INDORE
INDORE INSTITUTE OF SCIENCE AND TECHNOLOGY INDORE

CERTIFICATE

This is to certify that “Yash Sharma (0818EC151032)” have successfully completed their industrial
training on “Internet of Things” during the year 2018-2019 in the fulfillment of the award of the degree
of Bachelor of Engineering in Electronics and Communication.

Submitted To: Approved By:

Mr. Anand Mantri Mr. Ankit Jain


Asst. Professor Head of Department
Dept. of Electronics & Communication Dept. of Electronics & Communication

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING, INDORE INSTITUTE OF SCIENCE


AND TECHNOLOGY, INDORE
INDORE INSTITUTE OF SCIENCE AND TECHNOLOGY INDORE

RAJIV GANDHI PROUDYOGIKI VISHWAVIDHYALAYA, BHOPAL

CERTIFICATE

This is to certify that the Industrial Training entitled “Internet of Things” submitted to the Rajiv Gandhi
Proudyogiki Vishwavidyalaya, Bhopal, by Yash Sharma (0818EC151032), during the academic year 2018-
2019, is a record of her own work and is accepted as a partial fulfillment of part of VII semester curriculum
in Bachelor of Engineering (Electronics and Communication) Industrial Training.

Internal Examiner: External Examiner:

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING INDORE INSTITUTE OF SCIENCE


AND TECHNOLOGY, INDORE
Certificate of m2r
INDORE INSTITUTE OF SCIENCE AND TECHNOLOGY INDORE

ACKNOWLEDGEMENT

I gratefully thank M2R Technomations and our trainer Mr. Siddhartha Bhatia for guiding me to
develop my skills in IoT and to use them in real-world situations.
I express my special thanks to our Director General Mr. Arun S Bhatnagar and Mr. Ankit
Jain(HOD, EC Dept) for providing me all necessary guidance and support from the institute.
I want to thank IIST for providing resources and support to undergo the industrial training.
Internet of Things has very vast applications and scope, and this training has surely enhanced
my technical skills and knowledge.

THANK YOU
Yash Sharma
(0818EC151032)

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

INDORE INSTITUTE OF SCIENCE AND TECHNOLOGY, INDORE


CONTENTS

Chapter- 1:- Introduction of M2R Technomations:


(A) About the Company
(B) Services Offered
• Robotic Process Automation
• Customized Embedded Solutions
• IoT Services and Solutions
• PCB Designing
• Consultancy

Chapter- 2:- About Internet of Things:


(A) Introduction
(B) Applications and Advantages

Chapter- 3:- IoT Backbone:


(A) IPV4 and IPV6
(B) TCP/IP and UDP
(C) MQTT Protocol

Chapter- 4:- NodeMCU Microcontroller:


(A) What is a microcontroller?
(B) About NodeMCU
• Specifications
• Features
• Pinout Diagram
(C) Programming the NodeMCU
(D) Why Node MCU?
Chapter-5:- Sensors and Actuators :
(A) Introduction to Sensors
(B) Commonly used sensors:
• Temperature and humidity sensor – DHT11
• Ultrasonic sensor – HC-SR-04
• IR obstacle sensor
• Gas sensor—MQ series
• PIR sensor
• Fingerprint sensor
• Others
(C) Actuators

Chapter-6:- Industrial Training Project:


❖ Abstract
1. Introduction
2. Hardware Used
3. Block Diagram
4. Circuit Connections
5. Software used
6. Setting up Server and Client App
7. Working
8. Challenges faced
9. Conclusion
Chapter 1: Introduction of M2R Technomations

(A) About the Company


M2R Technomations is an electronics and hardware-based start-up which works to automate
electronic and electrical devices for a fluid life with a vision to spread technology in each corner
of the country and be made easily accessible and even more easy to use. it provides quality driven
tailor-made solutions to the clients.
In June 2015, M2r Technomations began our journey to showcase its capabilities in electronics,
robotics, Artificial Intelligence, Machine Learning, Internet of Things in Indian Market in order to
decrease the dependency of Indian Vendors for technology Advancement and Development on
Chinese or other country markets.
Their Current traction is Based on Services and Solutions development in Embedded system,
Internet of Things and PCB designing.
In 2018, M2R Technomations merged with a group of companies and incorporated as M2R
Technomations LLP by adding new domains like RPA, AI/ML in its feather. The company office is
located at Electronic City, Gurugram.

(B) Services Offered


The company currently works on the following domains:

1. Robotic Process Automation

Robot process automation (RPA) is the application of technology that


provides an organization a digital workforce. The company develops
artificially intelligent chatbot for customer engagement and sales. They
can automate your existing software to provide a digital speed to your
business.

2. Customized Embedded Solutions


M2R is one-stop solution provider for embedded product engineering and development. It
provides quality driven tailor-made solutions in the field of embedded system as well as Internet
of things.
3. Internet of Things Services & Solutions

Internet of Things is a technology where electronic devices


are connected in some way either to a smartphone/tablet
or to the cloud/remote server. The device measures data
through its sensors and sends it to a smartphone/tablet or
cloud for further processing or control actions. "Anything
that can be connected will be connected"

4. PCB Designing
The company also offers PCB layout designing & prototyping as a standalone service to build a
customized product or to convert any existing schematic diagrams that users might have already
designed into fully assembled prototypes.

5. Consultancy
This involves in-house R&D to identify and propose a solution to customer based on customer’s
requirements. M2R develops prototypes which are as reliable as working products. It helps
customers engineering teams to identify and use latest technologies in their products. It
contributes at whole product development as well as sub-system development.
Chapter 2: About Internet of Things

(A) Introduction
The "Internet of things" (IoT) is becoming an increasingly growing trend in technology. It's a
concept that not only has the potential to impact how we live but also how we work. But what
exactly is the "Internet of things" and what impact is it going to have on you, if any? These
questions are answered as follows.
Broadband Internet has become more widely available, the cost of connecting is decreasing,
more devices are being created with Wi-Fi capabilities and sensors built into them, technology
costs are going down, and smartphone penetration is sky-rocketing. All these things are creating
a "perfect storm" for the IoT.
IoT is the concept of connecting any device with an ON and
OFF switch to the Internet and/or to each other. This
includes everything from cellphones, coffee makers,
washing machines, headphones, lamps, wearable devices
and almost anything else we can think of. This also applies
to components of machines. If an appliance or machine has
an on and off switch, then chances are it can be a part of the
IoT.
It is estimated that by 2020 there will be over 26 billion connected devices... That's a lot of
connections. Some even estimate this number to be much higher, over 100 billion. The IoT is a
giant network of connected "things". The relationship will be between people-people, people-
things, and things-things. A “thing” in the internet of things can be a person with a heart monitor
implant, a farm animal with a biochip transponder, an automobile that has built-in sensors to
alert the driver when tire pressure is low or any other natural or man-made object that can be
assigned an IP address and is able to transfer data over a network.
The new rule for the future is going to be, "Anything that can be connected, will be connected."
There are many examples for what this might look like or what the potential value might be. For
example, you are on your way to a meeting; your car could have access to your calendar and
already know the best route to take. If the traffic is heavy your car might send a text to the other
party notifying them that you will be late. What if your alarm clock wakes up you at 6 a.m. and
then notifies your coffee maker to start brewing coffee for you? What if your office equipment
knew when it was running low on supplies and automatically re-ordered more? What if the
wearable device you used in the workplace could tell you when and where you were most active
and productive and shared that information with other devices that you used while working?
(B) Applications and Advantages:

There are numerous real-world applications of the internet of things, ranging from consumer IoT
and enterprise IoT to manufacturing and industrial IoT (IIoT). IoT applications span numerous
verticals, including automotive, telco, energy and more.

In the consumer segment, for example, smart homes that are equipped with smart thermostats,
smart appliances and connected heating, lighting and electronic devices can be controlled
remotely via computers, smartphones or other mobile devices.
Wearable devices with sensors and software can collect and analyze user data, sending messages
to other technologies about the users with the aim of making users' lives easier and more
comfortable. Wearable devices are also used for public safety -- for example, improving first
responders' response times during emergencies by providing optimized routes to a location or
by tracking construction workers' or firefighters' vital signs at life-threatening sites.
In healthcare, IoT offers many benefits, including the ability to monitor patients more closely to
use the data that's generated and analyze it. Hospitals often use IoT systems to complete tasks
such as inventory management, for both pharmaceuticals and medical instruments.
Smart buildings can, for instance, reduce energy costs using sensors that detect how many
occupants are in a room. The temperature can adjust automatically -- for example, turning the
air conditioner on if sensors detect a conference room is full or turning the heat down if everyone
in the office has gone home.
In agriculture, IoT-based smart farming systems can help monitor, for instance, light,
temperature, humidity and soil moisture of crop fields using connected sensors. IoT is also
instrumental in automating irrigation systems.
In a smart city, IoT sensors and deployments, such as smart streetlights and smart meters, can
help alleviate traffic, conserve energy, monitor and address environmental concerns, and
improve sanitation
Chapter 3: IoT Backbone

(A) IPV4 and IPV6:

First let us understand what IP is. IP (short for Internet Protocol) specifies the technical format of
packets and the addressing scheme for computers to communicate over a network. Most
networks combine IP with a higher-level protocol called Transmission Control Protocol (TCP),
which establishes a virtual connection between a destination and a source.
IP by itself can be compared to something like the postal system. It allows you to address a
package and drop it in the system, but there's no direct link between you and the recipient.
TCP/IP, on the other hand, establishes a connection between two hosts so that they can send
messages back and forth for a period.
IPV4: IPv4 stands for Internet Protocol version 4. It is the underlying technology that makes it
possible for us to connect our devices to the web. Whenever a device accesses the Internet
(whether it's a PC, Mac, smartphone or other device), it is assigned a unique, numerical IP address
such as 99.48.227.227. To send data from one computer to another through the web, a data
packet must be transferred across the network containing the IP addresses of both devices.
Without IP addresses, computers would not be able to communicate and send data to each other.
It's essential to the infrastructure of the web.
IPv4 uses 32 bits for its Internet addresses. That means it can support 2^32 IP addresses in total
— around 4.29 billion. That may seem like a lot, but all 4.29 billion IP addresses have now been
assigned to various institutions, leading to the crisis we face today. We haven't run out of
addresses quite yet. Many of them are unused and in the hands of institutions like MIT and
companies like Ford and IBM. More IPv4 addresses are available to be assigned and more will be
traded or sold (since IPv4 addresses are now a scarce resource), but they will become a scarcer
commodity over the next two years until it creates problem for the web.
32-bit numeric address (IPv4) is written in decimal as four numbers separated by periods. Each
number can be zero to 255. For example, 1.160.10.240 could be an IP address.
IPV6: IPv6 is the sixth revision to the Internet Protocol and the successor to IPv4. It functions
similarly to IPv4 in that it provides the unique, numerical IP addresses necessary for Internet-
enabled devices to communicate. However, it does sport one major difference: it utilizes 128-bit
addresses.
IPv6 utilizes 128-bit Internet addresses. Therefore, it can support 2^128 Internet addresses —
340,282,366,920,938,000,000,000,000,000,000,000,000 of them to be exact. That's a lot of
addresses, so many that it requires a hexadecimal system to display the addresses. In other
words, there are more than enough IPv6 addresses to keep the Internet operational for a very,
very long time.
IPv6 addresses are 128-bit IP address written in hexadecimal and separated by colons. An
example IPv6 address could be written like this- 3ffe:1900:4545:3:200:f8ff:fe21:67cf.

(B) TCP/IP and UDP:

A protocol is an agreed-upon set of procedures and rules. When two computers follow the same
protocols—the same set of rules—they can understand each other and exchange data.
TCP/IP and UDP are also protocols. Let us understand about them in more detail:
TCP/IP: Transmission Control Protocol (TCP) and Internet Protocol (IP) are two distinct computer
network protocols. TCP and IP are so commonly used together, however, that TCP/IP has become
standard terminology for referring to this suite of protocols.
Transmission Control Protocol divides a message or file into packets that are transmitted over
the internet and then reassembled when they reach their destination. Internet Protocol is
responsible for the address of each packet, so it is sent to the correct destination.
TCP/IP dictates how information should be packaged (turned into bundles of information called
packets), sent, and received, as well as how to get to its destination.
There are four total layers of TCP/IP protocol, each of which is listed below with a brief
description.

• Network Access Layer - This layer is concerned with building packets.


• Internet Layer - This layer uses Internet Protocol (IP) to describe how packets are to be
delivered.
• Transport Layer - This layer utilizes User Datagram Protocol (UDP) and Transmission
Control Protocol (TCP) to ensure the proper transmission of data.
• Application Layer - This layer deals with application network processes.

UDP: User Datagram Protocol (UDP) is part of the Internet Protocol suite used by programs
running on different computers on a network. UDP is used to send short messages called
datagrams. User datagram protocol is an open systems interconnection (OSI) transport layer
protocol for client- server network applications. UDP uses a simple transmission model but does
not employ handshaking dialogs for reliability, ordering and data integrity. The protocol assumes
that error-checking and correction is not required, thus avoiding processing at the network
interface level.
UDP is widely used in video conferencing and real-time computer games. The protocol permits
individual packets to be dropped and UDP packets to be received in a different order than that
in which they were sent, allowing for better performance.
UDP network traffic is organized in the form of datagrams, which comprise one message units.
The first eight bytes of a datagram contain header information, while the remaining bytes contain
message data. A UDP datagram header contains four fields of two bytes each:

• Source port number


• Destination port number
• Datagram size
• Checksum

(C) MQTT Protocol:


MQTT (MQ Telemetry Transport) is a lightweight messaging protocol that provides resource-
constrained network clients with a simple way to distribute telemetry information. The protocol,
which uses a publish/subscribe communication pattern, is used for machine-to-machine (M2M)
communication and plays an important role in the internet of things (IoT).
Client: Both publishers and subscribers are MQTT clients. The publisher and subscriber labels refer
to whether the client is currently publishing messages or subscribing to messages (publish and
subscribe functionality can also be implemented in the same MQTT client). 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. Basically, any device that speaks MQTT over a TCP/IP stack
can be called an MQTT client.
Broker: A message broker is an intermediary program that translates messages from the formal
messaging protocol of the publisher to the formal messaging protocol of the receiver. Message
broker programs are sometimes known as middleware . The broker is responsible for receiving all
messages, filtering the messages, determining who is subscribed to each message, and sending
the message to these subscribed clients.
MQTT enables resource-constrained IoT devices to send, or publish, information about a given
topic to a server that functions as an MQTT message broker. The broker then pushes the
information out to those clients that have previously subscribed to the client's topic. To a human,
a topic looks like a hierarchical file path. Clients can subscribe to a specific level of a topic's
hierarchy .
The MQTT protocol is a good choice for wireless networks that experience varying levels of
latency due to occasional bandwidth constraints or unreliable connections. Should the
connection from a subscribing client to a broker get broken, the broker will buffer messages and
push them out to the subscriber when it is back online. Should the connection from the publishing
client to the broker be disconnected without notice, the broker can close the connection and
send subscribers a cached message with instructions from the publisher.

An MQTT session is divided into four stages: connection, authentication, communication and
termination. A client starts by creating a TCP/IP connection to the broker by using either a
standard port or a custom port defined by the broker's operators. The standard ports are
1883and 8883.

QOS: QOS means Quality of Service. The three different quality of service levels determine how
the content is managed by the MQTT protocol. Although higher levels of QoS are more reliable,
they have more latency and bandwidth requirements, so subscribing clients can specify the
highest QoS level they would like to receive.
The simplest QoS level is unacknowledged service. This QoS level uses a PUBLISH packet
sequence; the publisher sends a message to the broker one time and the broker passes the
message to subscribers one time. There is no mechanism in place to make sure the message has
been received correctly, and the broker does not save the message. This QoS level may also be
referred to as at most once, QoS0, or fire and forget.
The second QoS level is acknowledged service. This QoS level uses a PUBLISH/PUBACK packet
sequence between the publisher and its broker, as well as between the broker and subscribers.
An acknowledgement packet verifies that content has been received and a retry mechanism will
send the original content again if an acknowledgement is not received in a timely manner. This
may result in the subscriber receiving multiple copies of the same message. This QoS level may
also be referred to as at least once or QoS1.
The third QoS level is assured service. This QoS level delivers the message with two pairs of
packets. The first pair is called PUBLISH/PUBREC, and the second pair is called
PUBREL/PUBCOMP. The two pairs ensure that, regardless of the number of retries, the message
will only be delivered once. This QoS level may also be referred to as exactly once or QoS2.
MQTT Operations: During the communication phase, a client can perform publish, subscribe,
unsubscribe and ping operations. The publish operation sends a binary block of data -- the
content -- to a topic that is defined by the publisher.
The fourth operation a client can perform during the communication phase is to ping the broker
server using a PINGREQ/PINGRESP packet sequence, which roughly translates to ARE YOU
ALIVE/YES I AM ALIVE. This operation has no other function than to maintain a live connection
and ensure the TCP connection has not been shut down by a gateway or router.
Chapter 4: NodeMCU Microcontroller

(A) What is a microcontroller?


A microcontroller is a compact integrated circuit designed to govern a specific operation in an
embedded system. A typical microcontroller includes a processor, memory and input/output
(I/O) peripherals on a single chip. Sometimes referred to as an embedded controller or
microcontroller unit (MCU), microcontrollers are found in vehicles, robots, office machines,
medical devices, mobile radio transceivers, vending machines and home appliances among other
devices.
A microcontroller's processor will vary by application. Options range from the simple 4-bit, 8-bit
or 16-bit processors to more complex 32-bit or 64-bit processors. In terms of memory,
microcontrollers can use random access memory (RAM), flash memory, EPROM or EEPROM.
Generally, microcontrollers are designed to be readily usable without additional computing
components because they are designed with sufficient onboard memory as well as offering pins
for general I/O operations, so they can directly interface with sensors and other components.
Microcontroller processors can be based on complex instruction set computing (CISC) or reduced
instruction set computing (RISC). CISC generally has around 80 instructions while RISC has about
30, as well as more addressing modes, 12-24 compared to RISC's 3-5. While CISC can be easier to
implement and has more efficient memory use, it can have performance degradation due to the
higher number of clock cycles needed to execute instructions. RISC, which places more emphasis
on software, often provides better performance than CISC processors, which place more
emphasis on hardware, due to its simplified instruction set and, therefore, increased design
simplicity, but because of the emphasis it places on software, software can be more complex.
Which ISC is used varies depending on application. When they first became available,
microcontrollers solely used assembly language. Today, the C programming language is a popular
option MCUs feature input and output pins to implement peripheral functions. Such functions
include analog-to-digital converters, liquid crystal display (LCD) controllers, real-time clock (RTC),
synchronous/asynchronous receiver transmitter (USART), timers, universal serial bus (USB)
connectivity. Sensors gathering data related to humidity and temperature among others are also
often attached to microcontrollers.
Microcontrollers are used in multiple industries and applications, including in the home and
enterprise, building automation, manufacturing, robotics, automotive, lighting, smart energy,
industrial automation, communications and internet of things (IoT) deployments. Common MCUs
include the Intel MCS-51, often referred to as an 8051 microcontroller, which was first developed
in 1985; the AVR microcontroller developed by Atmel in 1996; the programmable interface
controller (PIC) from Microchip Technology; and various licensed ARM microcontrollers. A
number of companies manufacture and sell microcontrollers, including NXP Semiconductor,
Renesas Electronics, Silicon Labs and Texas Instruments.
(B) About NodeMCU

The Node MCU (Node Microcontroller Unit) is an open source software and hardware
development environment that is built around a very inexpensive System-on-a-Chip (SoC) called
the ESP8266. The ESP8266, designed and manufactured by Espressif Systems, contains all crucial
elements of the modern computer: CPU, RAM, networking (Wi-Fi), and even a modern operating
system and SDK.

NodeMCU Development board is featured with Wi-Fi capability, analog pin, digital pins and serial
communication protocols. It has GPIO pins with PWM functionality. There is an analog pin (A0)
which has an ADC connected to it. We can use this analog pin to read analog signals or values
from any sensor. We can develop applications on NodeMCU using Arduino development
environment, although there are other IDEs available.
About ESP8266:
The ESP8266 is a low-cost Wi-Fi microchip with full TCP/IP stack and microcontroller capability
produced by Shanghai-based Chinese manufacturer Espressif Systems.

• Manufacturer Espressif Systems


• Type 32-bit microcontroller
• CPU @ 80 MHz (default) or 160 MHz
• Memory 32 KiB instruction, 80 KiB user data
• Wi-Fi IEEE 802.11 b/g/n Wi-Fi

Specifications:

• Wi-Fi Module – ESP8266-12E module.


• USB – micro USB port for power, programming and debugging
• Headers – 2x 2.54mm 15-pin header with access to GPIOs, SPI, ADC, power pins
• Miscellaneous – Reset and Flash buttons
• Power in – 5V via micro USB port
• Operating voltage – 3.3V
• Analog pins – 1(A0)
• Dimensions – 49 x 24.5 x 13mm

Features:

• Programable Wi-Fi module.


• Arduino-like (software defined) hardware IO.
• Can be programmed with the simple and powerful Arduino IDE.
• USB included so easy to connect.
• 10 GPIOs D0-D10, PWM functionality, SPI communication and ADC A0 etc. all in one
board.
• Wi-fi networking (can be used as access point and/or station, host a web server),
connect to internet to fetch or upload data.
• PCB antenna.
• Economical and effective.

Pinout of NodeMCU:

Below is the pin diagram of NodeMCU:

The pins have been described as follows. General-purpose input/output (GPIO) is a pin on an IC
(Integrated Circuit). It can be either input pin or output pin, whose behavior can be controlled at
the run time.
NodeMCU Development kit provides access to these GPIOs of ESP8266. The only thing to take
care is that NodeMCU Dev kit pins are numbered differently than internal GPIO notations of
ESP8266 as shown in below figure and table. For example, the D0 pin on the NodeMCU Dev kit is
mapped to the internal GPIO pin 16 of ESP8266.
Below table gives NodeMCU Dev Kit IO pins and ESP8266 internal GPIO pins mapping
Pin Names on NodeMCU ESP8266 Internal GPIO Pin number

D0 GPIO16

D1 GPIO5

D2 GPIO4

D3 GPIO0

D4 GPIO2

D5 GPIO14

D6 GPIO12

D7 GPIO13

D8 GPIO15

D9/RX GPIO3

D10/TX GPIO1

D11/SD2 GPIO9

D12/SD3 GPIO10

ESP8266 is a system on a chip (SoC) design with components like the processor chip. The
processor has around 16 GPIO lines, some of which are used internally to interface with other
components of the SoC, like flash memory.
Since several lines are used internally within the ESP8266 SoC, we have about 11 GPIO pins
remaining for GPIO purpose. Now again 2 pins out of 11 are generally reserved for RX and TX to
communicate with a host PC from which compiled object code is downloaded. Hence finally, this
leaves just 9 general purpose I/O pins i.e. D0 to D8. As shown in above figure of NodeMCU Dev
Kit. We can see RX, TX, SD2, SD3 pins are not mostly used as GPIOs since they are used for other
internal process.
The pin A0 is an analog pin. To read an analog signal through the NodeMCU, Analog to Digital
conversion is required. A NodeMCU has 10-bit ADC which means it scales an analog signal in a
range of 0-1023. Here, if the available analog pin voltage is 3.3V, i.e. equal to the operating
voltage of the board, the ADC will give maximum output value which is 1023. Similarly, 0V at the
analog pin would result in a zero value from ADC. Apart from these pins, there are power pins
like 3V3, GND and Vin. We also have an RST pin which can be used to reset the controller.

(C) Programming the Node MCU:


The Node MCU can be programmed by using several IDEs but the most popular ones are LUA and
Arduino IDE. Arduino IDE has been explained here as it is the most convenient way and Arduino
environment is the most widely used
environment by electronics enthusiasts
and hobbyists.
Arduino IDE : The Arduino integrated
development environment (IDE) is a
cross-platform application (for Windows,
macOS, Linux). The Arduino IDE supports
the languages C and C++ using special
rules of code structuring. The Arduino IDE
supplies software libraries, which provide
many common input and output
procedures. User-written code only
requires two basic functions, for starting
the sketch we have void setup ( ) and the
main program that runs continuously is in
void loop ( ). The setup function runs once
during power ON or RESET of the
controller, and then the loop function
runs infinitely unless we RESET or power
OFF the controller. The Arduino IDE editor
window has been shown.

(D) Why Node MCU?

There are several reasons why Node MCU has advantages over other microcontrollers:
1. Node MCU is not very expensive. It is the best choice among other controllers.
2. It has on board Wi-Fi SoC so there is no need for extra Wi-Fi shields.
3. It can be programmed using Arduino IDE which is very popular and responsive.
4. Works on standard 5V as well as 3.3V.
5. Can be powered with micro USB which is very commonly used.
Chapter 5 : Sensors and Actuators

(A) Introduction to Sensors:


Sensors in electronics are like sense organs in humans. A sensor is a device which provides a
usable output in response to a specified measurand. A sensor acquires a physical quantity and
convert it into a signal suitable for processing. Commonly, sensors convert measurement of
physical phenomena in an electrical signal. The active element of a sensor is called transducer
which acts as a device converting the physical quantity to the electrical signal.
Some commonly detectable physical phenomena are heat, light, magnetic field, moisture,
pressure mechanical motion, electromagnetic field, gases, light etc.
Sensors are pervasive. They are embedded in automobiles, airplanes, cellular telephones, radios
and countless other applications. Without the use of sensors, there would be no automation.

(B) Commonly Used Sensors

1. Temperature and humidity sensor – DHT11


A humidity sensor senses, measures and regularly reports the relative humidity in the air. It
measures both moisture and air temperature. Relative humidity, expressed as a percent, is the
ratio of actual moisture in the air to the highest amount of moisture air at that temperature can
hold. The warmer the air is, the more moisture it can hold, so relative humidity changes with
fluctuations in temperature.
Most humidity sensors use capacitive measurement to determine the amount of moisture in the
air. This type of measurement relies on two electrical conductors with a non-conductive polymer
film laying between them to create an electrical field between them. Moisture from the air
collects on the film and causes changes in the voltage levels between the two plates. For
temperature measurement, it uses an NTC thermistor.
The specifications of DHT 11 sensor are as follows:
• Operating Voltage: 3.5V to 5.5V
• Operating current: 0.3mA (measuring) 60uA (standby)
• Output: Analog, Digital (Depends on manufacturer)
• Temperature Range: 0°C to 50°C
• Humidity Range: 20% to 90%
• Resolution: Temperature and Humidity both are 16-bit
• Accuracy: ±1°C and ±1%

2. Ultrasonic Sensor – HC-SR04


The HC-SR04 ultrasonic sensor uses SONAR to determine the distance of an object just like the
bats do. It offers excellent non-contact range detection with high accuracy and stable readings in
an easy-to-use package from 2 cm to 400 cm or 1” to 13 feet. The operation is not affected by
sunlight or black material, although acoustically, soft materials like cloth can be difficult to detect.
It comes complete with ultrasonic transmitter and receiver module.

It emits an ultrasound at 40 000 Hz which travels through the air and if there is an object or
obstacle on its path It will bounce back to the module. Considering the travel time and the speed
of the sound you can calculate the distance.
The specifications of HC-SR04 sensor are as follows:
• Power Supply − +5V DC
• Quiescent Current − <2mA
• Working Current − 15mA
• Ranging Distance − 2cm – 400 cm/1″ – 13ft
• Resolution − 0.3 cm

3. IR Obstacle Sensor
Infrared Obstacle Sensor Module has built-in IR transmitter and IR receiver that sends out IR
energy and looks for reflected IR energy to detect presence of any obstacle in front of the sensor
module. The module has on board potentiometer that lets user adjust detection range. The
sensor has very good and stable response even in ambient light or in complete darkness.
An IR sensor consists of an IR LED and an IR Photodiode; together they are called as Photo–
Coupler or Opto–Coupler. The Infrared Obstacle Sensor has built-in IR transmitter and IR receiver.
Infrared Transmitter is a light emitting diode (LED) which emits infrared radiations. Even though
an IR LED looks like a normal LED, the radiation emitted by it is invisible to the human eye.
Infrared receivers are also called as infrared sensors as they detect the radiation from an IR
transmitter. IR receivers come in the form of photodiodes and phototransistors. Infrared
Photodiodes are different from normal photo diodes as they detect only infrared radiation. When
the IR transmitter emits radiation, it reaches the object and some of the radiation reflects back
to the IR receiver. Based on the intensity of the reception by the IR receiver, the output of the
sensor is defined.
The specifications of IR obstacle sensor are as follows:
• Operating Voltage: 3.0V – 5.0V
• Detection range: 2cm – 30cm (Adjustable using potentiometer)
• Current Consumption: At 3.3V : ~23 mA, at 5.0V: ~43 mA
• Active output level: Outputs Low logic level when obstacle is detected
• On board Obstacle Detection LED indicator

4. Gas Sensors (MQ Series)


A Gas sensor or a gas detector is a type of chemical sensor which detects/measures the
concentration of gas in its vicinity. Gas sensor interacts with a gas to measure in concentration.
They are used in various industries ranging from medicine to aerospace. Various technologies are
used to measure gas concentration such as semiconductors, oxidation, catalytic, infrared, etc.
MQ series of gas sensors use a small heater inside with an electro-chemical sensor. They are
sensitive for a range of gases. The output is an analog signal and can be read by any analog pin
of a microcontroller. Since there are no electronic components inside, therefor most sensors can
be used with AC and DC voltages.
Below is the internal circuit of the sensor:
The preferred wiring is to connect both 'A' pins together and both 'B' pins together. It is safer,
and it is assumed that is has more reliable output results. Although many schematics and
datasheets show otherwise, you are advised to connect both 'A' pins together and connect both
'B' pins together. In the picture, the heater is for +5V and is connected to both 'A' pins. This is
only possible if the heater needs a fixed +5V voltage. The variable resistor in the picture is the
load-resistor and it can be used to determine a good value. A fixed resistor for the load-resistor
is used in most cases. The Vout is connected to an analog input of the microcontroller.
The voltage for the internal heater is very important. Some sensors use 5V for the heater, others
need 2V. The 2V can be created with a PWM signal. The sensors that use 5V or 6V for the internal
heater do get warm. They can easily get 50 or 60 degrees Celsius.
After the "burn-in time", the heater needs to be on for about 3 minutes (tested with MQ-2)
before the readings become stable. The sensor needs a load-resistor at the output to ground. Its
value could be from 2kOhm to 47kOhm. The lower the value, the less sensitive. The higher the
value, the less accurate for higher concentrations of gas.
If only one specific gas is measured, the load-resistor can be calibrated by applying a known
concentration of that gas. If the sensor is used to measure any gas (like in an air quality detector)
the load-resistor could be set for a value of about 1V output with clean air. Choosing a good value
for the load-resistor is only valid after the burn-in time. Some datasheets use the term "preheat",
but it is the time to burn-in the sensor. This is meant to make the sensor readings more
consistent. A time of 12 or 24 hours is usually used for the burn-in time.
The Burn-in is achieved by applying normal power to the sensor (to the heater and with the 'A'
and 'B' pins connected, and with a load-resistor). In some special cases a specific burn-in is
needed. See the datasheet if the sensor needs such a specific burn-in.
MQ Sensors are used in:

• Process control industries


• Environmental monitoring
• Boiler control
• Fire detection
• Alcohol breath tests
• Detection of harmful gases in mines
• Home safety
• Grading of agro-products like coffee and spices

The MQ sensor module has been shown in the picture. Most modules
have digital as well as analog outputs. The features of these sensors
are:

• Operating Voltage is +5V


• Analog output voltage: 0V to 5V
• Digital Output Voltage: 0V or 5V
• Preheat duration 20 seconds
• Can be used as a Digital or analog sensor.
• The Sensitivity of Digital pin can be varied using the potentiometer
5. PIR Sensor
PIR sensors allow you to sense motion. They are used to detect whether a human has moved in
or out of the sensor’s range. They are commonly found in appliances and gadgets used at home
or for businesses. They are often referred to as PIR, "Passive Infrared", "Pyroelectric", or "IR
motion" sensors.

PIRs are made of pyroelectric sensors, a round metal can with a rectangular crystal in the center,
which can detect levels of infrared radiation. Everything emits low-level radiation, and the hotter
something is, the more radiation is emitted. The sensor in a motion detector is split in two halves.
This is to detect motion (change) and not average IR levels. The two halves are connected so that
they cancel out each other. If one-half sees more, or less IR radiation than the other, the output
will swing high or low.
PIRs have adjustable settings and have a header installed in the 3-pin ground/out/power pads.
For many basic projects or products that need to detect when a person has left or entered the
area, PIR sensors are great. Note that PIRs do not tell you the number of people around or their
closeness to the sensor. The lens is often fixed to a certain sweep at a distance and they are
sometimes set off by the pets in the house.
Following are the advantages of PIR Sensors:

• Small in size
• Wide lens range
• Easy to interface
• Inexpensive
• Low-power
• Easy to use
• Do not wear out
6. Fingerprint Sensor Module R307:
R307 Fingerprint Module consists of optical fingerprint sensor, high-speed DSP processor, high-
performance fingerprint alignment algorithm, high-capacity FLASH chips and other hardware and
software composition, stable performance, simple structure, with fingerprint entry, image
processing, fingerprint matching, search and template storage and other functions.
It works on 3.3V but there is also an option for providing 5V. R307 is very suitable for fingerprint-
based security systems.

The module has the following parameters:

• Supply voltage: DC 5V or DC 3.3V


• Supply current: Working current: 50mA (typical) Peak current: 80mA
• Fingerprint image input time: <0.3 seconds
• Window area: 14x18 mm
• Storage capacity: 1000 pieces
• Refusal rate (FRR): <1.0%
• Search time: <1.0 seconds
• Working environment: Temperature: -20 ℃ - +40 ℃ Relative humidity: 40% to 85%
6. Others
There are numerous sensors available to measure various quantities like sound, luminous
intensity, pressure, gravity, magnetic field and much more.

(C) Actuators:
An actuator is a component of a machine that is responsible for moving and controlling a
mechanism or system, for example by opening a valve. In simple terms, it is a "mover".
An actuator requires a control signal and a source of energy. The control signal is relatively low
energy and may be electric voltage or current, pneumatic or hydraulic pressure, or even human
power. Its main energy source may be an electric current, hydraulic fluid pressure, or pneumatic
pressure. When it receives a control signal, an actuator responds by converting the signal's
energy into mechanical motion.
An actuator is the mechanism by which a control system acts upon an environment. The control
system can be simple (a fixed mechanical or electronic system), software-based (e.g. a printer
driver, robot control system), a human, or any other input.
Actuators can be categorized by the energy source they require to generate motion. For example:

• Pneumatic actuators use compressed air to generate motion.


• Hydraulic actuators use liquid to generate motion.
• Electric actuators use an external power source, such as a battery, to generate motion.
• Thermal actuators use a heat source to generate motion.
The data that is generated by sensors and actuators are expected to play an important part in
the Internet of Things (IoT).
Whereas sensors sense and send, actuators act and activate. The actuator gets a signal and sets
in motion what it needs to set in motion to act upon/within an environment. Electric actuators
can turn their energy in mechanical torque, other actuators can control valves, and so forth.
Some examples of actuators are relays, electric motors, solenoid valves etc.
Relays
Relays are electrically controlled switches. Relays allow one circuit to switch a second circuit
which can be separate from the first. Here we have used SPDT relay module which has two relays
on the board. SPDT relays have the following connection terminals:

• Coil 1
• Coil 2
• COM (Common)
• NO (Normally Open)
• NC (Normally Closed)

Current flowing through the coil of the relay creates a magnetic field which attracts a lever and
changes the switch contacts. The coil current can be on or off, so relays have two switch positions
and most have double throw (changeover) switch contacts as shown in the diagram.
Relay coils may be rated 5V, 12V etc. Here the relay board has two 5V relays. Hence, we need to
apply a voltage of 5V to the coil of the relay to switch it.
On the module we have COM, NO and NC of both relays on the screw terminals. The power for
the board and the coil need to be supplied on the header pins. Two more header pins – in1 and
in2 are used to control the switching of the relays. If voltage level at in1 is HIGH (5v), the relay 1
will be ON and if the voltage level is LOW (0v), it will be OFF. Same applies for in2 and relay 2.
Here relay ON corresponds to the connection of COM to NO and relay OFF corresponds to
connection of COM and NC where NO is completely disconnected.
Chapter 6: Industrial Training Project

Industrial Training Project


IOT BASED VEHICLE IGNITION AND SELF-START SYSTEM WITH INTEGRATED
FINGERPRINT RECOGNITION

Yash Sharma | 0818EC151032


ABSTRACT

This project is based on the application of Internet of Things (IOT) to our vehicles. IoT involves
extending internet connectivity beyond standard devices, such as desktops, laptops,
smartphones and tablets, to any range of traditionally dumb or non-internet-enabled physical
devices and everyday objects. Embedded with technology, these devices can communicate and
interact over the internet, and they can be remotely monitored and controlled.
The number of IoT devices increased 31% year-over-year to 8.4 billion in 2017 and it is estimated
that there will be 30 billion devices by 2020. The applications of IOT are endless. It can be used
in agriculture, home automation, smart cities, traffic management, medical field, industries,
automobiles and so on.
The project focuses on making an effective system and then extending its capabilities, so that it
can also be operated from any location.
We have made a vehicle ignition system which can be controlled via internet from any remote
location, by using website as well as android application. It also has a fingerprint sensor which
can be used even when there is no internet connection. The owner of the vehicle has options to
add new users (fingerprints) and remove existing users through android application or website.
1. INTRODUCTION
Today’s world is far more dependent on internet than ever. Internet has simplified our lives and
work and has provided the connectivity to share documents, media, and much more. But apart
from these conventional ways of using internet, we can do much more with it. We can connect
the not so commonly connected appliances like fridge, television, fans, etc. and switch them
ON/OFF using internet. This is called IOT (Internet of Things).
In this project we have made a smart vehicle ignition and self-start system. The system uses
fingerprint recognition to identify the users. When the user puts his finger on the sensor window,
his fingerprint gets scanned. If the fingerprints are found to be valid, the ignition is automatically
switched ON followed by a self-start. If the scanned fingerprint is not a valid one, then no action
is taken. The system repeats this procedure if it is not connected to a wireless network with
internet access. But to add or remove users, the system needs to connect to a Wi-Fi network. The
owner of the vehicle can then permit a new registration through a website or through MQTT
client android app. The owner can also delete existing users’ fingerprints so that they can no
longer use the vehicle. From the android app as well as the website, the owner can also control
ignition and self-start.
The system uses NodeMCU as the microcontroller. This is the brain of the system. NodeMCU is
an open source IOT platform which has an on board ESP8266 SoC (System on Chip). This allows
it to connect to Wi-fi networks. Here we have used MQTT protocol to transfer information
between NodeMCU and other clients. Clients may be the people (or owner) using MQTT client
apps with valid credentials, or the owner of the vehicle using the website. We have used Adafruit
IO as the server and the website for accessing the controls is: https://io.adafruit.com. The owner
needs to log in to the website using his login id and password.
Even in the MQTT client android apps (there are many such apps available), proper credentials
are required during setup. Hence it is secure and nobody without username and AIO key can
access it.
The terms and components mentioned above are further explained in detail later in the report.
2. HARDWARE USED
Following are the electronic components used in the project:

2.1 NodeMCU:
The NodeMCU (Node MicroController Unit) is an open source software and hardware development
environment that is built around a very inexpensive System-on-a-Chip (SoC) called the ESP8266. The
ESP8266, designed and manufactured by Espressif Systems, contains all crucial elements of the modern
computer: CPU, RAM, networking (Wi-Fi), and even a modern operating system and SDK.

Following is the pin diagram of the NodeMCU:

NodeMCU Development board is featured with Wi-Fi capability, analog pin, digital pins and serial
communication protocols. It has GPIO pins with PWM functionality. There is an analog pin (A0)
which has an ADC connected to it. We can use this analog pin to read analog signals or values
from any sensor. We can develop applications on NodeMCU using Arduino development
environment, although there are other IDEs available.

2.2 Fingerprint Sensor Module (R307):


R307 Fingerprint Module consists of optical fingerprint sensor, high-speed DSP processor, high-
performance fingerprint alignment algorithm, high-capacity FLASH chips and other hardware and
software composition, stable performance, simple structure, with fingerprint entry, image
processing, fingerprint matching, search and template storage and other functions.
It works on 3.3V but there is also an option for providing 5V. R307 is very suitable for fingerprint-
based security systems.

Figure 1: R307 Module Figure 2: Pinout of R307

Pin# Pin Name Details

1 5V Regulated 5V DC

2 GND Common Ground

3 TXD Data output - Connect to MCU RX

4 RXD Data Input - Connect to MCU TX

5 TOUCH Active Low output when there is touch on sensor by finger

6 3.3V Use this wire to give 3.3V to sensor instead of 5V


USB Cable Connections are 5V/D+/D-/GND (Optional)

The module has the following parameters:


• Supply voltage: DC 5V or DC 3.3V
• Supply current: Working current: 50mA (typical) Peak current: 80mA
• Fingerprint image input time: <0.3 seconds
• Window area: 14x18 mm
• Characteristic file: 256 bytes
• Template file: 512 bytes
• Storage capacity: 1000 pieces
• Security Level: Five (from low to high: 1,2,3,4,5)
• Fake rate (FAR): <0.001%
• Refusal rate (FRR): <1.0%
• Search time: <1.0 seconds (1: 1000 hours, mean value)
• Host interface: UART \ USB1.1
• Working environment: Temperature: -20 ℃ - +40 ℃ Relative humidity: 40% RH-85% RH
(no condensation.

2.3 Relay Module:


Relays are electrically controlled switches. Relays allow one circuit to switch a second circuit
which can be separate from the first. Here we have used SPDT relay module which has two relays
on the board.
SPDT relays have the following connection terminals:

• Coil 1

• Coil 2

• COM (Common)

• NO (Normally Open)

• NC (Normally Closed)

COIL

Current flowing through the coil of the relay creates a magnetic field which attracts a lever and
changes the switch contacts. The coil current can be on or off,
so relays have two switch positions and most have double
throw (changeover) switch contacts as shown in the diagram.
Relay coils may be rated 5V, 12V etc. Here the relay board has
two 5V relays. Hence, we need to apply a voltage of 5V to the
coil of the relay to switch it.
On the module we have COM, NO and NC of both relays on the
screw terminals. The power for the board and the coil need to
be supplied on the header pins. Two more header pins – in1 and
in2 are used to control the switching of the relays. If voltage level at in1 is HIGH (5v), the relay 1
will be ON and if the voltage level is LOW (0v), it will be OFF. Same applies for in2 and relay 2.
Here relay ON corresponds to the connection of COM to NO and relay OFF corresponds to
connection of COM and NC where NO is completely disconnected.

2.4 Linear Voltage Regulator:


Voltage sources in a circuit may have fluctuations resulting in not providing fixed voltage outputs.
A voltage regulator IC maintains the output voltage at a constant value. 7805 IC, a member of
78xx series of fixed linear voltage regulators used to maintain such fluctuations, is a popular
voltage regulator integrated circuit (IC). The xx in 78xx indicates the output voltage it provides.
7805 IC provides +5 volts regulated power supply with provisions to add a heat sink.
7805 IC Rating
Input voltage range 7V- 35V
Current rating Ice = 1A
Output voltage range VMax= 5.2V ,VMin= 4.8V

Pin
Function Name
No

1 Input voltage (5V-18V) Input

2 Ground (0V) Ground

3 Regulated output; 5V (4.8V-5.2V) Output

2.5 Miscellaneous:
For the power we have used the battery of the vehicle itself, which is 12V lead acid battery. We
have regulated it to 5V using the voltage regulators. For making connections, jumper wires have
been used, along with soldering at required points. An aluminum heat sink has been fitted to the
voltage regulators to dissipate the heat produced by the linear regulators.
MQTT: MQTT (Message Queuing Telemetry Transport) is an ISO standard publish-subscribe-
based messaging protocol. It works on top of the TCP/IP protocol. It is designed for connections
with remote locations where a "small code footprint" is required or the network bandwidth is
limited. The publish-subscribe messaging pattern requires a message broker. Now a days MQTT
is being used in most of the real-world applications like Facebook messenger, amazon web server,
IOT services, adafruit io etc.
Adafruit IO: Adafruit IO is a system that makes data useful. It is easy to use and allowing simple
data connections with little programming required. IO includes client libraries that have MQTT
APIs.
3. BLOCK DIAGRAM

MQTT MQTT
Client App Adafruit IO
Client App

Wi-Fi
Connection

Fingerprint
NodeMCU
Sensor

Relay
Module

Self Start Ignition

Figure 3: Basic Block Diagram


4. CIRCUIT CONNECTIONS
Below is a basic structural block diagram of how components are wired together. The circuit
representation has been made using Fritzing in breadboard layout.
Two of the GPIO pins of the controller are connected to the TX and RX pins of the fingerprint
sensor module. Two more digital GPIO pins are needed for the switching of the relays. Pins D2,D3
are for the sensor and pins D5,D6 are used for relays.
Other connections are simply supplies of +5V and GND to sensor module and relay board.
5. SOFTWARE USED
To program the NodeMCU, we can use Arduino IDE, which is the most common platform used
for projects.
The Arduino integrated development environment (IDE) is a cross-platform application (for
Windows, macOS, Linux). The Arduino IDE supports the languages C and C++ using special rules
of code structuring. The Arduino IDE supplies software libraries, which provide many common
input and output procedures. User-written code only requires two basic functions, for starting
the sketch we have void setup ( ) and the main program that runs continuously is in void loop ().
After writing the code in the library, we just need to compile the code and connect the NodeMCU
to one of the USB ports of the computer. Then we select the COM port on which our board is
available, set the board type to the desired one and click upload. During upload, the LED on the
microcontroller board flashes.
LIBRARIES USED:
We have used the following libraries in the code:-
1. <ESP8266WiFi.h> (for esp8266 Wi-Fi connection)
2. <Fingerprint.h> (for fingerprint sensor)
3. <Adafruit_MQTT.h> (for MQTT)
4. <Adafruit_MQTT_Client.h> (for MQTT)

These libraries are very useful as they reduce the code length and contain some very important
functions that can be directly called. Mostly we need to use a dedicated library for each
sensor/actuator we use. However, there is no such compulsion and simpler components can also
be controlled with coding without using libraries. Libraries are generally provided by the
hardware manufacturer to facilitate the costumers.
6. SETTING UP SERVER AND CLIENT APP
Here are the steps that can be used to set up the server and android app:

ADAFRUIT SETUP:

We can set up our Adafruit MQTT server and set up feeds using following steps:
1. Visit io.adafruit.com and sign up for a free Adafruit io account.
2. Click on Dashboards, then click on Actions drop down and create a dashboard with any
suitable name i.e. IOT Bike.
3. Click on Feeds, then click on Actions drop down to make feeds. One feed is used to control
(pub/sub) on one topic. Some examples are ‘bike ignition’ feed for controlling bike
ignition, ‘remove’ feed to delete users, etc.
4. Now we can add blocks, such as buttons, text fields, gauges, graphs etc. Each block
connects to a feed. These blocks can publish/subscribe to the feed depending on the
conditions.
5. Go to your dashboard and click on the ‘+’ icon to add a new block. Select any appropriate
block as per requirements. You will have to select the feed that you want to associate
with the block.
6. Configure the block by providing block name, values to publish, etc.
7. Take a note of your username and AIO key because you need it in the Arduino code.
8. Use the feeds in your code as per the correct syntax.

SETTING UP MQTT CLIENT APP:

1. Download MQTT client app from google play store.


2. Open the app and click on the ‘+’ button.
3. Enter the client ID of your choice.
4. In the server, write : io.adafruit.com. Use the port 1883.
5. In username and password fields, enter your Adafruit IO username and AIO key.
6. Now you will see your MQTT dashboard with publish also subscribe options.
7. Under publish, click the ‘+’ button and choose any component type. Type depends on
the use, for example for ON/OFF purpose, select a switch.
8. Give any friendly name to the component, and enter text to display. For topic, follow
the following syntax: username/feeds/feedname.
9. Enter publish values that you want to send to the feed using the button. These values
are used as the code conditions for switching.
10. Click on create. Now your component is ready.
11. Add more components to cover all functions.

USING CLIENT APP:


Once set up, open the app and select your dashboard. You can now use your buttons for
switching or any other purpose.
7. WORKING
As soon as we power the system ON through the switch, it gets distributed to the MCU, relay
board and fingerprint sensor module. The MCU starts initialization by establishing connection
with a Wi-Fi network. The network must be configured accordingly with the SSID and password
set in the code. This can be kept confidential so only authorized persons can connect to it. After
this, it also checks whether the fingerprint sensor is available.
After this, the system may enter one of the two modes:
1. ONLINE MODE:
When the system succeeds to connect to a Wi-Fi network with internet access, it connects to the
MQTT services. Now the user can control the system through the dashboard of Adafruit website
or through MQTT client android application (e.g. MQTT Dashboard). Controls are as follows:
A. Ignition: User can switch the vehicle ignition ON/OFF.
B. Self-Start: User can initiate self-start of the vehicle.
C. Register New User: The owner can add new users’ fingerprints in the system by publishing user number
and user name followed by clicking register button. After this, the sensor LED will blink continuously. The
new user can the register by putting his finger on the sensor window twice.

D. Delete Existing Users: The owner can remove any user from the record by publishing user number and
user name followed by clicking remove button. That user will no longer be able to start the vehicle by his
fingerprint. The list of user names with their number can be seen in the adafruit io website under feed
history. Along this process, the system also regularly checks if any valid finger is available on the sensor
window.

2. OFFLINE MODE:
In the initialization (setup) if the system fails to connect to Wi-Fi, it enters the offline mode. This
may happen due to the unavailability of a network with required credentials. However, a
connection is mandatory only for registration and deletion. In the offline mode, the system simply
checks fingerprint sensor availability and enters the loop. Now it regularly checks for valid
fingerprints which have already been registered. As soon as it finds one, it switches the ignition
ON and initiates self-start. The duration of the self-start is kept enough to start the bike, but not
too long as it may affect the battery.
The functional flow chart for system is shown below:
8. CHALLENGES FACED
There were some difficulties while making the project, which were eventually solved:
1. The code is very long and complicated to make and manage. Even a small mistake in the code
may lead to a lot of errors and takes a good amount of time to resolve. This was overcome by
using comments more often and by indentation.
2. All the components work at 5V, so we need to use voltage regulators. However, using a single
7805 to power everything leads to voltage drop and the relays do not function properly. Thus,
we used separate 7805 ICs. One for NodeMCU and fingerprint module, and the other one for the
relay module. A heat sink was also needed for the regulators.

9. CONCLUSION
The world is shifting towards IoT applications, there is wide range of applications which can be
controlled, analyzed and serviced over the internet. Data can be tracked to maintain things
before any wear and tear. Similarly, this project is focused on providing safety features in
vehicles as the thefts are increasing and it is easy to have clone keys. There may be situations
when we forget keys here and there, then it will be much easier to control vehicle with an app
or just by fingerprint. We have also provided controls by giving voice commands to google
assistant.
We are adding some more features like notification with location of vehicle when invalid
fingerprint is detected for several times.
IOT is surely going to change our lives with more safety and comfort.

You might also like