Você está na página 1de 43

CHAPTER 1

INTRODUCTION

EMBEDDED SYSTEMS

An embedded system is one kind of a computer system mainly designed to


perform several tasks like to access, process, store and also control the data in
various electronics-based systems. Embedded systems are a combination of
hardware and software where software is usually known as firmware that is
embedded into the hardware. One of its most important characteristics of these
systems is, it gives the o/p within the time limits. Embedded systems support to make
the work more perfect and convenient. So, we frequently use embedded systems in
simple and complex devices too. The applications of embedded systems mainly
involve in our real life for several devices like microwave, calculators, TV remote
control, home security and neighborhood traffic control systems, etc.

Fig 1.1: Basic embedded system blocks


The embedded system basics are the combination of embedded system hardware
and embedded system software.

EMBEDDED SYSTEM HARDWARE

An embedded system uses a hardware platform to perform the operation.


Hardware of the embedded system is assembled with a
microprocessor/microcontroller. It has the elements such as input/output interfaces,
memory, user interface and the display unit. Generally, an embedded system
comprises of the following

1. Power Supply
2. Memory
3. Processor
4. Timers
5. Output/Output circuits
6. Serial communication ports
7. SASC (System application specific circuits)

EMBEDDED SYSTEM SOFTWARE


The software of an embedded system is written to execute a particular
function. It is normally written in a high-level setup and then compiled down to offer
code that
can be stuck within a non-volatile memory in the hardware. An embedded system
software is intended to keep in view of the following three limits
 Convenience of system memory
 Convenience of processor’s speed
 When the embedded system runs constantly, there is a necessity to limit power
dissipation for actions like run, stop and wake up.

RTOS (Real Time Operating System)


A system which is essential to finish its task and send its service on time, then
only it said to be a real time operating system. RTOS controls the application
software and affords a device to allow the processor run. It is responsible for
managing the different hardware resources of a personal computer and also host
applications which run on the PC. This operating system is specially designed to run
various applications with an exact timing and a huge amount of consistency.
Particularly, this can be significant in measurement & industrial automation systems
where a delay of a program could cause a safety hazard.

Memory and Processors


Processor is the heart of an embedded system. It is the basic unit that takes
inputs and produces an output after processing the data.
A processor has two essential units:

1. Program Flow Control Unit (CU)


2. Execution Unit (EU)
The CU includes a fetch unit for fetching instructions from the memory. The
EU has circuits that implement the instructions pertaining to data transfer operation
and data conversion from one form to another.
The EU includes the Arithmetic and Logical Unit (ALU) and also the circuits
that execute instructions for a program control task such as interrupt or jump to
another set of instructions.
A processor runs the cycles of fetch and executes the instructions in the same
sequence as they are fetched from memory.
The different kinds of processors used in an embedded system include Digital
Signal Processor, microprocessor, RISC(Reduced Instruction Set Computer)
processor, microcontroller, ASSP (application-specific standard product) processor,
ASIP(application-specific instruction set processor ) processor, and ARM
(Advanced Risk Machine) processor. The different types of memories of an
embedded system are given in the below chart.

Various forms of system memory

Internal RAM at RAM at SOC or Internal catches External Flash/ ROM/ Memory
at Micro address at
Micro controller External RAM RAM chip EEPROM PROM system port
processor

Fig 1.2: Various system memory

EMBEDDED SYSTEM CHARACTERISTICS

 All the computing systems have limitations on design metrics, but those can be
especially tight. Design metric is a measure of an execution features like size,
power, cost and also performance.
 It must perform fast enough and consume less power to increase battery life.
 It must be based on a microcontroller or microprocessor based.
 It must require a memory, as its software generally inserts in ROM. It does not
require any secondary memories in the PC.
 It must need connected peripherals to attach input & output devices.

EMBEDDED SYSTEM APPLICATIONS


The applications of an embedded system basics include smart cards, computer
networking, satellites, telecommunications, digital consumer electronics, missiles,
etc.

 Embedded systems in automobiles include motor control, cruise control, body


safety, engine safety, robotics in an assembly line, car multimedia, car
entertainment, E-com access, mobiles etc.
 Embedded systems in telecommunications include networking, mobile
computing, and wireless communications, etc.
 Embedded Systems in satellites and missiles include defense, communication,
and aerospace
 Embedded systems in computer networking & peripherals include image
processing, networking systems, printers, network cards, monitors and displays
 Embedded Systems in digital consumer electronics include set-top boxes, DVDs,
high definition TVs and digital cameras
CHAPTER 2

LITERATURE SURVEY

1. INTERNET OF THINGS (IOT)


Shivangi Vashi, Jyotsnamayee Ram, Janit Modi.

The Internet of things is the future for the coming decades which helps in
developing the Smart World where everything is connected to one network. As
security is always a big problem across every system but in IoT it is the most
important area in which we need to work to secure data or information which is on
one connected network. One of the fundamental elements in securing an IoT
infrastructure is around device identity and mechanisms to authenticate. So to
overcome on these securities of IoT devices strong encryption and authentication
schemes are based on cryptographic need to design and new security protocols are
required. In this paper, we explained the security issues in each layer and its
measures which help us to understand and to improve security in IoT architecture.
Smarter security systems that include managed threat detection, anomaly detection,
and predictive analysis need to evolve. All the above discussed issues will be
research opportunities in IoT security.
2. A SMART HOME SYSTEM BASED ON SENSOR TECHNOLOGY
Boban Davidovic , Aleksandra Labus

The system consists of following steps: direct environment sensing,


collecting and analyzing data and then allowing user to customize the settings and
initiate specific commands. This research will present the design and
implementation of a practical and simple smart home system, which can be further
extended. The system is based on: group of sensors, Raspberry Pi device as a server
system and Bluetooth as a communication protocol. These devices can be easily
controlled via user-friendly interface for Android phones. The main advantage of the
proposed system is that it is a sensible, secure and easily configurable system that
provides end users with a neat home automation solution.
3. DEVELOPMENT OF A SMART HOME SYSTEM BASED ON MULTI-
SENSOR DATA FUSION TECHNOLOGY
Po-Huan Chou, Yu-Liang Hsu, Wan-Lung Lee, Yu-Chen Kuo, Chih-Chien Chang,
Yuan-Sheng Cheng, Hsing-Cheng

This study focused on developing a smart home system with multi-sensor data
fusion technology that can control household appliances remotely, position the user
in the indoor environment, and determine the status of the living spaces to achieve
smart entertainment, smart energy management, and home security.
The system includes two wearable inertial sensor devices worn on the hand and
foot, respectively, and a multi-sensor circuit comprising temperature and CO
concentration sensors.
4. THE RESEARCH AND IMPLEMENT OF SMART HOME SYSTEM
BASED ON INTERNET OF THINGS
Gao Chong, Ling Zhihao, Yuan Yifeng

In this paper, the characteristics and disadvantages of smart home system are
analyzed. Then a smart home system based on B/S(Browse/Server) module is
introduced. Through publishing the household wireless sensor network data to the
web page of a remote server, users can control the household devices conveniently
and remotely. Its system architecture, hardware design and implementation approach
are given. This system provides a more flexible and more convenient control for
smart home system and is beneficial for the popularity and promotion of smart home
system.
5. SMART HOME CONTROL SYSTEM BY INTERNET OF THINGS
BASED ON WIFI MODULE
M.Sangeetha, C.Udhayanila, G.Gayathri, N.Rakshana

In this paper we proposed system that allows to monitor and control various
home appliances through this concept. We can control various appliances from
anywhere through internet in case of any emergency situation so that we will be able
to control the appliances safely from remote area through internet of things.
6. Energy efficient Smart home based on Wireless Sensor Network
using LabVIEW

Jayashri Bangali, Arvind Shaligram

The main objective of this Paper is to design and implement a control and
monitor system for smart home. Smart home system consists of many systems that
can be controlled by LabVIEW software with the help of wireless sensor network
starter kit. Wireless connectivity is the main advantage of the developed system.
Similar type of systems can be designed for various applications. However,
LabVIEW software run on host PC, so as long as the host PC is plugged in to a
power source and the sensor nodes have adequate battery power, the software can
be run.
7. EFFICIENT POWER MANAGEMENT IN HOME USING
WIRELESS SENSOR NETWORKS

Gayathri.M , Harish.I

Smart monitoring and controlling system for household electrical appliances


in real time is designed. Thus the power consumption is minimized by providing
periodic alert and managing the power consumption based on the usage of the
customer automatically.The advantages are as follows: no cabling required, easy
inclusion of significant data coming from other meters similarly equipped with
centre to manage the power in an efficient manner.
8. DESIGN AND IMPLEMENTATION OF MONITORING AND CONTROL
YSTEM BASED ON WIRELESS SENSOR NETWORKS FOR AN ENERGY
CONSERVATION IN BUILDING

Shanthi G. M. Sundarambal and Dhivyaa. M

The system description is presented and an overview of system features is


given. This paper focuses on the two key methodologies which are used to
implement energy conservation in building is achieved by monitoring and control
mode. However, there exist shortages inevitably as a result of exploratory research
on applying WSNs to building monitoring and controlling. We will perform further
tests to find problems, and then to improve the performance from both hardware and
software. In Future, it include nodes are able to store normal data locally in order to
save communication energy consumption, but the user queries data depending on
their need. So, the deployment of nodes in the building
environment to be distributed storage and query database. In order to solve this
problem, it is necessary to explore a mechanism for switching automatically. The
automatic control of fan and light connected through Ethernet has been achieved
based on the input from sensors and power monitoring module for efficient energy
management.
9. APPLICATION OF IOT-WSN IN HOME AUTOMATION SYSTEM: A
LITERATURE SURVEY

Prof S A Jain, Stevan Maineka, Pranali Nimgade

The Internet of Things (IoT) is an atmosphere in which objects, animals or


people are make available with distinct identifiers and the capability to transfer data
through a network without requiring human-to-human or human-to-computer
interaction. 'Internet of Things' defines a number of skills and research disciplines
that allow the Internet to reach into the real world of physical objects. Technologies
like short-range wireless communications, RFID, ad hoc and wireless sensor
networks (WSNs) which is the part of Internet of Things (IoT)[10]. The home
automation using Internet of Things and wireless sensor network work satisfactorily
by connecting simple appliances to it and the appliances were successfully
controlled remotely through internet. This paper describes the concept of WSN, IoT
and architecture of Home Automation.
10. A SMART HOME SYSTEM BASED ON SENSOR TECHNOLOGY

Boban Davidovic, Aleksandra Labus

The proposed system consists of following steps: direct environment sensing,


collecting and analysing data and then allowing user to customize the settings and
initiate specific commands. This research will present the design and
implementation of a practical and simple smart home system, which can be further
extended. The system is based on: group of sensors, Raspberry Pi device as a server
system and Bluetooth as a communication protocol. These devices can be easily
controlled via user-friendly interface for Android phones. The main advantage of the
proposed system is that it is a sensible, secure and easily configurable system that
provides end users with a neat home automation solution
CHAPTER 3

METHODOLOGY

PROPOSED SYSTEM

Home automation system has capabilities to control the following components


in users home and monitor the following:
 Temparature Level
 Humidity Level
 Light level
 Lights on/off/dim
 Fan on/off

The model consists of several sensors like Temparature, Humidity, and Light,
also contains relay to control home appliances like fan and light. Initially the
Arduino controller connects to the internet through Wi-Fi module ESP8266 using
AT COMMANDS. All the components communicate with each other using the
wireless protocol When the connection established it will start reading the
parameters of sensors. The threshold value for different sensor is set. The sensor data
are sent to the web server and stored in cloud. The data can be analyzed anywhere
at any time. The motion detection is stored in cloud for analysis. The required lights
are turned on/off automatically by detecting the light outside the house. the user can
also monitor the electric appliances through the internet via web server. If the light
or electrical appliances are left on can be turned off remotely Through simply
clicking the button on web server.
BLOBK DIAGRAM

Power supply

LOAD1 RELAY
IoT CLOUD
module
LOAD2 RELAY

Temparatur
ARDUINO webpage
e

Humidity

PIR
Light
HARDWARE SECTION

3.2.1 POWER SUPPLY

The ac voltage, typically 220v RMS, is connected to a transformer, which


steps down the ac voltage level to a desired ac output. The bridge rectifier then
provides a full-wave rectified voltage that is initially filtered by a simple capacitor
filter to produce a dc voltage that is also filtered by a simple capacitor filter to
produce a dc voltage. This resulting dc voltage usually has some ripple or ac voltage
variation.

A regular circuit removes the ripples and also remains the same dc wave even
if the input dc voltage 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.

POWER SUPPLY BLOCK DIAGRAM

230v AC input Transformer Bridge rectifier Filter

7812
12v DC output
Voltage regulator

Fig 3.3 Power supply block diagram


CIRCUIT DIAGRAM

Fig 3.4 Power supply circuit diagram

WORKING PRINCIPLE

TRANSFORMER

Transformer is a static piece of device which transfer power from one circuit
to another circuit with out any connection and no change in frequency. Here the 12v
step down transformer is used to step down 230v AC supply voltage to 12v AC
voltage. Then the secondary of the step-down transformer will be connected to the
bridge rectifier.

BRIDGE RECTIFIER

A Bridge rectifier is an Alternating Current (AC) to Direct Current (DC)


converter that rectifies mains AC input to DC output. Bridge Rectifiers are widely
used in power supplies that provide necessary DC voltage for the electronic
components or devices. They can be constructed with four or more diodes.
Fig 3.5 Bridge rectifier

OPERATION OF BRIDGE RECTIFIER

From fig-3, during the Positive half cycle of the input AC waveform diodes
D2 and D4 are forward biased and D1 and D3 are reverse biased. When the voltage,
more than the threshold level of the diodes D2 and D4, starts conducting. During the
Negative half cycle of the input AC waveform diodes D1 and D3 are forward biased
and D2 and D4 are reverse biased. When the voltage, more than the threshold level
of the diodes D1 and D3, starts conducting. Thus, by the usage of a bridge rectifier,
the input AC current is converted into a DC current. Output is filtered by 1000uF
capacitor then it is passed to regulator section.

VOLTAGE REGULATOR

Voltage regulator is a type of self-contained fixed linear voltage regulator


integrated circuit. The IC belongs to ic 78xx voltage regulator family which is
commonly used as the regulated power supply in electronic circuits. The last two
digits of 7812 indicates the output voltage.
The 7812 IC have 3 pins, Pin 1 is a positive input, Pin 3 is a positive output
and pin 2 is negative common ground between both input as well as output
voltage. 7812 voltage regulator IC does not require any component to balance or
saturate their output voltage. The 7812 IC has a built-in protection from the high
current. There is a heat-sink with the common ground connected with which is
helpful in order to prevent our regulator IC from overheating and short-circuits
making it uncompromising in the most application.

3.2.2 ARDUINO UNO

The Arduino Uno is a microcontroller board based on the ATmega328


(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM
outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power
jack, an ICSP header, and a reset button. It contains everything needed to support
the microcontroller; simply connect it to a computer with a USB cable or power it
with a AC-to-DC adapter or battery to get started. The Uno differs from all preceding
boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it features
the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to-serial
converter.

SPECIFICATION

Microcontroller ATmega328

Operating Voltage 5V

Input Voltage (recommended) 7-12V

Input Voltage (limits) 6-20V

Digital I/O Pins 14 (of which 6 provide PWM o/p)


Analog Input Pins 6

DC Current per I/O Pin 40 mA

DC Current for 3.3V Pin 50 mA

Flash Memory 32 KB of which 0.5 KB used by bootloader

SRAM 2 KB (ATmega328)

EEPROM 1 KB (ATmega328)

Clock Speed 16 MH

Fig 3.6 Atmega328 pin description


Fig 3.7 Arduino controller board description

POWER

The Arduino Uno can be powered via the USB connection or with an external
power supply. The power source is selected automatically.

External (non-USB) power can come either from an AC-to-DC adapter (wall-
wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive
plug into the board's power jack. Leads from a battery can be inserted in the Gnd
and Vin pin headers of the POWER connector.

The board can operate on an external supply of 6 to 20 volts. If supplied with


less than 7V, however, the 5V pin may supply less than five volts and the board may
be unstable. If using more than 12V, the voltage regulator may overheat and damage
the board. The recommended range is 7 to 12 volts.
The power pins are as follows:

 Vin, The input voltage to the Arduino board when it's using an external power
source (as opposed to 5 volts from the USB connection or other regulated
power source). You can supply voltage through this pin, or, if supplying
voltage via the power jack, access it through this pin.
 5V. The regulated power supply used to power the microcontroller and other
components on the board. This can come either from Vin via an on-board
regulator, or be supplied by USB or another regulated 5V supply.
 3V3. A 3.3volt supply generated by the on-board regulator. Maximum current
draw is 50 mA.
 GND. Ground pins.

MEMORY

The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has
2 KB of SRAM and 1 KB of EEPROM (which can be read and written with
the EEPROM library).

INPUT AND OUTPUT

Each of the 14 digital pins on the Uno can be used as an input or output,
using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5
volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-
up resistor (disconnected by default) of 20-50 kOhms. In addition, some pins have
specialized functions:
 Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial
data. These pins are connected to the corresponding pins of
the ATmega8U2 USB-to-TTL Serial chip.
 External Interrupts: 2 and 3. These pins can be configured to trigger an
interrupt on a low value, a rising or falling edge, or a change in value. See
the attachInterrupt() function for details.
 PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with
the analogWrite() function.
 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.
 LED: 13. There is a built-in LED connected to digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.

The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits
of resolution (i.e. 1024 different values). By default they measure from ground to 5
volts, though is it possible to change the upper end of their range using the AREF
pin and the analogReference() function. Additionally, some pins have specialized
functionality:

 TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using
the Wire library.

There are a couple of other pins on the board:

 AREF. Reference voltage for the analog inputs. Used with analogReference().
 Reset. Bring this line LOW to reset the microcontroller. Typically used to add
a reset button to shields which block the one on the board.
See also the mapping between Arduino pins and ATmega328 ports. The mapping
for the Atmega8, 168, and 328 is identical.

COMMUNICATION

The Arduino Uno has a number of facilities for communicating with a


computer, another Arduino, or other microcontrollers. The ATmega328 provides
UART TTL (5V) serial communication, which is available on digital pins 0 (RX)
and 1 (TX). An ATmega16U2 on the board channels this serial communication over
USB and appears as a virtual com port to software on the computer. The '16U2
firmware uses the standard USB COM drivers, and no external driver is needed.
However, on Windows, a .inf file is required. The Arduino software includes a serial
monitor which allows simple textual data to be sent to and from the Arduino board.
The RX and TX LEDs on the board will flash when data is being transmitted via the
USB-to-serial chip and USB connection to the computer (but not for serial
communication on pins 0 and 1).

A SoftwareSerial library allows for serial communication on any of the Uno's digital
pins.

The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino
software includes a Wire library to simplify use of the I2C bus; see
the documentation for details. For SPI communication, use the SPI library.
PROGRAMMING

The Arduino Uno can be programmed with the Arduino software.


The ATmega328 on the Arduino Uno comes preburned with a bootloader that
allows you to upload new code to it without the use of an external hardware
programmer. It communicates using the original STK500 protocol (reference, C
header files).

AUTOMATIC (SOFTWARE) RESET

Rather than requiring a physical press of the reset button before an upload, the
Arduino Uno is designed in a way that allows it to be reset by software running on
a connected computer. One of the hardware flow control lines (DTR) of
theATmega8U2/16U2 is connected to the reset line of the ATmega328 via a 100
nanofarad capacitor. When this line is asserted (taken low), the reset line drops long
enough to reset the chip.

The Arduino software uses this capability to allow you to upload code by
simply pressing the upload button in the Arduino environment. This means that the
bootloader can have a shorter timeout, as the lowering of DTR can be well-
coordinated with the start of the upload.

This setup has other implications. When the Uno is connected to either a
computer running Mac OS X or Linux, it resets each time a connection is made to it
from software (via USB). For the following half-second or so, the bootloader is
running on the Uno. While it is programmed to ignore malformed data (i.e. anything
besides an upload of new code), it will intercept the first few bytes of data sent to
the board after a connection is opened. If a sketch running on the board receives one-
time configuration or other data when it first starts, make sure that the software with
which it communicates waits a second after opening the connection and before
sending this data.

The Uno contains a trace that can be cut to disable the auto-reset. The pads on
either side of the trace can be soldered together to re-enable it. It's labeled "RESET-
EN". You may also be able to disable the auto-reset by connecting a 110 ohm resistor
from 5V to the reset line; see this forum thread for details.

USB OVERCURRENT PROTECTION

The Arduino Uno has a resettable polyfuse that protects your computer's USB
ports from shorts and overcurrent. Although most computers provide their own
internal protection, the fuse provides an extra layer of protection. If more than 500
mA is applied to the USB port, the fuse will automatically break the connection until
the short or overload is removed.

PHYSICAL CHARACTERISTICS

The maximum length and width of the Uno PCB are 2.7 and 2.1 inches
respectively, with the USB connector and power jack extending beyond the former
dimension. Four screw holes allow the board to be attached to a surface or case. Note
that the distance between digital pins 7 and 8 is 160 mil (0.16"), not an even multiple
of the 100 mil spacing of the other pins
TEMPARATURE SENSOR

A thermistor is a resistance thermometer, or a resistor whose resistance is


dependent on temperature. The term is a combination of “thermal” and “resistor”. It
is made of metallic oxides, pressed into a bead, disk, or cylindrical shape and then
encapsulated with an impermeable material such as epoxy or glass.

There are two types of thermistors: Negative Temperature Coefficient (NTC)


and Positive Temperature Coefficient (PTC). With an NTC thermistor, when the
temperature increases, resistance decreases. Conversely, when temperature
decreases, resistance increases. This type of thermistor is used the most.

A PTC thermistor works a little differently. When temperature increases, the


resistance increases, and when temperature decreases, resistance decreases. This
type of thermistor is generally used as a fuse.

Typically, a thermistor achieves high precision within a limited temperature range


of about 50ºC around the target temperature. This range is dependent on the base
resistance.

The thermistor symbols are:

Figure 1: Thermistor Symbol — US and Japan


The arrow by the T signifies that the resistance is variable based on temperature. The
direction of the arrow or bar is not significant.

Thermistors are easy to use, inexpensive, sturdy, and respond predictably to changes
in temperature. While they do not work well with excessively hot or cold
temperatures, they are the sensor of choice for applications that measure temperature
at a desired base point. They are ideal when very precise temperatures are required.

Some of the most common uses of thermistors are in digital thermometers, in cars
to measure oil and coolant temperatures, and in household appliances such as ovens
and refrigerators, but they are also found in almost any application that requires
heating or cooling protection circuits for safe operation. For more sophisticated
applications, such as laser stabilization detectors, optical blocks, and charge coupled
devices, the thermistor is built in. For example, a 10 kΩ thermistor is the standard
that is built into laser packages.

HUMIDITY SENSOR

Humidity Sensor is one of the most important devices that has been widely in
consumer, industrial, biomedical, and environmental etc. applications for measuring
and monitoring Humidity.

Humidity is defined as the amount of water present in the surrounding air.


This water content in the air is a key factor in the wellness of mankind. For example,
we will feel comfortable even if the temperature is 00C with less humidity i.e. the
air is dry. But if the temperature is 100C and the humidity is high i.e. the water
content of air is high, then we will feel quite uncomfortable. Humidity is also a major
factor for operating sensitive equipment like electronics, industrial equipment,
electrostatic sensitive devices and high voltage devices etc. Such sensitive
equipment must be operated in a humidity environment that is suitable for the device.

LIGHT SENSOR

A Light Sensor generates an output signal indicating the intensity of light by


measuring the radiant energy that exists in a very narrow range of frequencies
basically called “light”, and which ranges in frequency from “Infra-red” to “Visible”
up to “Ultraviolet” light spectrum. The light sensor is a passive devices that convert
this “light energy” whether visible or in the infra-red parts of the spectrum into an
electrical signal output. Light sensors are more commonly known as “Photoelectric
Devices” or “Photo Sensors” because the convert light energy (photons) into
electricity (electrons). Photoelectric devices can be grouped into two main
categories, those which generate electricity when illuminated, such as Photo-
voltaics or Photo-emissives etc, and those which change their electrical properties in
some way such as Photo-resistors or Photo-conductors.
RELAY

A relay is an electrical switch that usue an electromagnet to move the switch


from the off to on position instead of person moving the switch. Relays are used to
turn on larger electrical machines and electrical appliances by sensor currents. It
takes a relatively small amount of power to turn on. When the relay coil is energized
by a small current, the coil will attract a common contact to another contact making
the circuit closed. Relay works on the principle of electromagnetic induction.

A relay is activated when a small current is passed through its coil. The small
current is capable of turning on a secondary circuit which works on much larger
current.
Fig 3.14 Relay

An ordinary relay has two contacts called Normally Open (NO) and Normally
Closed (NC) contacts. We can switch the common terminal to NC or NO. Driver
circuit is needed for the working of relay which is depicited in the below figure 3.15.

In this project grinder is turn on or turn off by means of relay which is


controlled by microcontriller. Since the grinder consumes large amount of power
relay has to withstand it. So we have used 12v/1Amps relay.

ESP8266

The ESP8266 is a low-cost Wi-Fi microchip with full TCP/IP


stack and microcontroller capability produced by manufacturer Espressif SystemS.
This small module allows microcontrollers to connect to a Wi-Fi network and make
simple TCP/IP connections using Hayes-style commands. The ESP8285 is an
ESP8266 with 1 MiB of built-in flash, allowing for single-chip devices capable of
connecting to Wi-Fi. The successor to these microcontroller chips is the ESP32

PINOUT OF ESP-01

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

1. VCC, Voltage (+3.3 V; can handle up to 3.6 V)


2. GND, Ground (0 V)
3. RX, Receive data bit X
4. TX, Transmit data bit X
5. CH_PD, Chip power-down
6. RST, Reset
7. GPIO 0, General-purpose input/output No. 0
8. GPIO 2, General-purpose input/output No. 2
3.3 SOFTWARE SECTION

3.3.1 ARDUINO IDE

The Arduino project provides the Arduino integrated development


environment (IDE), which is a cross-platform application written in the
programming language Java. It originated from the IDE for the
languages Processing and Wiring. It includes a code editor with features such as text
cutting and pasting, searching and replacing text, automatic indenting, brace
matching, and syntax highlighting, and provides simple one-click mechanisms to
compile and upload programs to an Arduino board. It also contains a message area,
a text console, a toolbar with buttons. A program written with the IDE for Arduino
is called a sketch. Sketches are saved on the development computer as text files with
the file extension .ino.

The Arduino IDE supports the languages C and C++. User-written code only
requires two basic functions, for starting the sketch and the main program loop, that
are compiled and linked with a program sub main () into an executable cyclic
executive program with the GNU toolchain, also included with the IDE distribution.
The Arduino IDE employs the program to convert the executable code into a text
file in hexadecimal encoding that is loaded into the Arduino board by a loader
program in the board's firmware.

3.3.2 PROGRAM STRUCTURE

 setup (): This function is called once when a sketch starts after power-up or reset.
It is used to initialize variables, input and output pin modes, and other libraries
needed in the sketch.
 loop (): After setup () has been called, function loop () is executed repeatedly in
the main program. It controls the board until the board is powered off or is reset.
Fig 3.22 Program Structure

REASON FOR USING ARDUINO

Arduino has been used in thousands of different projects and applications. The
Arduino software is easy-to-use for beginners, its simple and accessible user
experience, yet flexible enough for advanced users, it turns on Mac, Windows, and
Linux. Teachers and students use it to build low cost scientific instruments, to prove
chemistry and physics principles, or to get started with programming and robotics.
Designers and architects build interactive prototypes, musicians and instruments.
Makers, of course, use it to build many of the projects exhibited at the maker faire,
for example. Arduino is a key tool to learn new things. Anyone – children, hobbyists,
artists, programmers – can start tinkering just following the step by step instructions
of a kit, or sharing ideas online with other members of the Arduino community.
There are many other microcontrollers and microcontroller platforms
available for physical computing. Parallex Basic Stamp, Net media’s BX-24, Phi
gets, MIT’s handy board, and many others offer similar functionality. All of these
tools take the messy details of microcontroller programming and wrap it up in an
easy-to-use package. Arduino also simplifies the process of working with
microcontrollers, but it offers some advantage for teachers, students, and interested
amateurs over other systems.

INEXPENSIVE

Arduino boards are relatively inexpensive compared to other microcontroller


platforms. The least expensive version of the Arduino module can be assembled by
hand, and even the pre-assembled Arduino modules cost less than $50.

CROSS-PLATFORM

The Arduino Software (IDE) runs on windows, Macintosh OSX, and Linux
operating systems. Most microcontroller systems are limited to Windows.

SIMPLE, CLEAR PROGRAMMING ENVIRONMENT

The Arduino Software (IDE) is easy-to-use for beginners, yet flexible enough
for advanced users to take advantage of as well. For teachers, it’s conveniently based
on the processing programming environment, so students learning to program in that
environment will be familiar with how the Arduino IDE works.

OPEN SOURCE AND EXTENSIBLE SOFTWARE

The Arduino software is published as open source tools, available for


extension by experienced programmers. The language can be expanded through C++
libraries, and people wanting to understand the technical details can make the leap
from Arduino to the AVR C programming language on which it’s based. Similarly,
you can add AVR-C code directly into your Arduino programs if you want to.

OPEN SOURCE AND EXTENSIBLE HARDWARE

The plan of the Arduino boards are published under a creative commons
license, so experienced circuit designers can make their own version of module,
extending it and improving it. Even relatively inexperienced users can build the
breadboard version of the module inorder to understand how it works and save
money.

THE INTEGRATED DEVELOPMENT ENVIRONMENT (IDE)

The core set of development tools operate under the IDE umbrella, called. This
gives a consistent look and feel to all the development tools so that minimal learning
of the new tool interface is required. The IDE integrates all the following aspects of
development:

 Source code editing


 Project management
 Machine code generation (from assembly or “C”)
 Device simulation
 Device emulation
 Device Programming

It is a PC based Windows 3.x application. It has been extensively tested using


Windows 95 and recommended in either of these operating environments. This
comprehensive tool suite allows the complete development of a project without
leaving the environment.

3.3.4 EMBEDDED C

Looking around, we find ourselves to be surrounded by various types of


embedded systems. Be it a digital camera or a mobile phone or a washing machine,
all of them has some kind of processor functioning inside it. Associated with each
processor is the embedded software. If hardware forms the body of the embedded
system, embedded processor acts as the brain, and primarily governs the functioning
of embedded systems. During infancy years of microprocessor based system.
Programs were developed using assembles and fused into the EPROMSs. There used
to be no mechanism to find what the program was doing. LEDs, switches, etc. were
used to check correct execution of the program. Some ‘very fortunate’ developers
had In-circuit simulators (ICEs), but they were too costly and were not quite reliable
as well.

As time progressed, use of microprocessor specific assembly only as the


programming language reduced and embedded systems moved on to C as the
embedded programming language of choices. C is the most widely used
programming language for embedded processors/controllers. Where very high
timing accuracy, code size efficiency, etc. are prime requirements.

Initially C was developed by Kernighan and Ritchie to fit into the space of 8K
and to write (portable) operating systems. Originally it was implemented on UNIX
operating systems. As it was intended for operating systems development, it can
manipulate memory address. Also, it allowed programmers to write very compact
codes. This has given it the reputation as the language of choices for hackers too.
3.3.5 EMBEDDED SYSTEM PROGRAMMING

Embedded systems programming is different from developing applications on a


desktop computers. Key characteristics of an embedded system, when compared to
PCs, are as follows:

 Embedded devices have resource constraints (Limited ROM, Limited RAM,


Limited stack space, less processing power).
 Components used in embedded system and PCs are different embedded
systems typically uses smaller, less power consuming components.
 Embedded systems are more tied to the hardware. Two salient features of
embedded programming are code speed and code size. Code speed is
governed by the processing power, timing constraints, whereas code size is
governed by available program memory and use of programming language.
Goal of embedded system programming is to get maximum features in
minimum space and minimum time.

Embedded systems are programmed using different type of languages:

 Machine code.
 Low level language, i.e., assembly
 Application level language like visual basic, scripts, access, etc.
 High level language like C, C++, Java, Ada, etc.

Assembly language maps mnemonic words with the binary machine codes that
the processor uses to code the instructions. Assembly language seems to be an
obvious choice for programming embedded devices. However, use of assembly
language is restricted to developing efficient codes in terms of size and speed. Also,
assembly codes lead to higher software development costs and code portability is
not there. Developing small codes are not much of a problem, but large
programs/projects become increasingly difficult to manage in assembly language.
Finding good assembly programmers has also become difficult nowadays. Hence
high level language are preferred for embedded system programming.

3.3.6 USE OF C IN EMBEDDED SYSTEMS

 It is small and reasonably simpler to learn, understand, program and debug.


 C compilers are available for almost all embedded devices in use today, and
there is a large pool of experienced C programmers.
 Unlike assembly, C has advantage of processor-independence and is not
specific to any particular microprocessor or microcontroller or any system.
This makes it convenient for a user to develop program that can run on most
of the systems.
 As C combines functionally of assembly language and features of high level
language, C is treated as a ‘middle-level computer language’ or ‘High level
assembly language’.
 It is fairly efficient.
 It supports access to I/O and provides ease of management of large embedded
projects.
CHAPTER 4

RESULT
CHAPTER 5

CONCLUSION

In this paper we proposed system that allows to monitor and control various
home appliances through this concept. We can control various appliances from
anywhere through internet in case of any emergency situation so that we will be able
to control the appliances safely from remote area through internet of things. Also we
can monitor the temperature, humidity and light intensity parameters of the
surrounding using respective sensors.

Você também pode gostar