Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 67

ABSTRACT

The aim of the project is to design a user-friendly system which can used for the food
ordering and maintenance system through IoT.

Now a day’s Many real time applications connected to web(internet). This is very use full
and help full for customers to see application(requirements) from anywhere in the world. These
webs connected applications are belongs to server client relation. TCP, UDP and HTTP
protocols are used in this concept. Data transfer to web server through Wi-Fi/GPRS (General
packet radio services) communication. We can transfer long data through this Wi-Fi/GPRS.
Many Embedded Networking applications coming under this model only.

This project is built on Node MCU with functional keys. And also, we are using
ESP32/Node MCU module for internet facility. When we press any functional key, it can give a
respected signal to NODE MCU controller. Then NODE MCU can send the information to
respected restaurant/kitchen through IoT. And also, we are using 16X2 LCD in order to display
the status/information.

When order can receive by the restaurant, then the restaurant persons give us the reply
regarding our order. When we get the status of our order through IoT, it should be displayed on
16X2 LCD. According this we can proceeds for further orders.

This project uses regulated 5V, 500mA power supply. 7805 three terminal voltage
regulator is used for voltage regulation. Full wave bridge rectifier is used to rectify the ac output
of secondary of 230/12V step down transformer.

1
LIST OF FIGURES

1. System Block Diagram………………………………....…………………………………….10

2. Circuit Diagram of System……………………………………………………………...….…11

3. Block Diagram of Power Supply ………………………....................................................…13

4. Voltage regulator of 5 V …………….....................................................................................15

5. Voltage Regulator of 12 V………………………………………….......................................15

6. IC-LM7812 ……………………………………………………………...………….….…….16

7. Outline dimension of Diode IN4007 …………….…….………………………………...…. 18

8. Capacitor ….………………………………………….…………………………………....….20

9. Capacitor Charge and Discharge Graph ……….……………………………………...…. ….21

10. Resistor…………………………………………………….………………………………...22

11. Light Emitting Diode……………………….…………………………………….…….….23

12. Block diagram of Microcontroller Unit ………....................................................................25

13. Pin diagram of AVR at mega 16 ……………………...………………………………….…27

14. Zigbee Interfacing……………………………….………………………………………. ….33

15. Pin diagram of Zigbee……………………………………………………………………….35

16. Zigbee Network Topologies………………………….……………………………………...37

17. LCD connection…………………………………………………………………………......39

18. LCD Interfacing Using AVR…………………………….………………………….……….41

2
INDEX

1. Title page……………………………………………………………………………………….1

2. Certificate……………………………………………………………………………………….2

3. Acknowledgement …………………………………………………………………………….3

4. Abstract………………………………………….…….……………………………………….4

5. List of figures……………………………………………………………………………………

5. CH: 1 Introduction …...…………………………………………………………………...……8

1.1 Introduction……………………………………………………………………………9

1.2 System description…………………………………………………………………….9

1.3 Block diagram of system………………………………………………………….…10

1.4 Circuit diagram of system……………………………………………………………11

6. CH: 2 Power Supply Design ..............................….................................................................12

2.1 Block diagram of power supply………………………………………………….…13

2.2 Transformer………………………………………………………………………….13

2.3 Bridge rectifier………………………………………………………………………13

2.4 IC- voltage regulator……………………………………………………………...…15

2.5 Capacitor…………………………………………………………………………….20

2.6 Resistor…………………………………………………………………………...…22

2.7 LED…………………………………………………………………………………22

7. CH: 3 Microcontroller unit…………...…………….………….……………………………...24

3
3.1 Microcontroller for embedded system……………………...………………………25

3.2 AVR microcontroller……………………………………………………………….26

8. CH: 4 Zigbee Module…….…………………….....................................................................32

4.1 Introduction………………………………………………………………………...33

4.2 Zigbee module……………………………………………………………………...34

4.3 Pin diagram of Zigbee……………………………………………………………...35

4.4 Zigbee network topologies…………………………………………………………37

9. CH: 5 Interfacing Devices ………………...………….….…………………………………...38

5.1 LCD………………………………………………………………………………...39

5.2 LCD characteristics…………………………………………………………………40

5.3 LCD interfacing using AVR……………………………………………………….41

5.4 Keypad……………………………………………………………………………...42

10. Future work…………….……………………………………………………………………43

11. Conclusion …………………………………….……...………………………………….…44

12. References ……………………………………………...……………………………………45

4
Chapter 1: Introduction
1.1 INTRODUCTION
Wireless technology is becoming more and more popular because of its low cost and ease-
of-use. This technology allows us a faster and more convenient access to the world. NODE MCU
technology provides the world with a variety of wireless applications. The Restaurant
Automation not only gives the customers an insight into how their food is being prepared. it
gives the communication between user and kitchen chaff, here we are giving the update from
user to chaff regarding order and take the response from chaff, and the response of chaff
forwarding to user about their orders. It is amazing that the customers can actually see their order
status from the restaurant. The Restaurant automation is a revolutionary concept & is sure to take
people by surprise. It will undoubtedly change the way people dine & their dining habits. It
would lead to increased revenues; give the customer a better insight into the kind of food they
wish eat, those food the restaurant can make or not, given them a great touch experienced.

1.2 SYSTEM DESCRIPTION

This project provides a low-cost, convenient and easy to use system for automating order
placement system for restaurants. Each table of restaurant has a menu display unit which is
powered by microcontroller. The client will scroll menu list using keypad provided along with.
Customer could order his food or drink just using this keypad. Our aim is to build an automated
order maintenance system. We shall provide each table with a microcontroller-based order
placement unit. The unit shall have a keypad to browse through the menu. The menu items, their
cost and information shall be displayed on the LCD connected to microcontroller. User can
navigate through menu using keypad provided. The data for the menu can be written on an
EEPROM connected to each such microcontroller-based unit, so that portable data updating is
possible (by changing only the EEPROM). Upon finalizing the order, the user will be able to
place it using keypad. The order placed shall be transmitted to the central server (PC) which will
also have a NODE MCU module connected to it for data reception. Multiple such slave units can
be installed.

5
1.3 BLOCK DAIGRAM

Block diagram:
Power E 16X2
User Section:
Supply S LCD
CLOUD
P

FUNCTIONAL Wi-Fi
KEYS
3

Restaurant Section: Power E 16X2


Supply S LCD
P
CLOUD

FUNCTIONAL

KEYS
3 Wi-Fi
2

[Figure: 1. System block diagram]

6
1.4. CIRCUIT DAIGRAM

[Figure: 2. Circuit diagram of system]

7
Chapter 2: Power Supply
design
2.1 BLOCK DIAGRAM OF POWER SUPPLY
The AC voltage typically 220 V RMS is connected to a transformer, which steps that AC
voltage down to the level of the desired DC output. A diode rectifier then provides full wave
rectified voltage that is initially filtered by simple capacitor filter to produce a DC voltage. This
resulting DC voltage usually has some ripple or AC voltage variation.

A regulator circuit removes the ripple and also remains the same DC value even if the input
DC varies or the load connected to the output DC voltage changes. This voltage regulation is
usually obtained using one of the popular voltage regulator IC units.

Step down
Bridge Filter Regulator Output
Transformer
Rectifier

[Figure: 3. block diagram of power supply]

2.2 TRANSFORMER
The potential transformer will step down the power supply voltage (0-230V) to (0-6V) level.
Then the secondary of the potential transformer will be connected to the precision rectifier,
which is constructed with the help of op–amp. The advantages of using precision rectifier are it
will give peak voltage output as DC; rest of the circuits will give only RMS output.

8
2.3 BRIDGE RECTIFIER
When four diodes are connected as shown in figure, the circuit is called as bridge
rectifier. The input to the circuit is applied to the diagonally opposite corners of the network, and
the output is taken from the remaining two corners. Let us assume that the transformer is
working properly and there is a positive potential, at point A and a negative potential at point B.
the positive potential at point A will forward bias D3 and reverse bias D4.

The negative potential at point B will forward bias D1 and reverse D2. At this time D3
and D1 are forward biased and will allow current flow to pass through them; D4 and D2 are
reverse biased and will block current flow. The path for current flow is from point B through D1,
up through RL, through D3, through the secondary of the transformer back to point B. this path
is indicated by the solid arrows. Waveforms (1) and (2) can be observed across D1 and D3.

One-half cycle later the polarity across the secondary of the transformer reverse, forward
biasing D2 and D4 and reverse biasing D1 and D3. Current flow will now be from point A
through D4, up through RL, through D2, through the secondary of T1, and back to point A. This
path is indicated by the broken arrows. Waveforms (3) and (4) can be observed across D2 and
D4. The current flow through RL is always in the same direction. In flowing through RL this
current develops a voltage corresponding to that shown waveform (5). Since current flows
through the load (RL) during both half cycles of the applied voltage, this bridge rectifier is a full-
wave rectifier.

One advantage of a bridge rectifier over a conventional full-wave rectifier is that with a
given transformer the bridge rectifier produces a voltage output that is nearly twice that of the
conventional full-wave circuit. This may be shown by assigning values to some of the
components shown in views A and B. assume that the same transformer is used in both circuits.
The peak voltage developed between points X and y is 1000 volts in both circuits. In the
conventional full-wave circuit shown—in view A, the peak voltage from the center tap to either
X or Y is 500 volts. Since only one diode can conduct at any instant, the maximum voltage that
can be rectified at any instant is 500 volts. The maximum voltage that appears across the load
resistor is nearly-but never exceeds-500 v0lts, as result of the small voltage drop across the
diode. In the bridge rectifier shown in view B, the maximum voltage that can be rectified is the

9
full secondary voltage, which is 1000 volts. Therefore, the peak output voltage across the load
resistor is nearly 1000 volts. With both circuits using the same transformer, the bridge rectifier
circuit produces a higher output voltage than the conventional full-wave rectifier circuit.

2.4 IC-VOLTAGE REGULATOR


Voltage regulators comprise a class of widely used ICs. Regulator IC units contain the
circuitry for reference source, comparator amplifier, control device, and overload protection all
in a single IC. IC units provide regulation of either a fixed positive voltage, a fixed negative
voltage, or an adjustably set voltage. The regulators can be selected for operation with load
currents from hundreds of milli amperes to tens of amperes, corresponding to power ratings from
mill watts to tens of watts.

[
Figure:4. Voltage regulator of 5V]

10
[Fig
ure: 5. Voltage regular of 12 V]

A fixed three-terminal voltage regulator has an unregulated dc input voltage, Vi, applied
to one input terminal, a regulated dc output voltage, Vo, from a second terminal, with the third
terminal connected to ground.

The series 78 regulators provide fixed positive regulated voltages from 5 to 24 volts.
Similarly, the series 79 regulators provide fixed negative regulated voltages from 5 to 24 volts.

 For ICs, microcontroller, LCD --------- 5 volts


 For alarm circuit, op-amp, relay circuits ---------- 12 volts

IC LM7812

This circuit provides ±12V regulated DC output based on LM7812 that are National
Semiconductors’ two of the most popular positive and negative three terminal voltage regulators.
The circuit is supported by a handful of capacitors. 12-volt power supply circuit is very simple
and easy to make, all the components readily available in the market. Quality of power supply
output voltage of 12 volts is very stable and capable of delivering up to 1 ampere current source.

11
[Figure: 6. IC LM7812]

DESCRIPTION SYMBOL VALUE UNIT

Input Voltage VIN


35 to 40 V

Power Dissipation PD
15 W

Operating Temperature Tomb


-20 to +80 °C

Storage Temperature Range T.Sgt.


-55 to +150 °C

[Table: 1. Absolute maximum ratings]

12
This power supply circuit can be used to supply voltage to the electronic device needs 12-
volt input voltage source. Complete image series and the components used to assemble the
power supply 12-volt LM7812 can be seen in the following.

Step-down section, this section serves lower voltage AC 220 volts to 18 volts. Components
used are18 volt transformer 2A without CT. Rectifier section, this section serves to rectify the
AC voltage from the Transformer. Component is used as a diode bridge rectifiers D1 4A and
electrolytic capacitors C1 µF/25V 3300. Part of regulators, this section serves to control the
output voltage of the Power supply voltage to be stable at 12 volts DC. Section is organized by
the Regulator.

IC LM7812 positive voltage regulator and capacitor. Indicator section, this section serves to
provide a sign or signal conditions with a marked power supply LED flame alive. Here is a very
simple and useful project of a 12V power supply circuit using LM7812 IC.  LM7812 is a three
terminal fixed voltage regulator IC comes in TO220 package. It has many built in features like
thermal shutdown, short circuit protection, safe operating area protection etc. The output current
of the IC is 1A which is enough to run most electronic devices.

DIODE IN4007

The p-n junction itself forms the basic semiconductor called semiconductor diode. Thus,
semiconductor diode and the p-n junction are one and the same.
The meaning of the term “diode” is the device having “two electrodes”, the diode has two
electrodes one each for the two regions on either side of the junction.
The two electrodes are named as anode and cathode. The current will flow through the diode
if and only if an external voltage source is connected to it with appropriate polarities.

13
[Figure: 7. Outline dimensions of diode IN4007]

FEATURES

 The plastic package carries Underwrites Laboratory Flammability Classification 94V-0.


 Construction utilizes void-free molded plastic technique.
 Low reverse leakage.
 High forward surge current capability.
 High temperature soldering guaranteed: 250 /10 seconds, 0.375"(9.5mm) lead length,
5lbs. (2.3kg).

MECHANICAL DATA

 Case: JEDEC DO-41 molded plastic body.


 Terminals: lead solder able per MIL-STD-750, method 2026.
 Polarity: color band denotes cathode end.
 Mounting Position: Any.
 Weight: 0.33 g

14
[Table: -2 Maximum rating and electrical characteristics

15
2.5 CAPACITOR

[Figure: 8. Capacitor]

A capacitor is an electrical device that has, in DC circuits, the purpose of storing energy. In
particular, it stores an electrical charge. Two flat metal plates are placed close to each other (but
not touching) and are connected to a battery through a switch.

If the switch is opened after the plates have been charged in this way, the top plate is left
with a deficiency of electrons and the bottom plate with an excess. Since there is no current path
between the two, the plates remain charged despite the fact that the battery no longer is
connected.

The charge or quantity of electricity that can be held in the electric field between the
capacitor plates is proportional to the applied voltage and to the capacitance of the capacitor: 

Q = C * V

Were,

Q = charge in coulombs

C = capacitance in farads

V = voltage in volts

16
The energy stored in a capacitor is also a function of voltage and capacitance: 

W = V2 * C / 2

 Were,

W = energy in joules (watt-seconds)

V = voltage in volts

C = capacitance in farads

A capacitor stores energy, and we can use a capacitor is a device that stores electric charge.
A capacitor consists of two conductors separated by an insulator it to make a quick and powerful
electric discharge to propel our projectile.

Parallel-Plate Capacitor Cylindrical Capacitor A cylindrical capacitor is a parallel-plate


capacitor that has been rolled up with an insulating layer between the plates.

[Figure: 9. Capacitor charge & discharge graph]

17
2.6 RESISTOR
A resistor is an electrical component that limits or regulates the flow of electrical current in
an electronic circuit. Resistors can also be used to provide a specific voltage for an active device
such as a transistor Resistors can be fabricated in a variety of ways. The most common type in
electronic devices and systems is the carbon-composition resistor. Fine granulated carbon
(graphite) is mixed with clay and hardened. The resistance depends on the proportion of carbon
to clay; the higher this ratio, the lower the resistance.

A device used in electrical current conduction to control the direction of the current flowing


to a circuit by applying resistance. Resistors may be fixed or variable, both controlling the flow
of current differently.

[Figure: 10. Resistor]

2.7 LIGHT EMITING DIODE (LED)


A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator
lamps in many devices, and are increasingly used for lighting. The LED is based on
the semiconductor diode. When a diode is forward biased (switched on), electrons are able
to recombine  with holes within the device, releasing energy in the form of photons.

18
An LED is usually small in area (less than 1 mm2), and integrated optical components are
used to shape its radiation pattern and assist in reflection. LEDs present many advantages over
incandescent light sources including lower energy consumption, longer lifetime, improved
robustness, smaller size, faster switching, and greater durability and reliability.

[Figure: 11. LED]

APPLICATIONS

 Moving Message Display.


 Banking Board.
 Digital Display.
 Full Color Display.
 Score Boards.
 Infrared remote controls.
 In the optocouplers.

19
Chapter 3: NODE MCU Unit

3.1 NodeMCU

NodeMCU v3 is a development board which runs on the ESP8266 with the expressive non-OS
SDK, and hardware based on the ESP-12 module. The device features 4MB of flash memory,
80MHz of system clock, around 50k of usable RAM and an on chip WIFI Transceiver.

Fig 1.1 NodeMcu

20
3.2 Pin Mapping

Fig 3.2 pin mapping

3.3 Flash Layout

The NodeMCU v3 device features a 4 MB (32 Mb) flash memory organized in sectors of 4k
each. The flash memory address starts at 0x40200000 and can be read and written from a
Zerynth program using the internal flash module.

3.4 Warning

If flash memory must be used in a Zerynth program, it is recommended to begin using it from
secure addresses towards the end the bytecode (start address of the bytecode can be found in the
log console of Zerynth Studio during the uplink operation), leaving a minimum safe place to
minimize the chance of clashes.

Note

The internal flash of NodeMCU v3 can be organized in different ways. The standard VM is a
non-FOTA VM with the VM code beginning at 0x0000, followed by the esp8266 ir0m image at
0x20000 and the esp_init_data at 0x3fc000. The VM is based on the Expressive RTOS SDK
1.4.1.

3.5 Device Summary

 Microcontroller: Ten silica 32-bit RISC CPU Xtensa LX106

21
 Operating Voltage: 3.3V

 Input Voltage: 7-12V

 Digital I/O Pins (DIO): 16

 Analog Input Pins (ADC): 1

 UARTs: 1

 SPIs: 1

 I2Cs: 1

 Flash Memory: 4 MB

 SRAM: 64 KB

 Clock Speed: 80 MHz

 Wi-Fi: IEEE 802.11 b/g/n:


 Integrated TR switch, balun, LNA, power amplifier and matching network

 WEP or WPA/WPA2 authentication, or open networks

3.6 Power

Power to the NodeMCU v3 is supplied via the on-board USB Micro B connector or directly via
the “VIN” pin. The power source is selected automatically.

The device can operate on an external supply of 6 to 20 volts. If using more than 12V, the
voltage regulator may overheat and damage the device. The recommended range is 7 to 12 volts.

3.7 Connect, Register, Virtualize and Program

The NodeMCU v3 exposes the serial port of the ESP8266 module via CH340 USB to UART
chip which is also connected to the boot pins of the module, allowing for a seamless
virtualization of the device.

22
Note

Drivers for the CH340 Module can be downloaded here and are needed for Windows and Mac
platforms.

Note

For Linux Platform: to allow the access to serial ports the user needs read/write access to the
serial device file. Adding the user to the group, that owns this file, gives the required read/write
access: Ubuntu distribution –> dial out group; Arch Linux distribution –> uucp group.

Once connected to a USB port the NodeMCU v3 device can be seen as a Virtual Serial port and
it is automatically recognized by Zerynth Studio. The next steps are:

 Select the NodeMCU v3 on the Device Management Toolbar (disambiguate if necessary);

 Register the device by clicking the “Z” button from the Zerynth Studio;

 Create a Virtual Machine for the device by clicking the “Z” button for the second time;

 Virtualize the device by clicking the “Z” button for the third time.

Note

No user intervention on the device is required for registration and virtualization process.

After virtualization, the NodeMCU v3 device is ready to be programmed and the Zerynth
scripts uploaded. Just Select the virtualized device from the “Device Management Toolbar”
and click the dedicated “upload” button of Zerynth Studio.

Note

No user intervention on the device is required for the upload process.

Important

23
To exploit the Wi-Fi chip functionalities of the NodeMCU v3, the lib. espressif. esp8266wifi
library must be installed (some example code is provided).

3.8 Firmware Over the Air update (FOTA)

The Firmware Over the Air feature allows to update the device firmware at runtime. Zerynth
FOTA in the NodeMCU v3 device is available for bytecode only.

Flash Layout is shown in table below:

Start address Size Content


0x40200000 448Kb VM Slot
0x40270000 256Kb Bytecode Slot 0
0x402B0000 320Kb Bytecode Slot 1

Important

FOTA Record (small segment of memory where the current and desired state of the firmware is
store) for the NodeMCU v3 is allocated in the RTC memory.

3.9 Power Management

Power Management feature allows to optimize power consumption by putting the device in low
consumption state. More information in Power Management - ESP8266 section.

24
Chapter 4: EMBEDDED
SYSTEM
4. INTRODUCTION TO EMBEDDED SYSTEM

An Embedded system is a computer system designed for specific control functions within a
larger system and often with real-time computing constraints. It is embedded as part of a
complete device often including hardware and mechanical parts. By contrast, a general-purpose
computer, such as a personal computer (PC), is designed to be flexible and to meet a wide range
of end-user needs. Embedded systems control many devices in common use today.

Embedded systems contain processing cores that are typically either microcontrollers or
digital signal processors (DSP). The key characteristic, however, is being dedicated to handle a
particular task. They may require very powerful processors and extensive communication, for
example air traffic control systems may usefully be viewed as embedded, even though they
involve mainframe computers and dedicated regional and national networks between airports and
radar sites (each radar probably includes one or more embedded systems of its own).

Since the embedded system is dedicated to specific tasks, design engineers can optimize it to
reduce the size and cost of the product and increase the reliability and performance. Some
embedded systems are mass-produced, benefiting from economies of scale.

Physically, embedded systems range from portable devices such as digital watches and MP3
players, to large stationary installations like traffic lights, factory controllers, or the systems
controlling nuclear power plants. Complexity varies from low, with a single microcontroller
chip, to very high with multiple units, peripherals and networks mounted inside a large chassis or
enclosure.

In general, "embedded system" is not a strictly definable term, as most systems have some
element of extensibility or programmability. For example, handheld computers share some

25
elements with embedded systems such as the operating systems and microprocessors that power
them, but they allow different applications to be loaded and peripherals to be connected.
Moreover, even systems that do not expose programmability as a primary feature generally need
to support software updates. On a continuum from "general purpose" to "embedded", large
application systems will have subcomponents at most points even if the system as a whole is
"designed to perform one or a few dedicated functions", and is thus appropriate to call
‘embedded’.

An embedded system is not a computer system that is used primarily for processing, not a
software system on PC or UNIX, not a traditional business or scientific application. High-end
embedded & lower end embedded systems. High-end embedded system - Generally 32, 64 Bit
Controllers used with OS. Examples Personal Digital Assistant and Mobile phones etc... Lower
end embedded systems - Generally 8,16 Bit Controllers used with a minimal operating systems
and hardware layout designed for the specific purpose.

Figure 4.1: Embedded system design calls

26
Figure 4.2: V Diagram

Examples of Embedded Systems:

Embedded systems are found in wide range of application areas. Originally, they were
used only for expensive industrial control applications, but as technology brought down the cost
of dedicated processors, they began to appear in moderately expensive applications such as
automobiles, communication and office equipment’s and television Today's embedded systems
are so inexpensive that they are used in almost every electronic product in our life. Embedded
systems are often designed for mass production.

Some examples of embedded systems:

1. Automatic Teller Machines


2. Cellular telephone and telephone switches
3. Computer network equipment
4. Computer printers
5. Disk drives
6. Engine controllers and antilock brake controllers for automobiles
7. Home automation products

27
8. Handheld calculators
9. Household appliances
10. Medical equipment
11. Measurement equipment
12. Multifunction wrist watches
13. Multifunction printers

4.1 History:

One of the first recognizably modern embedded systems was the Apollo Guidance
Computer, developed by “Charles Stark Draper” at the MIT Instrumentation Laboratory. At the
project inception, the Apollo guidance computer was considered the riskiest item in the Apollo
project as it employed the then newly developed monolithic integrated circuits to reduce the size
and weight. An early mass-produced embedded system was the Automatics D-17 guidance
computer for the Minuteman missile, released in 1961.It was built from transistor logic and had a
hard disk for main memory. When the Minuteman II went into production in 1966, the D-17 was
replaced with a new computer that was the first high volume use of integrated circuits. This
program alone reduced prices on quad and gate ICs from $1000/ each to $3/ each permitting their
use in commercial products.

Since these early applications in the 1960s, embedded systems have come down in price
and there has been a dramatic rise in processing power and functionality. The first
microprocessor for example, the Intel 4004, was designed for calculators and other small systems
but still required many external memory and support chips. In 1978 National Engineering
Manufactures Association released a “standard” for programmable microcontrollers, including
almost any computer-based controllers, such as single board computers, numerical and event-
based controllers.

Embedded Systems are designed to some specific tasks, rather than be a general-purpose
computer for multitasks. Some also have real-time performances constraints that must be met,

28
for reasons such as safety and usability; others may have low or no performance requirement,
allowing the system hardware to be simplified to reduce cost

4.2 Characteristics of Embedded System:

Embedded systems are designed to do some specific tasks, rather than be a general-
purpose computer for multiple tasks. Some also have real-time performance constraints that must
be met, for reasons such as safety and usability; others may have low or no performance
requirements, allowing the system hardware to be simplified to reduce costs.

Embedded systems are not always standalone devices. Many embedded systems consist
of small, computerized parts within a larger device that serves a more general purpose. For
example, the Gibson Robot Guitar features an embedded system for tuning the strings, but the
overall purpose of the Robot Guitar is, of course, to play music. Similarly, an embedded system
in an automobile provides a specific function as a subsystem of the car itself.

The program instructions written for embedded systems are referred to as firmware, and
are stored in read-only memory or Flash memory chips. They run with limited computer
hardware resources: little memory, small or non-existent keyboard and/or screen.

An embedded system is any computer system hidden inside a product other than a
computer.They will encounter a number of difficulties when writing embedded system software
in addition to those we encounter when we write applications.

1. Throughput – Our system may need to handle a lot of data in a short period of time.
2. Response–Our system may need to react to events quickly.
3. Testability–Setting up equipment to test embedded software can be difficult.
4. Debugability–Without a screen or a keyboard, finding out what the software is doing
wrong (other than not working) is a troublesome problem.
5. Reliability – embedded systems must be able to handle any situation without human
intervention.
6. Memory space – Memory is limited on embedded systems, and you must make the
software and the data fit into whatever memory exists.
7. Program installation – you will need special tools to get your software into embedded
systems.
8. Power consumption – Portable systems must run on battery power, and the software in
these systems must conserve power.

29
9. Processor hogs – computing that requires large amounts of CPU time can complicate the
response problem.
10. Cost – Reducing the cost of the hardware is a concern in many embedded system
projects; software often operates on hardware that is barely adequate for the job.
Embedded systems have a microprocessor/ microcontroller and a memory. Some have a
serial port or a network connection. They usually do not have keyboards, screens or disk drives

4.2.1 User interfaces:

Embedded systems range from no user interface at all - dedicated only to one task - to
full user interfaces similar to desktop operating systems in devices such as PDAs.

4.2.2 Peripherals:
Embedded systems range from no user interface at all - dedicated only to one task - to
complex graphical user interfaces that resemble modern computer desktop operating systems.
Simple embedded devices use buttons, LEDs, graphic or character LCDs (for example popular
HD 44780LCD) with a simple system.

• Embedded systems talk with outside world via peripherals, such as:
• Serial Communications Interfaces (SCI) : RS-232, RS-422, RS-485 etc.
• Synchronous Serial Communication Interface: I2c, SPI, SSC and ESSI (Enhanced
• Synchronous Serial Interface)
• Universal Serial Bus (USB)
• Multi Media Cards (SD Cards, Compact Flash etc.)
• Networks: Ethernet, Lon Works etc.
• Field buses: CAN-Bus, LIN-Bus, PROFIBUS etc.
• Timers: PLLS(s), Capture /Compare and Time Processing Units
• Discrete IO: Aka General Purpose Input / output (GPIO)
• Analog to Digital or Digital to Analog (ADC/DAC)
• Debugging: JTAG, ISP, ICSP, BDM Port, BITP and DP9 ports.

4.2.3 Debugging:

30
Embedded debugging may be performed at different levels, depending on the facilities
available. From simplest to most sophisticate, they can be roughly grouped into the following
areas:

• Interactive resident debugging using the simple shell provided by the embedded
operating system (e.g., Forth and Basic)
• External debugging using logging or serial port output to trace operating using either a
monitor in flash or using a debug server like the Remedy Debugger which even works for
heterogeneous multi core systems.
• An in-circuit debugger (ICD), a hardware device that connects to the microprocessor via
a JTAG or NEXUS interface. This allows the operation of the microprocessor to be
controlled externally, but is typically restricted to specific debugging capabilities in the
processor.
• An in- circuit emulator (ICE) replaces the microprocessor with a simulated equivalent,
providing full control over all aspects of the microprocessor.
• A complete emulator provides a simulation of all aspects of the hardware, allowing all of
it to be controlled and modified and allowing debugging on a normal PC.
Applications:
1. Military and aerospace embedded software applications
2. Communication Applications, Intelligent, autonomes seniors.
3. Mastering the complexity of applications.
4. Reduction of product design time.
5. Real time processing of ever-increasing amounts of data

31
Chapter 5: Interfacing Device
LCD (Liquid Cristal Display):

A liquid crystal display (LCD) is a thin, flat display device made up of any number of color or
monochrome pixels arrayed in front of a light source or reflector. Each pixel consists of a
column of liquid crystal molecules suspended between two transparent electrodes, and two
polarizing filters, the axes of polarity of which are perpendicular to each other. Without the
liquid crystals between them, light passing through one would be blocked by the other. The
liquid crystal twists the polarization of light entering one filter to allow it to pass through the
other.

A program must interact with the outside world using input and output devices that
communicate directly with a human being. One of the most common devices attached to a
controller is an LCD display. Some of the most common LCDs connected to the controllers are
16X1, 16x2 and 20x2 displays. This means 16 characters per line by 1 line 16 characters per line
by 2 lines and 20 characters per line by 2 lines, respectively.

Many microcontroller devices use 'smart LCD' displays to output visual information. LCD
displays designed around LCD NT-C1611 module, are inexpensive, easy to use, and it is even
available. Line lengths of
possible to produce a readout using the 5X7 dots plus cursor of the display. They have a
8, 16,
standard ASCII set of characters and mathematical symbols. For an 8-bit data bus, the display
20, 24,
requires a +5V supply plus 10 I/O lines (RS RW D7 D6 D5 D4 D3 D2 D1 D0). For a 4-bit data
32 and
bus it only requires the supply lines plus 6 extra lines (RS RW D7 D6 D5 D4). When the LCD
40
display is not enabled, data lines are tri-state and they do not interfere with the operation of the
charact
microcontroller.
ers are
Features: all
standar
32
d, in
one,
two
(1) Interface with either 4-bit or 8-bit microprocessor.

(2) Display data RAM

(3) 80x8 bits (80 characters).

(4) Character generator ROM

(5). 160 different 5 7 dot-matrix character patterns.

(6). Character generator RAM

(7) 8 different user programmed 5 7 dot-matrix patterns.

(8). Display data RAM and character generator RAM may be

Accessed by the microprocessor.

(9) Numerous instructions

(10). Clear Display, Cursor Home, Display ON/OFF, Cursor ON/OFF,

Blink Character, Cursor Shift, Display Shift.

(11). Built-in reset circuit is triggered at power ON.

(12). Built-in oscillator.

Description Of 16x2:

This is the first interfacing example for the Parallel Port. We will start with something simple.
This example doesn't use the Bi-directional feature found on newer ports, thus it should work
with most, if not all Parallel Ports. It however doesn't show the use of the Status Port as an input.
So, what are we interfacing? A 16 Character x 2 Line LCD Module to the Parallel Port. These
LCD Modules are very common these days, and are quite simple to work with, as all the logic
required to run them is on board.

33
Schematic Diagram:

o Above is the quite simple schematic. The LCD panel's Enable and Register


Select is connected to the Control Port. The Control Port is an open collector /
open drain output. While most Parallel Ports have internal pull-up resistors, there
are a few which don't. Therefore, by incorporating the two 10K external pull up
resistors, the circuit is more portable for a wider range of computers, some of
which may have no internal pull up resistors.
o We make no effort to place the Data bus into reverse direction. Therefore, we
hard wire the R/W line of the LCD panel, into write mode. This will cause no bus
conflicts on the data lines. As a result, we cannot read back the LCD's internal
Busy Flag which tells us if the LCD has accepted and finished processing the last
instruction. This problem is overcome by inserting known delays into our
program.
o The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy
here. As with all the examples, I've left the power supply out. You can use a
bench power supply set to 5v or use an onboard +5 regulator. Remember a few

34
de-coupling capacitors, especially if you have trouble with the circuit working
properly.
 The 2-line x 16-character LCD modules are available from a wide range of
manufacturers and should all be compatible with the HD44780. The one I used to
test this circuit was a Power tip PC-1602F and an old Philips LTN211F-10 which
was extracted from a Poker Machine! The diagram to the right, shows the pin
numbers for these devices. When viewed from the front, the left pin is pin 14 and
the right pin is pin 1
.

16 x 2 Alphanumeric LCD Module Features:

 Intelligent, with built-in Hitachi HD44780 compatible LCD controller and RAM
providing simple interfacing
 61 x 15.8 mm viewing area
 5 x 7 dot matrix format for 2.96 x 5.56 mm characters, plus cursor line
 Can display 224 different symbols
 Low power consumption (1 mA typical)
 Powerful command set and user-produced characters
 TTL and CMOS compatible
 Connector for standard 0.1-pitch pin headers

16 x 2 Alphanumeric LCD Module Specifications:

Symbol Level Function


Pin

1 VSS - Power, GND

2 VDD - Power, 5V

3 Vo - Power, for LCD Drive

35
Register Select Signal
4 RS H/L H: Data Input
L: Instruction Input

H: Data Read (LCD->MPU)


5 R/W H/L
L: Data Write (MPU->LCD)

6 E H, H->L Enable

7-14 DB0-DB7 H/L Data Bus; Software selectable 4- or 8-bit mode

15 NC - NOT CONNECTED

16 NC - NOT CONNECTED

FEATURES:

• 5 x 8 dots with cursor

• Built-in controller (KS 0066 or Equivalent)

• + 5V power supply (Also available for + 3V)

• 1/16 duty cycle

• B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K (LED)

• N.V. optional for + 3V power supply

Data can be placed at any location on the LCD. For 16×1 LCD, the address locations are:

36
Fig :15: Address locations for a 1x16 line LCD

Even limited to character-based modules, there is still a wide variety of shapes and sizes
available. Line lengths of 8,16,20,24,32 and 40 characters are all standard, in one-, two- and
four-line versions.

Several different LC technologies exists. “supertwist” types, for example, offer Improved
contrast and viewing angle over the older “twisted nematic” types. Some modules are available
with back lighting, so that they can be viewed in dimly-lit conditions. The back lighting may be
either “electro-luminescent”, requiring a high voltage inverter circuit, or simple LED
illumination.

Electrical Block Diagram

Power supply for LCD driving:

37
Fig: 18: power supply for LCD

PIN DESCRIPTION:

Most LCDs with 1 controller have 14 Pins and LCDs with 2 controllers has 16 Pins (two pins are
extra in both for back-light LED connections).

Fig 19: pin diagram of 1x16 lines LCD

38
Fig 17: Pin specifications

CONTROL LINES:

EN: Line is called "Enable." This control line is used to tell the LCD that you are sending it
data. To send data to the LCD, your program should make sure this line is low (0) and then set
the other two control lines and/or put data on the data bus. When the other lines are completely
ready, bring EN high (1) and wait for the minimum amount of time required by the LCD
datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.

RS:

Line is the "Register Select" line. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is high (1),
the data being sent is text data which should be displayed on the screen. For example, to display
the letter "T" on the screen you would set RS high.

RW:

Line is the "Read/Write" control line. When RW is low (0), the information on the data
bus is being written to the LCD. When RW is high (1), the program is effectively querying (or

39
reading) the LCD. Only one instruction ("Get LCD status") is a read command. All others are
writing commands, so RW will almost always be low.

Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected
by the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3,
DB4, DB5, DB6, and DB7.

Logic status on control lines:

• E - 0 Access to LCD disabled

- 1 Access to LCD enabled

• R/W - 0 Writing data to LCD

- 1 Reading data from LCD

• RS - 0 Instructions

- 1 Character
Writing data to the LCD:

1) Set R/W bit to low

2) Set RS bit to logic 0 or 1 (instruction or character)

3) Set data to data lines (if it is writing)

4) Set E line to high

5) Set E line to low

Read data from data lines (if it is reading) on LCD:

1) Set R/W bit to high

2) Set RS bit to logic 0 or 1 (instruction or character)

3) Set data to data lines (if it is writing)

40
4) Set E line to high

5) Set E line to low

Entering Text:

First, a little tip: it is manually a lot easier to enter characters and commands in hexadecimal
rather than binary (although, of course, you will need to translate commands from binary couple
of sub-miniature hexadecimal rotary switches is a simple matter, although a little bit into hex so
that you know which bits you are setting). Replacing the dial. switch pack with a of re-wiring is
necessary.

SWITCHES:

The switches must be the type where on = 0, so that when they are turned to the zero position, all
four outputs are shorted to the common pin, and in position “F”, all four outputs are open circuit.

All the available characters that are built into the module are shown in Table 3. Studying the table,
you will see that codes associated with the characters are quoted in binary and hexadecimal, most
significant bits (“left-hand” four bits) across the top, and least significant bits (“right-hand” four
bits) down the left.

Most of the characters conform to the ASCII standard, although the Japanese and Greek
characters (and a few other things) are obvious exceptions. Since these intelligent modules were
designed in the “Land of the Rising Sun,” it seems only fair that their Katakana phonetic symbols
should also be incorporated. The more extensive Kanji character set, which the Japanese share
with the Chinese, consisting of several thousand different characters, is not included!

Using the switches, of whatever type, and referring to Table 3, enter a few characters onto the
display, both letters and numbers. The RS switch (S10) must be “up” (logic 1) when sending the
characters, and switch E (S9) must be pressed for each of them. Thus, the operational order is: set

41
RS high, enter character, trigger E, leave RS high, enter another character, trigger E, and so on.

The first 16 codes in Table 3, 00000000 to 00001111, ($00 to $0F) refer to the CGRAM. This is
the Character Generator RAM (random access memory), which can be used to hold user-defined
graphics characters. This is where these modules really start to show their potential,

offering such capabilities as bar graphs, flashing symbols, even animated characters. Before the

user-defined characters are set up, these codes will just bring up strange looking symbols.

Codes 00010000 to 00011111 ($10 to $1F) are not used and just display blank characters. ASCII
codes “proper” start at 00100000 ($20) and end with 01111111 ($7F). Codes 10000000 to
10011111 ($80 to $9F) are not used, and 10100000 to 11011111 ($A0 to $DF) are the Japanese
characters.

42
Fig 20: character details in LCD

43
Initialization by Instructions:

Fig 21: flow chart of lcd

44
If the power conditions for the normal operation of the internal reset circuit are not satisfied,
then executing a series of instructions must initialize LCD unit. The procedure for this
initialization process is as above show.

FLOWCHART:

45
Switches and Pushbuttons

This is the simplest way of controlling appearance of some voltage on microcontroller’s input
pin. There is also no need for additional explanation of how these components operate.

This is about something commonly unnoticeable when using these components in everyday life.
It is about contact bounce, a common problem with mechanical switches. If contact switching
does not happen so quickly, several consecutive bounces can be noticed prior to maintain stable
state. The reasons for this are: vibrations, slight rough spots and dirt. Anyway, this whole process
does not last long (a few micro- or milliseconds), but long enough to be registered by the
microcontroller. Concerning the pulse counter, error occurs in almost 100% of cases.

46
The simplest solution is to connect simple RC circuit which will suppress each quick voltage
change. Since the bouncing time is not defined, the values of elements are not strictly
determined. In the most cases, the values shown on figure are sufficient.

If complete safety is needed, radical measures should be taken. The circuit (RS flip-flop) changes
logic state on its output with the first pulse triggered by contact bounce. Even though this is more
expensive solution (SPDT switch), the problem is definitely resolved. Besides, since the
condensate is not used, very short pulses can be also registered in this way. In addition to these
hardware solutions, a simple software solution is also commonly applied. When a program tests
the state of some input pin and finds changes, the check should be done one more time after
certain time delay. If the change is confirmed, it means that switch (or pushbutton) has changed
its position. The advantages of such solution are: it is free of charge; effects of disturbances are
eliminated and it can be adjusted to the worst-quality contacts.

Switch Interfacing with 8051:


In 8051 PORT 1, PORT 2 &  PORT 3 have internal 10k Pull-up resistors whereas this Pull-up

resistor is absent in PORT 0 . Hence PORT 1, 2 & 3 can be directly used to interface a switch
whereas we have to use an external 10k pull-up resistor for PORT 0 to be used for switch

interfacing or for any other input. Figure 1 shows switch interfacing for PORT 1, 2 & 3.

Figure 2 shows switch interfacing to PORT 0. 

47
For any pin to be used as an  input pin,  a HIGH (1) should be written to the pin if the

pin will always to be read as LOW. In the above figure, when the switch is not pressed, the
10k resistor provides the current needed for LOGIC 1 and closure of switch provides LOGIC 0
to the controller PIN.

Chapter 6: INTERNET OF THINGS


48
INTRODUCTION TO INTERNET OF THINGS

6.1 Introduction:

What Is the Internet of Things (IoT)?

The Internet of Things may be a hot topic in the industry but it’s not a new concept. In
the early 2000’s, Kevin Ashton was laying the groundwork for what would become the Internet
of Things (IoT) at MIT’s Auto ID lab. Ashton was one of the pioneers who conceived this notion
as he searched for ways that Proctor & Gamble could improve its business by linking RFID
information to the Internet. The concept was simple but powerful. If all objects in daily life were
equipped with identifiers and wireless connectivity, these objects could be communicating with
each other and be managed by computers. In a 1999 article for the RFID Journal Ashton wrote:

“If we had computers that knew everything there was to know about things—using data
they gathered without any help from us -- we would be able to track and count everything, and
greatly reduce waste, loss and cost. We would know when things needed replacing, repairing or
recalling, and whether they were fresh or past their best. We need to empower computers with
their own means of gathering information, so they can see, hear and smell the world for
themselves, in all its random glory. RFID and sensor technology enable computers to observe,
identify and understand the world—without the limitations of human-entered data.”

At the time, this vision required major technology improvements. After all, how would
we connect everything on the planet? What type of wireless communications could be built into
devices? What changes would need to be made to the existing Internet infrastructure to support
billions of new devices communicating? What would power these devices? What must be
developed to make the solutions cost effective? There were more questions than answers to the
IoT concepts in 1999.

Today, many of these obstacles have been solved. The size and cost of wireless radios
has dropped tremendously. IPv6 allows us to assign a communications address to billions of
devices. Electronics companies are building Wi-Fi and cellular wireless connectivity into a wide
range of devices. ABI Research estimates over five billion wireless chips will ship in 2013.2
Mobile data coverage has improved significantly with many networks offering broadband

49
speeds. While not perfect, battery technology has improved and solar recharging has been built
into numerous devices. There will be billions of objects connecting to the network with the next
several years. For example, Cisco’s Internet of Things Group (IOTG) predicts there will be over
50 billion connected devices by 2020.

IoT describes a system where items in the physical world, and sensors within or attached
to these items, are connected to the Internet via wireless and wired Internet connections. These
sensors can use various types of local area connections such as RFID, NFC, Wi-Fi, Bluetooth,
and Zigbee. Sensors can also have wide area connectivity such as GSM, GPRS, 3G, and LTE.
The Internet of Things will:

• Connect both inanimate and living things: Early trials and deployments of Internet of
Things networks began with connecting industrial equipment. Today, the vision of IoT has
expanded to connect everything from industrial equipment to everyday objects. The types of
items range from gas turbines to automobiles to utility meters. It can also include living
organisms such as plants, farm animals and people. For example, the Cow Tracking Project in
Essex uses data collected from radio positioning tags to monitor cows for illness and track
behavior in the herd. Wearable computing and digital health devices, such as Nike+ Fuel band
and Fitbit, are examples of how people are connecting in the Internet of Things landscape. Cisco
has expanded the definition of IoT to the Internet of Everything (IoE), which includes people,
places, objects and things. Basically, anything you can attach a sensor and connectivity to can
participate in the new connected ecosystems.

• Use sensors for data collection:

The physical objects that are being connected will possess one or more sensors. Each sensor will
monitor a specific condition such as location, vibration, motion and temperature. In IoT, these
sensors will connect to each other and to systems that can understand or present information
from the sensor’s data feeds. These sensors will provide new information to a company’s
systems and to people.

• Change what types of items communicate over an IP Network: In the past, people
communicated with people and with machines. Imagine if all of your equipment had the ability
to communicate. What would it tell you? IoT-enabled objects will share information about their

50
condition and the surrounding environment with people, software systems and other machines.
This information can be shared in Realtime or collected and shared at defined intervals. Going
forward, everything will have a digital identity and connectivity, which means you can identify,
track and communicate with objects. IoT data differs from traditional computing. The data can
be small in size and frequent in transmission. The number of devices, or nodes, that are
connecting to the network are also greater in IoT than in traditional PC computing. Machine-to-
Machine communications and intelligence drawn from the devices and the network will allow
businesses to automate certain basic tasks without depending on central or cloud-based
applications and services. These attributes present opportunities to collect a wide range of data
but also provide challenges in terms of designing the appropriate data networking and security.

What It Means for Your Business?

IoT impacts every business. Mobile and the Internet of Things will change the types of
devices that connect into a company’s systems. These newly connected devices will produce new
types of data. The Internet of Things will help a business gain efficiencies, harness intelligence
from a wide range of equipment, improve operations and increase customer satisfaction. IoT will
also have a profound impact on people’s lives. It will improve public safety, transportation and
healthcare with better information and faster communications of this information. While there
are many ways that the Internet of Things could impact society and business, there are at least
three major benefits of IOT that will impact every business, which include: communication,
control and cost savings.

6.2 The Three Causes of IoT

Communication: IoT communicates information to people and systems, such as state and health
of equipment (e.g., It’s on or off, charged, full or empty) and data from sensors that can monitor
a person’s vital signs. In most cases, we didn’t have access to this information before or it was
collected manually and infrequently. For example, an IOT-enabled HVAC system can report if
its air filter is clean and functioning properly. Almost every company has a class of assets it
could track. GPS-enabled assets can communicate their current location and movement. Location
is important for items that move, such as trucks, but it’s also applicable for locating items and
people within an organization. In the healthcare industry, IoT can help a hospital track the

51
location of everything from wheelchairs to cardiac defibrillators to surgeons. In the
transportation industry, a business can deliver real-time tracking and condition of parcels and
pallets. For example, Maersk can use sensors to track the location of a refrigerated shipping
container and its current temperature.

Control and Automation: In a connected world, a business will have visibility into a device’s
condition. In many cases, a business or consumer will also be able to remotely control a device.
For example, a business can remotely turn on or shut down a specific piece of equipment or
adjust the temperature in a climate-controlled environment. Meanwhile, a consumer can use IoT
to unlock their car or start the washing machine. Once a performance baseline has been
established, a process can send alerts for anomalies and possibly deliver an automated response.
For example, if the brake pads on a truck are about to fail, it can prompt the company to take the
vehicle out of service and automatically schedule maintenance.

Cost Savings: Many companies will adopt IoT to save money. Measurement provides actual
performance data and equipment health, instead of just estimates. Businesses, particularly
industrial companies, lose money when equipment fails. With new sensor information, IoT can
help a company save money by minimizing equipment failure and allowing the business to
perform planned maintenance. Sensors can also measure items, such as driving behavior and
speed, to reduce fuel expense and wear and tear on consumables. New smart meters in homes
and businesses can also provide data that helps people understand energy consumption and
opportunities for cost savings.

6.3 How to Get Started:

These are just a few examples of how IoT can help a business save money, automate
processes and gain new insight into the business. To reap the benefits IoT can provide, a business
should address at least the following four items:

1.Define what you’d like to learn from sensors: Over the next three years, a majority of the
devices purchased will have sensors and many existing items can be retrofitted with sensors. This
will produce a wide range of new data sources for people and systems to use to improve their

52
lives and existing business processes. Within a business setting, IT must define what types of
information can be obtained from these sensors and work with business leaders to define which
business processes can be improved with this new IoT information. For example, sensor data that
highlights anomalies in equipment vibration can be used to predict and avoid equipment failure.

2. Build an IOT network and security foundation: Many industrial IoT deployments have
used proprietary networks. Instead of building proprietary networks, IT should connect IoT
devices with standards-based IP networks. An IP-based network will help businesses deliver the
performance, reliability and interoperability that are required to support global IoT networks and
connections with partner ecosystems. Additionally, many businesses are focused on building
security strategies for smartphones and tablets, but this is just one aspect of the new mobile
world. The proliferation of connected sensors and equipment provides new security concerns. As
IT embraces IoT, it needs to ensure it has built safeguards into the solution including security
procedures such as hardware encryption, physical building security and network security for data
in transit. Identity and authentication structures will also need to be updated to support “things”
as well as people.

3. Collect as much data as possible: Businesses that don’t plan carefully for IoT will be
overwhelmed with the volume and variety of data that IoT will generate. While each sensor may
only produce a small amount of data, a company will be collecting data from thousands to
millions of sensors. Firms must build a data collection and analytics strategy that supports this
new torrent of information in a scalable and cost-effective manner. Big data technology, such as
Hadoop and NoSQL, can give companies the ability to rapidly collect, store and analyze large
volumes of disparate IoT data. A company should collect any data that is relevant to existing
processes. If possible and cost-effective, a company should also collect additional data that will
enable the business to answer new questions in the future.

4.Review the size and scale of IoT providers: IoT is a complicated landscape with numerous
categories and many vendors within each category. The four main categories of an IoT solution
are: a sensor(s) and radio(s) that often sits in the machine, a M2M device-management platform,
a solution delivery platform and apps that enable IoT devices to report or act on data. While there
are many vendors, no single vendor offers a complete solution without building partnerships. As
a firm begins its IoT voyage, IT and line of business executives should build a cross-functional

53
team to evaluate strategic partners. The team should evaluate the financial position of the
vendors, industry knowledge, partnerships and breadth of offerings.

6.4 Advantages

Here are some advantages of IoT:

1. Data: The more the information, the easier it is to make the right decision. Knowing what to
get from the grocery while you are out, without having to check on your own, not only saves
time but is convenient as well.

2. Tracking: The computers keep a track both on the quality and the viability of things at home.
Knowing the expiration date of products before one consumes them improves safety and quality
of life. Also, you will never run out of anything when you need it at the last moment.

3. Time: The amount of time saved in monitoring and the number of trips done otherwise would
be tremendous.

4. Money: The financial aspect is the best advantage. This technology could replace humans who
are in charge of monitoring and maintaining supplies.

6.5 The Internet of Things applications

 Smart home. Smart Home clearly stands out, ranking as highest Internet of Things application on
all measured channels.
 Wearable’s.
 Smart City.
 Smart grids.
 Industrial internet.
 Connected car.
 Connected Health (Digital health/Telehealth/Telemedicine).
 Smart retail.

54
Chapter 7. SOURCE CODE
#include<LiquidCrystal.h>

Liquid Crystal lcd (13,12,11,10,9,8);

55
const int sw1=2;

const int sw2=3;

const int sw3=4;

void setup ()

Serial. Begin (9600);

LCD. Begin (16,2);

LCD. Clear ();

pin Mode (sw1, INPUT); digital Write (sw1, HIGH);

pin Mode (sw2, INPUT); digital Write (sw2, HIGH);

pin Mode (sw3, INPUT); digital Write (sw3, HIGH);

LCD. Print ("SMART KITCHEN");

lcd. set Cursor (0,1);

LCD. Print ("ORDERING BY IoT");

delay (1500);

LCD. Clear ();

LCD. Print ("SYSTEM READY...");

delay (1000);

void loop ()

56
{

int sw1val=digital Read(sw1);

if(sw1val==LOW)

Serial. Print ('1');

LCD. Clear ();

LCD. Print("1-CHICKENBIRYANI");

delay (1000);

if(sw1val==HIGH)

delay (100);

int sw2val=digital Read(sw2);

if(sw2val==LOW)

Serial. Print ('2');

LCD. Clear ();

LCD. Print ("2-CHICKE PIZZA's");

delay (1000);

if(sw2val==HIGH)

57
delay (100);

int sw3val=digital Read(sw3);

if(sw3val==LOW)

Serial. Print ('3');

LCD. Clear ();

LCD. Print ("1-CHILLY CHICKE");

delay (1000);

if(sw3val==HIGH)

delay (100);

while (Serial. Available () > 0)

char data=Serial. Read ();

if(data=='1')

LCD. Clear ();

LCD. Print ("YOUR ORDER");

lcd.setCursor(0,1);

LCD. Print ("CONFIRMED...");

58
delay (1000);

if(data=='2')

LCD. Clear ();

LCD. Print ("YOUR ORDER");

lcd. set Cursor (0,1);

LCD. Print ("CANCELLED...");

delay (1000);

if(data=='3')

LCD. Clear ();

LCD. Print ("RESTAURENT IS");

lcd. set Cursor (0,1);

LCD. Print ("CLOSED...");

delay (1000);

CHAPTER 8: ESP32
ESP32:

59
Pin Configuration
Pin Category Pin Name Details

60
Power Micro-USB, 3.3V, 5V, GND Micro-USB: ESP32 can be powered through
USB port
5V: Regulated 5V can be supplied to this pin
which is we be again regulated to 3.3V by on
board regulator, to power the board.
3.3V: Regulated 3.3V can be supplied to this
pin to power the board.
GND: Ground pins.
Enable End The pin and the button reset the
microcontroller.
Analog Pins ADC1_0 to ADC1_5 and Used to measure analog voltage in the range
ADC2_0 to ADC2_9 of 0-3.3V.
12-bit 18 Channel ADC
DAC pins DAC1 and DAC2 Used for Digital to analog Conversion
Input/Output GPIO0 to GPIO39 Totally 39 GPIO pins, can be used as input or
Pins output pins. 0V (low) and 3.3V (high). But pins
34 to 39 can be used as input only
Capacitive T0 to T9 These 10 pins can be used a touch pins
Touch pins normally used for capacitive pads
RTC GPIO pins RTCIO0 to RTCIO17 These 18 GPIO pins can be used to wake up
the ESP32 from deep sleep mode.
Serial Rx, Tx Used to receive and transmit TTL serial data.
External All GPIO Any GPIO can be used to trigger an interrupt.
Interrupts
PWM All GPIO 16 independent channel is available for PWM
any GPIO can be made to work as PWM
though software
VSPI GPIO23 (MOSI), Used for SPI-1 communication.
GPIO19(MISO),

61
GPIO18(CLK) and GPIO5
(CS)
HSPI GPIO13 (MOSI), Used for SPI-2 communication.
GPIO12(MISO),
GPIO14(CLK) and GPIO15
(CS)
IIC GPIO21(SDA), GPIO22(SCL) Used for I2C communication.
AREF AREF To provide reference voltage for input voltage.
 
ESP32 Technical Specifications
Microprocessor Ten silica Extensa LX6
Maximum Operating Frequency 240MHz
Operating Voltage 3.3V
Analog Input Pins 12-bit, 18 Channel
DAC Pins 8-bit, 2 Channel
Digital I/O Pins 39 (of which 34 is normal GPIO pin)
DC Current on I/O Pins 40 mA
DC Current on 3.3V Pin 50 mA
SRAM 520 KB
Communication SPI (4), I2C (2), I2S (2), CAN, UART (3)
Wi-Fi 802.11 b/g/n
Bluetooth V4.2 – Supports BLE and Classic Bluetooth
 
Other Espresso Boards
ESP8266, ESP12E, Node MCU
 
Other Development Boards

62
Arduino, Raspberry Pi, PIC Development Board, AVR Development Board, MSP430
Launchpad, Intel Edison, Beagle Bone
 
Difference between ESP32 and Arduino
It is completely unfair to compare ESP32 with Arduino; both are advantageous and
functional on its own. In terms of power and features obviously the dual cored
microprocessor powered ESP32 will surely take down the microcontroller powered
Arduino UNO. The ESP32 has built in Bluetooth and Wi-Fi with good number of GPIO
pins and communication protocols for a very cheap price. The Arduino might look a bit
handicapped when competing with ESP32 but it has a large number of shields in the
market which can be readily used, also advanced Arduino boards like Yun has good
processing power as well.
The ESP32 operates on 3.3V and can be programmed with ESP-IDF or with Arduino IDE
which is still under development; the Arduino operates at 5V and is known for its easy-
to-use Arduino IDE and strong community support.  So, to conclude, if you have prior
experience with programming and your project really requires some heavy processing
with IoT capabilities then ESP32 can be preferred over Arduino.
 
Difference between ESP32 and ESP8266
Both the ESP32 and ESP8266 are Wi-Fi development boards from Espresso systems.
They can be programmed using the ESP-IDF or the Arduino IDE. The ESP8266 is inferior
in terms of performance compared with the ESP32, but it is cheaper and has smaller
form factor then the ESP32. Also, the ESP8266 was launched into the market earlier then
ESP32 so you will get enough community support for ESP8266.
The main difference would be that ESP8266 does not have an in-built Bluetooth module
and also does not feature CAN protocol and has no SRAM. So, if you project requires
more processing power with Bluetooth or CAN functionalities then you can prefer ESP32
over ESP8266.

63
Name Processor GPIO CPU Analog Bluetooth CAN SRAM USB SPI/I2C/I2S/UART
pins speed In

ESP826 Extensa 17 80 10 bits No No No Min 2/1/2/2


6 Single- MHz i
core 32-
bit L106
ESP32 Extensa 36 160 12-bit Yes Yes Yes Min 4/2/2/2
Dual- MHz i
Core 32-
bit LX6
with 600
DMIPS
 
Understanding ESP32 Board
The ESP32 is design for low power IoT applications in mind. It’s high processing power
with in-built Wi-Fi / Bluetooth and Deep Sleep Operating capabilities makes it ideal for
most Portable IoT devices. Also, now, since Arduino IDE has officially released board
managers for ESP32 it has become very easy to program these devices.
 
Powering your ESP32
There are totally three ways by which you can power your ESP32 board.
Micro USB Jack: Connect the mini-USB jack to a phone charger or computer through a
cable and it will draw power required for the board to function 
5V Pin: The 5V pin can be supplied with a Regulated 5V, this voltage will again be
regulated to 3.3V through the on-board voltage regulator. Remember ESP32 operated
with 3.3V only.
3.3V Pin: If you have a regulated 3.3V supply then you can directly provide this to the
3.3V pin of the ESP32.

64
 
Input/output
There are totally 39 digital Pins on the ESP32 out of which 34 can be used as GPIO and
the remaining are input only pins.  The device supports 18-channels for 12-bit ADC and
2-channel for 8-bit DAC. IT also has 16 channels for PWM signal generation and 10
GPIO pins supports capacitive touch features. The ESP32 has multiplexing feature, this
enables the programmer to configure any GPIO pin for PWM or other serial
communication though program. The ESP32 supports 3 SPI Interface, 3 UART interface,
2 I2C interface, 2 I2S interface and also supports CAN protocol.

 3 UART interface:  The ESP32 supports 3 UART interface for TTL communication. This would require 3 sets
of Rx and Tx pins. All the 6 pins are software configurable and hence any GPIO pin can be programmed to
be used for UART.
 External Interrupt:  Again, since the ESP32 supports multiplexing any GPIO pin can be programmed to be
used as an interrupt pin.
 GPIO23 (MOSI), GPIO19(MISO), GPIO18(CLK) and GPIO5 (CS):  These pins are used for SPI
communication. ESP32 supports two SPI, this is the first set.
 GPIO13 (MOSI), GPIO12(MISO), GPIO14(CLK) and GPIO15 (CS):  These pins are used for SPI
communication. ESP32 supports two SPI, this is the second set.
 GPIO21(SDA), GPIO22(SCL):  Used for IIC communication using Wire library.
 Reset Pin:  The reset pin for ESP32 is the Enable (EN) pin.  Making this pin LOW, resets the microcontroller.

65
CONCLUSION
Wireless technology is becoming more and more popular because of its low cost and ease-
of-use. This technology allows us a faster and more convenient access to the world. NODE MCU
technology provides the world with a variety of wireless applications. The Restaurant
Automation gives the customers an insight into their order being prepared or preparing and
restaurant accepted or not. It is amazing that the customers can get update order accepted or not.
The Restaurant automation is a revolutionary concept & is sure to take people by surprise. It will
undoubtedly change the way people dine & their dining habits. It would lead to increased
revenues; give the customer a better insight into the kind of food they wish to have, given them a
great touch experienced.
In this paper, a high performance-cost ratio wireless handheld ordering terminal is proposed,
which is based on the hardware platform of esp32 and node much wireless communication
technology. The ordering terminal has the advantages of simple structure, stable operation, low
power consumption and friendly interface, thus it has bright market prospect.
The implemented system of restaurant menu ordering system is a modern and smart solution
for menu ordering methods in any kind of restaurant. The system will reduce the manual efforts
It is also a low-cost alternative to be used by middle and low-level restaurants also.

66
REFERENCIES
REFERENCE BOOKS:
1. “Fundamental of digital circuits” by A. Anaid Kumar.
2. “The AVR microcontroller and embedded system” by Muhammad Ali Majidi.
3. “C programming for microcontrollers” by Joe Perdue.
4. “The 8051Micro controllers and embedded systems” by A. K. Ray and Majidi.
5. “Embedded Micro controllers. Pearson Education” by Todd D Morton.

WEBSITES:
1. www.datasheetcatalog.com
2. http;//www.atmel.on/ beta ware
3. http;//www.atmel.com/ aver
4. http;//www.national.com
5. www.tI.com
6. www.cdilsemi.com
7. www.microchip technology inc.com

8. www.inicore.com

67

You might also like