You are on page 1of 50

INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

CHAPTER-1
INTRODUCTION TO THE PROJECT

1.1 INTRODUCTION TO THE PROJECT

Industries of the 21st century will become more and more self-controlled and automated
due to the comfort it provides, especially when employed in a private home. An industry
automation system is a means that allow users to control electric appliances of varying kind.

Industrial automation is the use of control systems, such as computers or robots and
information technologies for handling different processes and machineries in an industry to
replace a human being. It is the second step beyond mechanization in the scope of
industrialization.

Earlier the purpose of automation was to increase productivity (since automated


systems can work 24 hours a day), and to reduce the cost associated with human operators
(i.e. wages & benefits). However, today, the focus of automation has shifted to increasing
quality and flexibility in a manufacturing process and controlling the appliances wirelessly.
Here we are doing with internet to make the device on/off without human effort

1.2 MOTIVATION

As a reason of drastic developments in the field of wireless communications these


days, the applications of this technology can be used in various sectors for making daily tasks
comfortable and easy.

One such application can be used for control of electrical appliances which results in
effective and efficient use of electrical power reducing the loss. This area has yet to be
explored in major parts of the world. So we would like to take this opportunity to put forward
a cost effective method for the wireless switching of the electrical appliances.

ECET 1
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

CHAPTER-2

LITERATURE SURVEY

2.1 EXISTING SYSTEM

An Industrial automation system is a means that allow users to control electric

appliances of varying kind. Many existing, well-established industrial automation systems are

based on wired communication. This does not pose a problem until the system is planned

well in advance and installed during the physical construction of the switching and

controlling. But for already existing switching the implementation cost goes very high and

its not secure for every time. In contrast, Wireless systems can be of great help for

automation systems. With the advancement of wireless technologies such as Wi-Fi, cloud

networks in the recent past, wireless systems are used every day and everywhere.

2.2 DISADVANTAGES OF EXISTING SYSTEM:

It requires more wired connections

Requires more time for controlling loads

We can control one load at a time

2.3 PROPOSED SYSTEM

The main aim of the design provided in this project is to develop a device to have

wireless control of Industrial electrical appliances through Internet. The device can be made

sure to be available at a low cost so that everyone can afford it. This is basically a device built

for home and Industrial appliances control system that can provide remote access to house

hold and industrial electrical appliances at low cost and in efficient way. The electrical

devices connected in the industrial area, home, office or any place, consume electrical power,

and there is an absolute necessity of saving of power as per present day situations. So it is

ECET 2
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

necessary to control electrical devices more effectively and efficiently at anytime from

anywhere. So this project is built for the sole purpose of efficient control of electrical

appliances.

This project is basically built on the process of wireless communication through the internet

network. Internet plays a very important role in the present day life of a person. Each and

every person now-a-days has a cell phone with him, and internet makes the people across the

world to communicate with each other. So as technology is increasing so vastly now-a-days,

everything in the world is being automated and wireless for the comfort of man. So here we

are building a device called IOT based on the internet network to control the electrical

appliances through a cellular phone. Here we are going to design a IOT based remote control

of electrical appliances. This system is designed for controlling arbitrary devices according to

the necessity. It includes an IOT module which is connected to the designed system. Basically

for the system to work, IOT module is and loads are interconnected with the controller

through the internet we are sending the commands to the IOT module. According to the code

it results in turning ON/OFF of the particular device. The switching of devices is achieved by

traic.

ECET 3
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

CHAPTER -3

BLOCK DIAGRAM OF THE PROJECT

3.1 BLOCK DIAGRAM

OPTOCOUPLER

Step down T/F


Bridge Rectifier Filter Circuit
Regulator
Power supply to all sections

FIG 3.1: BLOCK DIAGRAM OF THE PROJECT

ECET 4
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

3.2 BLOCK DIAGRAM DESCRIPTION

The loads are operated with the help of traic and optocoupler which are in turn
connected to the LPC2148controller.

Wifi module is connected to the controller with the help of UART pins

Firstly we should connect to wifi hotspot through our mobile

Secondly we should enter the user id & password of the wifi module i.e.(IoT &
carving notions)

If get accessed through that wifi module then we can directly control the loads in
industry

To access the loads firstly we should have two main apps in our mobile those are
device control app & things view app

From device control app we can control the loads and through things view app we can
see the status of any particular industry which are access through it

ARM 7

ARM processors are embedded in products ranging from cell/mobile phones to automotive
braking systems. A worldwide community of ARM partners and third-party vendors has
developed among semiconductor and product design companies, including hardware
engineers, system designers, and software developers.

ARM7 is one of the widely used micro-controller family in embedded system application.

This section is humble effort for explaining basic features of ARM-7. ARM is a family of
instruction set architectures for computer processors based on a reduced instruction set
computing (RISC) architecture developed by British company ARM Holdings. A RISC-based
computer design approach means ARM processors require significantly fewer transistors than
typical processors in average computers.

ECET 5
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

POWER SUPPLY

The input to the circuit is applied from the regulated power supply. The a.c. input i.e.,
230V from the mains supply is step down by the transformer to 12V and is fed to a rectifier.
The output obtained from the rectifier is a pulsating d.c voltage. So in order to get a pure d.c
voltage, the output voltage from the rectifier is fed to a filter to remove any a.c components
present even after rectification. Now, this voltage is given to a voltage regulator to obtain a
pure constant dc voltage.

LPC2148 MICROCONTROLLER

The LPC2148 microcontrollers are based on a 16-bit/32-bit ARM7TDMI-S CPU with


real-time emulation and embedded trace support, that combine microcontroller with
embedded high speed flash memory ranging from 32kB to 512kB. A 128-bit wide memory
interface and unique accelerator architecture enable 32-bit code execution at the maximum
clock rate. For critical code size applications, the alternative 16-bit Thumb mode reduces
code by more than 30 % with minimal performance penalty. Due to their tiny size and low
power consumption, LPC2148 are ideal for applications where miniaturization is a key
requirement, such as access control and point-of-sale

WI-FI

Espressif Systems Smart Connectivity Platform (ESCP) is a set of high performance, high
integration wireless SOCs, designed for space and power constrained mobile platform
designers. It provides unsurpassed ability to embed Wifi capabilities within other systems, or
to function as a standalone application, with the lowest cost, and minimal space requirement.

TRIAC
TRIAC, form Triode for Alternating Current, is a generalized trade name for an electronic
component which can conduct current in either direction when it is triggered (turned on),
and is formally called a bidirectional triode thyristor or bilateral triode thyristor

OPTOCOUPLER

ECET 6
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

An optocoupler is a semiconductor device used to transfer electrical signals between circuits


or elements of circuits while keeping them electrically isolated from each other. Optocoupler
use a beam of light to transmit the signals or data across an electrical barrier, and achieve
excellent isolation from each other.

ECET 7
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

CHAPTER 4

ARM7- LPC2148

4.1 INTRODUCTION TO ARM7

Increasingly, embedded systems developers and system-on-chip designers select


specific microprocessor cores and a family of tools, libraries, and off-the-shelf components to
quickly develop new microprocessor-based products and applications. ARM is one of the
major options available for embedded system developer. Over the last few years, the ARM
architecture has become the most pervasive 32-bit architecture in the world, with wide range
of ICs available from various IC manufacturers. ARM processors are embedded in products
ranging from cell/mobile phones to automotive braking systems. A worldwide community of
ARM partners and third-party vendors has developed among semiconductor and product
design companies, including hardware engineers, system designers, and software developers.
ARM7 is one of the widely used micro-controller family in embedded system application.
This section is humble effort for explaining basic features of ARM-7. ARM is a family of
instruction set architectures for computer processors based on a reduced instruction set
computing (RISC) architecture developed by British company ARM Holdings. A RISC-based
computer design approach means ARM processors require significantly fewer transistors than
typical processors in average computers. This approach reduces costs, heat and power use.
These are desirable traits for light, portable, battery-powered devices including smart phones,
laptops, tablet and notepad computers), and other embedded systems. A simpler design
facilitates more efficient multi-core CPUs and higher core counts at lower cost, providing
higher processing power and improved energy efficiency for servers and supercomputers.

ARM is not a microcontroller or processor but in reality, ARM is an architecture which is


used in many processors and microcontrollers. The ARM architecture licensed to companies
that want to manufacture ARM-based CPUs or System-on-Chip products.

ECET 8
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

4.1.2 ARM7 ARCHITECTURE

FIG4.1 BLOCK DIAGRAM OF ARM

Arithmetic Logic Unit (ALU)


The ALU has two 32-bits inputs. The primary comes from the register file, whereas the other
comes from the shifter. Status registers flags modified by the ALU outputs. The V-bit output
goes to the V flag as well as the Count goes to the C flag. Whereas the foremost significant
bit really represents the S flag, the ALU output operation is done by NORed to get the
Z flag. The ALU has a 4-bit function bus that permits up to 16 opcode to be implemented.

Booth Multiplier Factor


The multiplier factor has 3 32-bit inputs and the inputs return from the register file. The
multiplier output is barely 32-Least Significant Bits of the merchandise. The entity
representation of the multiplier factor is shown in the above block diagram. The

ECET 9
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

multiplication starts whenever the beginning 04 input goes active. Fin of the output goes high
when finishing.

Booth Algorithm
Booth algorithm is a noteworthy multiplication algorithmic rule for 2s complement numbers.
This treats positive and negative numbers uniformly. Moreover, the runs of 0s or 1s within
the multiplier factor are skipped over without any addition or subtraction being performed,
thereby creating possible quicker multiplication. The figure shows the simulation results
for the multiplier test bench. Its clear that the multiplication finishes only in16 clock cycle.

Barrel Shifter
The barrel shifter features a 32-bit input to be shifted. This input is coming back from the
register file or it might be immediate data. The shifter has different control inputs coming
back from the instruction register. The Shift field within the instruction controls the operation
of the barrel shifter. This field indicates the kind of shift to be performed (logical left
or right, arithmetic right or rotate right). The quantity by which the register ought to be
shifted is contained in an immediate field within the instruction or it might be the lower 6 bits
of a register within the register file.

The shift Val input bus is 6-bits, permitting up to 32 bit shift. The shift type indicates the
needed shift sort of 00, 01, 10, 11 are corresponding to shift left, shift right, an arithmetic
shift right and rotate right, respectively. The barrel shifter is especially created with
multiplexers.

Control Unit
For any microprocessor, control unit is the heart of the whole process and it is responsible for
the system operation, so the control unit design is the most important part within the whole
design. The control unit is sometimes a pure combinational circuit design. Here, the control
unit is implemented by easy state machine. The processor timing is additionally included
within the control unit. Signals from the control unit are connected to each component within
the processor to supervise its operation.

4.1.4 ARM COMPARISON

ECET 10
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

4.1.5 RISC & CISC COMPARISON

ECET 11
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

PARAMETER
RISC CISC

It stands for Reduced It stands for Complex


Acronym
Instruction Set Computer. Instruction Set Computer.

The RISC processors have a The CISC processors have a


Definition smaller set of instructions with larger set of instructions with
few addressing nodes. many addressing nodes.

It has no memory unit and It has a memory unit to


Memory unit uses a separate hardware to implement complex
implement instructions. instructions.

It has a hard-wired unit of It has a micro-programming


Program
programming. unit.

It is a complex complier
Design It is an easy complier design.
design.

The calculations are faster and The calculations are slow and
Calculations
precise. precise.

Decoding of instructions is Decoding of instructions is


Decoding
simple. complex.

Time Execution time is very less. Execution time is very high.

It does not require external It requires external memory


External memory
memory for calculations. for calculations.

Pipelining does function Pipelining does not function


Pipelining
correctly. correctly.

Stalling is mostly reduced in


Stalling The processors often stall.
processors.

Code expansion Code expansion can be a Code expansion is not a

ECET 12
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

problem. problem.

Disc space The space is saved. The space is wasted.

Used in high end applications


Used in low end applications
such as video processing,
Applications such as security systems,
telecommunications and
home automations, etc.
image processing.

4.1.6 ARM PIPELINE STAGES

A pipeline is a mechanism a RISC processor uses to execute instruction. Using a pipeline


speeds ups execution by fetching the next instruction while other instruction are being
decoded and executed.

FIG 4.2 THREE STAGE PIPELINE

Fetch loads and instruction from memory.


Decode identifies the instruction to be executed.
Execute processes the instruction and writes the result back to a register.

The above figure illustrates the pipeline using a simple example. It shows a sequence of three
instructions being fetched, decoded, and executed by the processor. Each instruction takes a
single cycle to complete after the pipeline is filled. The three instructions are placed into the
pipeline sequentially. Consider the three instructions as ADD, SUB, and CMp. In the first
cycle the core fetches and ADD instruction from memory. In the second cycle the core
fetches SUB and ADD instruction is decoded. In the third cycle both SUB and ADD are
moved along the pipeline. The ADD is executed, the SUB is decoded, ad the CMP instruction
is fetched. This procedure is called FILLING THE PIPELINE. This technique allows the core
to execute at every cycle. As the pipeline length increases, the amount of work done at each

ECET 13
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

stage is reduced, which allows the processor to attain a higher operating frequency. This in
turn increases the Performance.

4.2 LPC2148 MICROCONTROLLER

4.2.1 INTRODUCTION:

The LPC2148 microcontrollers are based on a 16-bit/32-bit ARM7TDMI-S CPU with real-
time emulation and embedded trace support, that combine microcontroller with embedded
high speed flash memory ranging from 32kB to 512kB. A 128-bit wide memory interface and
a unique accelerator architecture enable 32-bit code execution at the maximum clock rate. For
critical code size applications, the alternative 16-bit Thumb mode reduces code by more than
30 % with minimal performance penalty.

Due to their tiny size and low power consumption, LPC2148 are ideal for applications where
miniaturization is a key requirement, such as access control and point-of-sale. Serial
communications interfaces ranging from a USB 2.0 Full-speed device, multiple UARTs, SPI,
SSP to I2C-bus and on-chip SRAM of 8kB up to 40kB, make these devices very well suited
for communication gateways and protocol converters, soft modems, voice recognition and
low end imaging, providing both large buffer size and high processing power. Various 32-bit
timers, single or dual 10-bit. ADC(s), 10-bit DAC, PWM channels and 45 fast GPIO lines
with up to nine edge or level sensitive external interrupt pins make these microcontrollers
suitable for industrial control and medical systems.

4.2.2 Features:

16-bit/32-it ARM7TDMI-S microcontroller in a tiny LQFP64 package.


8 kB to 40 kB of on-chip static RAM and 32 kB to 512 kB of on-chip flash
memory. 128-bit wide interface/accelerator enables high-speed 60MHz operation.
In-System Programming/In-Application Programming (ISP/IAP) via on-chip
boot loader software. Single flash sector or full chip erase in 400 ms and
programming of 256 bytes in 1 ms.
USB 2.0 Full-speed compliant device controller with 2 kB of endpoint RAM. In
addition, the LPC2148 provides 8 kB of on-chip RAM accessible to USB by DMA.
Two 10-bit ADCs provide a total of 6/14 analog inputs, with conversion times as low
as 2.44 s per channel.

ECET 14
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

Single 10-bit DAC provides variable analog output .


Two 32-bit timers/external event counters (with four capture and four compare
channels each), PWM unit (six outputs) and watchdog.
Low power Real-Time Clock (RTC) with independent power and 32 kHz clock input.
Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus
(400 kbit/s), SPI and SSP with buffering and variable data length capabilities.
Vectored Interrupt Controller (VIC) with configurable priorities and vector
address es.
Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64
package,.
Up to 21 external interrupt pins available.
60 MHz maximum CPU clock available from programmable on-chip PLL with
Settling time of 100 s.
On-chip integrated oscillator operates with an external crystal from 1 to 25
MHz.
Power saving modes include Idle and Power-down.
Individual enable/disable of peripheral functions as well as peripheral clock
CPU operating voltage range of 3.0 V to 3.6 V (3.3 V 10 %) with 5 V
tolerant I/O pads.

ECET 15
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

4.2.3.1 Architecture Overview:

Fig 4.2.1 Architecture of LPC2148

ECET 16
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

The LPC2141/2/4/6/8 consists of an ARM7TDMI-S CPU with emulation support, the ARM7
Local Bus for interface to on-chip memory controllers, the AMBA Advanced High-
performance Bus (AHB) for interface to the interrupt controller, and the VLSI Peripheral Bus
(VPB, a compatible superset of ARMs AMBA Advanced Peripheral Bus) for connection to
on-chip peripheral functions. The LPC2141/24/6/8 configures the ARM7TDMI-S processor
in little-endian byte order. AHB peripherals are allocated a 2 megabyte range of addresses at
the very top of the 4 gigabyte ARM memory space. Each AHB peripheral is allocated a 16 kB
address space within the AHB address space. LPC2141/2/4/6/8 peripheral functions (other
than the interrupt controller) are connected to the VPB bus. The AHB to VPB bridge
interfaces the VPB bus to the AHB bus. VPB peripherals are also allocated a 2 megabyte
range of addresses, beginning at the 3.5 gigabyte address point. Each VPB peripheral is
allocated a 16 kB address space within the VPB address space. The connection of on-chip
peripherals to device pins is controlled by a Pin Connect Block. This must be configured by
software to fit specific application requirements for the use of peripheral functions and pins.

4.2.3.1 ARM7TDMI-S processor:

The ARM7TDMI-S is a general purpose 32-bit microprocessor, which offers high


performance and very low power consumption. The ARM architecture is based on Reduced
Instruction Set Computer (RISC) principles, and the instruction set and related decode
mechanism are much simpler than those of micro programmed Complex Instruction Set
Computers. This simplicity results in a high instruction throughput and impressive real-time
interrupt response from a small and cost-effective processor core.
Pipeline techniques are employed so that all parts of the processing and memory systems can
operate continuously. Typically, while one instruction is being executed, its successor is being
decoded, and a third instruction is being fetched from memory. The ARM7TDMI-S processor
also employs a unique architectural strategy known as THUMB, which makes it ideally
suited to high-volume applications with memory restrictions, or applications where code
density is an issue. The key idea behind THUMB is that of a super-reduced instruction set.
Essentially, the ARM7TDMI-S processor has two instruction sets:
The standard 32-bit ARM instruction set.
A 16-bit THUMB instruction set.

ECET 17
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

The THUMB sets 16-bit instruction length allows it to approach twice the density of
standard ARM code while retaining most of the ARMs performance advantage over a
traditional 16-bit processor using 16-bit registers. This is possible because THUMB code
operates on the same 32-bit register set as ARM code. THUMB code is able to provide up to
65% of the code size of ARM, and 160% of the performance of an equivalent ARM processor
connected to a 16-bit memory system.

4.2.4 Pin Diagram:

Fig 4.2.2 Pin diagram of LPC2148

ECET 18
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

4.2.4 PIN DESCRIPTION

ECET 19
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

ECET 20
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

ECET 21
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

ECET 22
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

4.3 Memory Organization

On-chip flash program memory:

The LPC2141/42/44/46/48 incorporate a 32 kB, 64 kB, 128 kB, 256 kB and 512 kB flash
memory system respectively. This memory may be used for both code and data storage.
Programming of the flash memory may be accomplished in several ways. It may be
programmed In System via the serial port. The application program may also erase and/or
program the flash while the application is running, allowing a great degree of flexibility for
data storage field firmware upgrades, etc. Due to the architectural solution chosen for an on-
chip boot loader, flash memory available for users code on LPC2141/42/44/46/48 is 32 kB,
64 kB, 128 kB, 256 kB and 500 kB respectively. The LPC2141/42/44/46/48 flash memory
provides a minimum of 100,000 erase/write cycles and 20 years of data-retention.

On-chip static RAM:

On-chip static RAM may be used for code and/or data storage. The SRAM may be accessed
as 8-bit, 16-bit, and 32-bit. The LPC2141, LPC2142/44 and LPC2146/48 provide 8 kB, 16
kB and 32 kB of static RAM respectively. In case of LPC2146/48 only, an 8 kB SRAM block
intended to be utilized mainly by the USB can also be used as a general purpose RAM for
data storage and code storage and execution.

Memory map:

The LPC2141/42/44/46/48 memory map incorporates several distinct regions, as shown in


Figure 5.

In addition, the CPU interrupt vectors may be remapped to allow them to reside in either
flash memory (the default) or on-chip static RAM.

ECET 23
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

ECET 24
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

4.4 Fast general purpose parallel I/O (GPIO):

Device pins that are not connected to a specific peripheral function are controlled by the
GPIO registers. Pins may be dynamically configured as inputs or outputs. Separate registers
allow setting or clearing any number of outputs simultaneously. The value of the output
register may be read back, as well as the current state of the port pins. LPC2141/42/44/46/48
introduces accelerated GPIO functions over prior LPC2000 devices:

GPIO registers are relocated to the ARM local bus for the fastest possible I/O timing.

Mask registers allow treating sets of port bits as a group, leaving other bits unchanged.

All GPIO registers are byte addressable.

Entire port value can be written in one instruction.

Features:

Bit-level set and clear registers allow a single instruction set or clear of any number of

bits in one port.

Direction control of individual bits.

Separate control of output set and clear.

All I/O default to inputs after reset.

4.5 10-bit ADC:

The LPC2141/42 contain one and the LPC2148 contain two analog to digital converters.
These converters are single 10-bit successive approximation analog to digital converters.
While ADC0 has six channels, ADC1 has eight channels. Therefore, total number of available
ADC inputs for LPC2148 is 14.

Features:

10 bit successive approximation analog to digital converter.

Measurement range of 0 V to VREF (2.0 V VREF VDDA).

Each converter capable of performing more than 400,000 10-bit samples per second.

ECET 25
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

Every analog input has a dedicated result register to reduce interrupt overhead.

Burst conversion mode for single or multiple inputs.

Optional conversion on transition on input pin or timer match signal.

Global Start command for both converters (LPC2148 only).

4.6 10-bit DAC:

The DAC enables the LPC2148 to generate a variable analog output. The maximum DAC
output voltage is the VREF voltage.

Features:

10-bit DAC.

Buffered output.

Power-down mode available.

Selectable speed versus power.

4.87UARTs:

The LPC2148 each contain two UARTs. In addition to standard transmit and receive data
lines, the LPC2148 UART1 also provide a full modem control handshake interface.
Compared to previous LPC2000 microcontrollers, UARTs in LPC2148 introduce a fractional
baud rate generator for both UARTs, enabling these microcontrollers to achieve standard
baud rates such as 115200 with any crystal frequency above 2 MHz In addition, auto-
CTS/RTS flow-control functions are fully implemented in hardware (UART1 in LPC2148
only).

Features:

16 byte Receive and Transmit FIFOs.

Register locations conform to 550 industry standard.

Receiver FIFO trigger points at 1, 4, 8, and 14 bytes

ECET 26
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

Built-in fractional baud rate generator covering wide range of baud rates without a

need for external crystals of particular values.

Transmission FIFO control enables implementation of software (XON/XOFF) flow

control on both UARTs.

LPC2144/46/48 UART1 equipped with standard modem interface signals. This

module also provides full support for hardware flow control (auto-CTS/RTS)

UART0 pin description

Pin Type Description

RXD0 Input Serial Input. Serial receive data.

TXD0 Output Serial Output. Serial transmit data

ECET 27
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

REGISTER DESCRIPTION UART0

UART 1

FEATURES

UART1 is identical to UART0, with the addition of a modem interface.

16 byte Receive and Transmit FIFOs.

Register locations conform to 550 industry standard.

Receiver FIFO trigger points at 1, 4, 8, and 14 bytes.

Built-in fractional baud rate generator with auto bauding capabilities.

Mechanism that enables software and hardware flow control implementation.

Standard modem interface signals included with flow control (auto-CTS/RTS) fully

ECET 28
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

Supported in hardware (LPC2144/6/8 only).

PIN DESCRIPTION

ECET 29
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

REGISTER DESCRIPTION OF UART1

CHAPTER -5

ECET 30
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

TECHNOLOGIES
5.1 INTRODUCTION OF IOT

WIFI MODULE
ESP8266EX

Espressif Systems Smart Connectivity Platform (ESCP) is a set of high performance, high
integration wireless SOCs, designed for space and power constrained mobile platform
designers. It provides unsurpassed ability to embed Wifi capabilities within other systems,
or to function as a standalone application, with the lowest cost, and minimal space
requirement.

ESP8266EX offers a complete and self-contained Wifi networking solution; it can be used to
host the application or to offload Wifi networking functions from another application
processor.
When ESP8266EX hosts the application, it boots up directly from an external flash. In has
integrated cache to improve the performance of the system in such applications. Alternately,
serving as a Wifi adapter, wireless internet access can be added to any micro controller-
based design with simple connectivity (SPI/SDIO or I2C/UART interface). ESP8266EX is
among the most integrated Wifi chip in the industry; it integrates the antenna switches, RF
balun, power amplifier, low noise receive amplifier, filters, power management modules, it
requires minimal external circuitry, and the entire solution, including front-end module, is
designed to occupy minimal PCB area. ESP8266EX also integrates an enhanced version of
Tensilicas L106 Diamond series 32-bit processor, with on-chip SRAM, besides the Wifi

ECET 31
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

functionalities. ESP8266EX is often integrated with external sensors and other application
specific devices through its GPIOs; sample codes for such applications are provided in the
software development kit (SDK).

5.2 ARCHITECTURE

FEATURES

ECET 32
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

802.11 b/g/n
Integrated low power 32-bit MCU
Integrated 10-bit ADC
Integrated TCP/IP protocol stack
Integrated TR switch, balun, LNA, power amplifier and matching network
Integrated PLL, regulators, and power management units
Supports antenna diversity
Wifi 2.4 GHz, support WPA/WPA2
Support STA/AP/STA+AP operation modes
Support Smart Link Function for both Android and iOS devices
SDIO 2.0, (H) SPI, UART, I2C, I2S, IR Remote Control, PWM, GPIO
STBC, 1x1 MIMO, 2x1 MIMO
A-MPDU & A-MSDU aggregation & 0.4s guard interval
Deep sleep power <10uA, Power down leakage current < 5uA
Wake up and transmit packets in < 2ms
Standby power consumption of < 1.0mW (DTIM3)
+20 dBm output power in 802.11b mode
Operating temperature range -40C ~ 125C
FCC, CE, TELEC, Wifi Alliance, and SRRC certified

PARAMETERS

ECET 33
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

Categories Items Values


Certificates FCC/CE/TELEC/SRRC
Wifi Protocols 802.11 b/g/n
Frequency Range 2.4G-2.5G (2400M-2483.5M)
802.11 b: +20 dBm
Tx Power 802.11 g: +17 dBm
Wi-Fi
802.11 n: +14 dBm
Parameters
802.11 b: -91 dbm (11 Mbps)
Rx Sensitivity 802.11 g: -75 dbm (54 Mbps)
802.11 n: -72 dbm (MCS7)
PCB Trace, External, IPEX Connector,
Types of Antenna
Ceramic Chip
UART/SDIO/SPI/I2C/I2S/IR Remote Control
Peripheral Bus
GPIO/PWM
Operating Voltage 3.0~3.6V
Operating Current Average value: 80mA
Hardware Operating Temperature
Parameters -40~125
Range
Ambient Temperature
Normal temperature
Range
Package Size 5x5mm
External Interface N/A
Wifi mode station/softAP/SoftAP+station
Security WPA/WPA2
Encryption WEP/TKIP/AES
Software
Parameters Firmware Upgrade UART Download / OTA (via network)
Supports Cloud Server Development / SDK
Software Development
for custom firmware development
Network Protocols IPv4, TCP/UDP/HTTP/FTP

ECET 34
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

Ultra Low Power Technology:

ESP8266EX has been designed for mobile, wearable electronics and Internet of Things
applications with the aim of achieving the lowest power consumption with a combination of
several proprietary techniques. The power saving architecture operates mainly in 3 modes:
active mode, sleep mode and deep sleep mode.

By using advance power management techniques and logic to power-down functions not
required and to control switching between sleep and active modes, ESP8266EX consumes
about than 60uA in deep sleep mode (with RTC clock still running) and less than 1.0mA
(DTIM=3) or less than 0.5mA (DTIM=10) to stay connected to the access point.

When in sleep mode, only the calibrated real-time clock and watchdog remains active. The
real time clock can be programmed to wake up the ESP8266EX at any required interval.
The ESP8266EX can be programmed to wake up when a specified condition is detected.
This minimal wake-up time feature of the ESP8266EX can be utilized by mobile device
SOCs, allowing them to remain in the low-power standby mode until WiFi is needed. In
order to satisfy the power demand of mobile and wearable electronics, ESP8266EX can be
programmed to reduce the output power of the PA to fit various application profiles, by
trading off range for power consumption.

Major Applications:

Major Fields of ESP8266EX applications to Internet-of-Things include:


Home Appliances
Home Automation
Smart Plug and lights
Mesh Network
Industrial Wireless Control
Baby Monitors
IP Cameras
Sensor Networks
Wearable Electronics

5.2 PIN DIAGRAM

ECET 35
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

PIN DESCRIPTION OF ESP8266:

Pin Name Type Function

ECET 36
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

1 VDDA P Analog Power 3.0 ~3.6V


RF Antenna Interface. Chip Output Impedance=50
2 LNA I/O No matching required but we recommend that the -
type matching network is retained.
3 VDD3P3 P Amplifier Power 3.0~3.6V
4 VDD3P3 P Amplifier Power 3.0~3.6V
5 VDD_RTC P NC (1.1V)
ADC Pin (note: an internal pin of the chip) can be
used to check the power voltage of VDD3P3 (Pin 3
6 TOUT I
and Pin4) or the input voltage of TOUT (Pin 6).
These two functions cannot be used simultaneously.
Chip Enable.
7 CHIP_EN I High: On, chip works properly; Low: Off, small
current
8 XPD_DCDC I/O Deep-Sleep WakeupGPIO16
9 MTMS I/O GPIO14; HSPI_CLK
10 MTDI I/O GPIO12; HSPI_MISO
11 VDDPST P Digital/IO Power Supply (1.8V~3.3V)
12 MTCK I/O GPIO13; HSPI_MOSI; UART0_CTS
13 MTDO I/O GPIO15; HSPI_CS; UART0_RTS
14 GPIO2 I/O UART Tx during flash programming; GPIO2
15 GPIO0 I/O GPIO0; SPI_CS2
16 GPIO4 I/O GPIO4
17 VDDPST P Digital/IO Power Supply (1.8V~3.3V)
Connect to SD_D2 (Series R: 200); SPIHD;
18 SDIO_DATA_2 I/O
HSPIHD; GPIO9
Connect to SD_D3 (Series R: 200); SPIWP;
19 SDIO_DATA_3 I/O
HSPIWP; GPIO10
Connect to SD_CMD (Series R: 200); SPI_CS0;
20 SDIO_CMD I/O
GPIO11
Connect to SD_CLK (Series R: 200); SPI_CLK;
21 SDIO_CLK I/O
GPIO6
Connect to SD_D0 (Series R: 200); SPI_MSIO;
22 SDIO_DATA_0 I/O
GPIO7
Connect to SD_D1 (Series R: 200); SPI_MOSI;
23 SDIO_DATA_1 I/O
GPIO8
24 GPIO5 I/O GPIO5
25 U0RXD I/O UART Rx during flash programming; GPIO3
UART Tx during flash programming; GPIO1;
26 U0TXD I/O
SPI_CS1
Connect to crystal oscillator output, can be used to
27 XTAL_OUT I/O
provide BT clock input

28 XTAL_IN I/O Connect to crystal oscillator input


29 VDDD P Analog Power 3.0V~3.6V

ECET 37
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

30 VDDA P Analog Power 3.0V~3.6V


Serial connection with a 12 k resistor and connect
31 RES12K I
to the ground
32 EXT_RSTB I External reset signal (Low voltage level: Active)

CHAPTER -6

FUNCTIONAL BLOCKS OF THE PROJECT

ECET 38
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

6.1 OPTOCOUPLER

There are many situations where signals and data need to be transferred from one
subsystem to another within a piece of electronics equipment, or from one piece of equipment
to another, without making a direct ohmic electrical connection. Often this is because the
source and destination are (or may be at times) at very different voltage levels, like a
microprocessor which is operating from 5V DC but being used to control a triac which is
switching 240V AC. In such situations the link between the two must be an isolated one, to
protect the microprocessor from overvoltage damage.

Relays can of course provide this kind of isolation, but even small relays tend to be fairly
bulky compared with ICs and many of todays other miniature circuit components. Because
they are electro-mechanical, relays are also not as reliable and only capable of relatively low
speed operation. Where small size, higher speed and greater reliability are important, a much
better alternative is to use an optocoupler.

Optocoupler use a beam of light to transmit the signals or data across an electrical barrier, and
achieve excellent isolation.

Optocoupler typically come in a small 6-pin or 8-pin IC package, but are essentially a
combination of two distinct devices: an optical transmitter, typically a gallium arsenide LED
(light-emitting diode) and an optical receiver such as a phototransistor or light-triggered diac.
The two are separated by a transparent barrier which blocks any electrical current flow
between the two, but does allow the passage of light.

An optocoupler is a combination of a light source and a photosensitive detector. In the


optocoupler, or photon coupled pair, the coupling is achieved by light being generated on one
side of a transparent insulating gap and being detected on the other side of the gap without an
electrical connection between the two sides (except for a minor amount of coupling
capacitance). In the Fairchild Semiconductor optocoupler, the light is generated by an
infrared light emitting diode, and the photo-detector is a silicon diode which drives an
amplifier, e.g., transistor. The sensitivity of the silicon material peaks at the wavelength
emitted by the LED, giving maximum signal coupling.

Fig: Circuit symbol

ECET 39
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

Usually the electrical connections to the LED section are brought out to the pins on one side
of the package and those for the phototransistor or traic to the other side, to physically
separate them as much as possible. This usually allows optocoupler to withstand voltages of
anywhere between 500V and 7500V between input and output. Optocoupler are essentially
digital or switching devices, so they are best for transferring either on-off control signals or
digital data. Analog signals can be transferred by means of frequency or pulse-width
modulation.

Key Parameters:

The most important parameter for most optocoupler is their transfer efficiency, usually
measured in terms of their current transfer ratio or CTR. This is simply the ratio between a
current change in the output transistor and the current change in the input LED which
produced it. Typical values for CTR range from 10% to 50% for devices with an output
phototransistor and up to 2000% or so for those with a Darlington transistor pair in the
output.

Other optocoupler parameters include the output transistors maximum collector-emitter


voltage rating VCE(max), which limits the supply voltage in the output circuit; the input
LEDs maximum current rating IF(max), which is used to calculate the minimum value for its
series resistor; and the optocoupler bandwidth, which determines the highest signal frequency
that can be transferred through it determined mainly by internal device construction and the
performance of the output phototransistor. Typical optocoupler with a single output
phototransistor may have a bandwidth of 200 - 300kHz, while those with a Darlington pair
are usually about 10 times lower, at around 20 - 30kHz.

How they are used:

Basically the simplest way to visualize an optocoupler is in terms of its two main
components: the input LED and the output transistor or traic. As the two are electrically

ECET 40
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

isolated, this gives a fair amount of flexibility when it comes to connecting them into circuit.
All we really have to do is work out a convenient way of turning the input LED on and off,
and using the resulting switching of the phototransistor/traic to generate an output waveform
or logic signal that is compatible with our output circuitry.

Fig.3: Protecting the LED against reverse voltage.

The optocoupler used in this project is MOC3021 and four such optocoupler are used here.
The features, description and applications of this IC are discussed in the next topics.

Description:

The MOC3021 series of optically coupled isolators consist of infrared light emitting diode
and NPN silicon photo transistor in a standard 6 pin dual in line plastic package.

Features:

Options :-
10mm lead spread - add G after part no.

Surface mount - add SM after part no.

Tape and reel - add SMT&R after part no.

ECET 41
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

High Isolation Voltage (5.3kVRMS ,7.5kVPK ).


All electrical parameters 100% tested.
Custom electrical selections available.

ABSOLUTE MAXIMUM RATINGS


(25C unless otherwise specified)

Storage Temperature -55C to + 150C


Operating Temperature -55C to + 100C
Lead Soldering Temperature
(1/16 inch (1.6mm) from case for 10 secs) 260C

Input diode
Forward Current 60mA
Reverse Voltage 6V
Power Dissipation 105mW

Output transistor
Collector-emitter Voltage BVCEO 30V
Collector-base Voltage BVCBO 70V
Emitter-collector Voltage BVECO 6V
Power Dissipation 160mW

Power dissipation
Total Power Dissipation 200mW
(linearly 2.67mW/C above 25C)

ECET 42
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

Fig: Electrical Characteristics

Note 1 Measured with input leads shorted together and output leads shorted together.

Note 2 Special Selections are available on request. Please consult the factory.

APPLICATIONS

DC motor controllers
Industrial systems controllers
Measuring instruments
Signal transmission between systems of different potentials and impedances

ECET 43
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

6.2 TRAIC:

TRIAC, from Triode for Alternating Current, is a generalized trade name for
an electronic component which can conduct current in either direction when it is
triggered (turned on), and is formally called a bidirectional triode thyristor or bilateral
triode thyristor.

A TRIAC is approximately equivalent to two complementary unilateral thyristors


(one is anode triggered and another is cathode triggered SCR) joined in inverse
parallel (paralleled but with the polarity reversed) and with their gates connected together. It
can be triggered by either a positive or a negative voltage being applied to its gate electrode
(with respect to A1, otherwise known as MT1). Once triggered, the device continues to
conduct until the current through it drops below a certain threshold value, the holding current,
such as at the end of a half-cycle of alternating current (AC) mains power. This makes the
TRIAC a very convenient switch for AC circuits, allowing the control of very large power
flows with mill-scale control currents. In addition, applying a trigger pulse at a controllable
point in an AC cycle allows one to control the percentage of current that flows through the
TRIAC to the load (phase control).

ECET 44
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

Low power TRIACs are used in many applications such as light dimmers, speed
controls for electric fans and other electric motors, and in the modern computerized control
circuits of many household small and major appliances. However, when used
with inductive loads such as electric fans, care must be taken to assure that the TRIAC will
turn off correctly at the end of each half-cycle of the AC power. A snubber circuit (usually of
the RC type) is often used between A1 and A2 to assist this turn-off. Snubber circuits are also
used to prevent premature triggering, caused for example by voltage spikes in the mains
supply. Also, a gate resistor or capacitor (or both in parallel) may be connected between gate
and A1 to further prevent false triggering. That, however, increases the required trigger
current and / or adds latency (capacitor charging).

Fig: Some examples


of Traic

ECET 45
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

For higher-powered, more-demanding loads, two SCRs in inverse parallel may be


used instead of one TRIAC. Because each SCR will have an entire half-cycle of reverse
polarity voltage applied to it, turn-off of the SCRs is assured, no matter what the character of
the load. However, due to the separate gates, proper triggering of the SCRs is more complex
than triggering a TRIAC.

In addition to commutation, a TRIAC may also not


turn on reliably with non-resistive loads if the phase shift of the current prevents
achieving holding current at trigger time. To overcome that, pulse trains may be used to
repeatedly try to trigger the TRIAC until it finally turns on. The advantage is that the gate
current does not need to be maintained throughout the entire conduction angle, which can be
beneficial when there is only limited drive capability available.

6.3 POWER SUPPLY

The input to the circuit is applied from the regulated power supply. The a.c. input i.e.,
230V from the mains supply is step down by the transformer to 12V and is fed to a rectifier.
The output obtained from the rectifier is a pulsating d.c voltage. So in order to get a pure d.c
voltage, the output voltage from the rectifier is fed to a filter to remove any a.c components
present even after rectification. Now, this voltage is given to a voltage regulator to obtain a
pure constant dc voltage.

230V AC D.C
Output
50Hz

ECET 46
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

Step down Bridge Regulator


transform Rectifie
er r Filter

Fig: Power supply

Transformer:
Usually, DC voltages are required to operate various electronic equipment and these
voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus the a.c input
available at the mains supply i.e., 230V is to be brought down to the required voltage level.
This is done by a transformer. Thus, a step down transformer is employed to decrease the
voltage to a required level.

Rectifier:
The output from the transformer is fed to the rectifier. It converts A.C. into pulsating
D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a bridge rectifier
is used because of its merits like good stability and full wave rectification.

ECET 47
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

The Bridge rectifier is a circuit, which converts an ac voltage to dc voltage using both half
cycles of the input ac voltage. The Bridge rectifier circuit is shown in the figure. The circuit
has four diodes connected to form a bridge. The ac input voltage is applied to the diagonally
opposite ends of the bridge. The load resistance is connected between the other two ends of
the bridge.

For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct, whereas diodes
D2 and D4 remain in the OFF state. The conducting diodes will be in series with the load
resistance RL and hence the load current flows through RL.

For the negative half cycle of the input ac voltage, diodes D2 and D4 conduct whereas, D1
and D3 remain OFF. The conducting diodes D2 and D4 will be in series with the load
resistance RL and hence the current flows through RL in the same direction as in the previous
half cycle. Thus a bi-directional wave is converted into a unidirectional wave.

ECET 48
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

Filter:
Capacitive filter is used in this project. It removes the ripples from the output of
rectifier and smoothens the D.C. Output received from this filter is constant until the mains
voltage and load is maintained constant. However, if either of the two is varied, D.C. voltage
received at this point changes. Therefore a regulator is applied at the output stage.

ECET 49
INDUSTRIAL DEVICE CONTROL OVER IOT BASED WIFI MODULE ECE

Voltage regulator:
As the name itself implies, it regulates the input applied to it. A voltage regulator is an
electrical regulator designed to automatically maintain a constant voltage level. In this
project, power supply of 5V and 12V are required. In order to obtain these voltage levels,
7805 and 7812 voltage regulators are to be used. The first number 78 represents positive
supply and the numbers 05, 12 represent the required output voltage levels. The L78xx series
of three-terminal positive regulators is available in TO-220, TO-220FP, TO-3, D2PAK and
DPAK packages and several fixed output voltages, making it useful in a wide range of
applications. These regulators can provide local on-card regulation, eliminating the
distribution problems associated with single point regulation. Each type employs internal
current limiting, thermal shut-down and safe area protection, making it essentially
indestructible. If adequate heat sinking is provided, they can deliver over 1 A output current.
Although designed primarily as fixed voltage regulators, these devices can be used with
external components to obtain adjustable voltage and currents.

ECET 50

You might also like