IOT Load Control World University Final

You might also like

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

Design & Construction of IoT based Load Control &

Safety Security System.

A Report Submitted to the Department of Electrical and Electronic


Engineering at World University of Bangladesh in partial fulfillment of the
requirements for the Award of Degree of Bachelor of Science in Electrical and
Electronic Engineering

Submitted by
Md. Johirul Islam Jony

Reg No.WUB 09/17/63/3867

Masum Billah
Reg No. WUB 09/17/64/4020
Department of EEE

Supervised by
Abdullah Ibna Karim
Lecturer
Department of EEE

World University of Bangladesh

1
Letter of Transmittal

Date: 23 Nov 2020


To
Abdullah Ibna Karim
Lectuter
Department of Electrical and Electronic Engineering
World University of Bangladesh
Dhanmondi, Dhaka -1205.

Subject: Submission of project report.

Dear Sir,
Enclosed please, find the project report on “Design & Construction of IoT based Load
Control & Safety Security System.”. It is a great pleasure to work on such an important
topic and the project report is prepared according to the requirement of the World
University of Bangladesh (WUB). We believe that this report will certainly help you to
evaluate our project work on “Design & Construction of IoT based Load Control & Safety
Security System.”.

We will be very happy to provide any assistance in interpreting any part of the report
whenever necessary. Thanking you with best regards.

Sincerely yours,

_________________________

Md. Johirul Islam Jony

Reg No. WUB 09/17/63/3867

_________________________
Masum Billah
Reg No. WUB 09/17/64/4020

2
Declaration

We hereby, declare that the work presented in this project is the outcome of
the investigation performed by us under the supervision of Abdullah Ibna
Karim, Lecturer of the Electrical & Electronic Engineering Department, World
University of Bangladesh. We also declare that no part of this project report
and there of has been or in being submitted elsewhere for the award of any
degree.

We further undertake to identify the university against any loss or damage


arising from breach of the forgoing obligation.

_________________________

Md. Johirul Islam Jony

Reg No. WUB 09/17/63/3867

_________________________
Masum Billah
Reg No. WUB 09/17/64/4020

3
Certificate

This is to certify that the project report on “Design & Construction of IoT
based Load Control & Safety Security System.”.” is the confide record of the
work done by Md. Johirul Islam Jony, Reg No. WUB 09/17/63/3867 and,
Masum Billah Reg No. WUB 09/17/64/4020 for partial fulfillment of the
requirement of their degree of B.Sc in Electrical and Electronic Engineering at
World University of Bangladesh (WUB).

The project report has been carried out under my guidance and is a confide
record of the successful work. I wish them success in future.
Faculty Guide
Supervised By

________________
Abdullah Ibna Karim
Lecturer
Department of Electrical and Electronic Engineering
World University of Bangladesh

4
Acknowledgement

First we express our heartiest thanks and gratefulness to almighty Allah for his
Divine blessing makes mine possible to complete this project successfully. We
would like to express our gratitude to our Head of Department, Professor Dr.
M. Abdus Samad for providing mine a congenial environment for engineering
studies and also for having showed mine the way to out the project. We feel
grateful to and wish our profound our indebtedness to Abdullah Ibna Karim,
Lecturer, Department of Electrical and Electronic Engineering, World University
of Bangladesh. Deep knowledge and keen interest of our supervisor influenced
mine to carry out this project. His endless patience, scholarly guidance, continual
encouragement, constantan energetic supervision, constructive criticism,
valuable advice at all stage made it possible to complete this project. We would
like to thank our entire course mate in World University of Bangladesh, who took
part in this discuss while completing the course work. Finally, we must
acknowledge with due respect the constant support and patients of our parents.

Thank you all

Authors

_________________________

Md. Johirul Islam Jony

Reg No. WUB 09/17/63/3867

_________________________
Masum Billha
Reg No. WUB 09/17/64/4020

5
Executive Summary

A load control system is a means that allow users to control electric appliances of varying
kind. Many existing, well-established load control systems are based on wired
communication. This does not pose a problem until the system is planned well in advance
and installed during the physical construction of the building. But for already existing
buildings the implementation cost goes very high. In contrast, Wireless systems can be of
great help for automation systems. With the advancement of wireless technologies such
as Wi-Fi, cloud networks in the recent past, wireless systems are used every day and
everywhere. Wireless load control system using IoT is a system that uses computers or
mobile devices to control basic home functions and features automatically through
internet from anywhere around the world.

6
Table of Contents
Name of Contents Page No -1
Letter of Transmittal 2
Declaration 3
Certificate 4
Acknowledgement 5
Executive Summary 6

Chapter 1 Overview
1.1 Introduction 10
1.2 Objectives 10
1.3 Methodology 10
1.4 Justification 10
1.5 Project Layout 11

Chapter 2 System Architecture


2.1 Block Diagram 12
2.2 Schematic Diagram 12
2.3Working Principle 13
2.4 Application and Advantages 14

Chapter 3 Hardware Analysis


3.1 Node MCU 15
3.2 Smoke/Gas Sensor 17
3.3 PIR Sensor 17
3.4 Flame Sensor 20
3.5 Relay Module 21
3.6 DC Motor 23
3.7 LED 23
3.8 Resistors 24
3.9 Jumper wires 25
3.10 Adapter 25
3.11 Bread Board 26

7
Chapter 4 Software Description
4.1 Arduino Software 27
4.2 Proteus 28
4.3 Microcontroller Simulation 29
4.4 PCB Design 30
4.5 3D Verification 30

Chapter 5 Discussion & Conclusion


5.1 Discussion 31
5.2 Conclusion 31

References 32
Appendix 33

8
List of Figures
Figure names Page No
Figure 2.1 Block diagram of design and construction of IoT based Load control and safety security
system 12
Figure 2.2 Design and construction of IoT based load control and safety security system 13
Figure 3.1 Node MCU(ESP-12E) 15
Figure 3.2 Smoke/Gas Sensor 17
Figure 3.3.1 PIR Sensor 18
Figure 3.3.2 PIR sensor Pin Configuration 18
Figure 3.3.3 PIR Sensor 19
Figure 3.4 Flame Sensor 20
Figure 3.5.1 Relay Circuit 21
Figure 3.5.2 Relay Working Process 22
Figure 3.6 DC Motor 23
Figure 3.7 LED 23
Figure 3.8 Resistor 24
Figure 3.9 Jumper Wire 25
Figure 3.10 Adapter(5V) 26
Figure 3.11 Bread Board 26
Figure 4.1 Arduino Software Interface IDE 27

9
Chapter 1
Overview

1.1 Introduction

Load control is a step toward what is referred to as the "Internet of Things," in which everything has an
assigned IP address, and can be monitored and accessed remotely. The trendiness of load control has
increased tremendously in recent years for the reason of higher usability and simplicity by using remote
control (key fob), smart phones and tablet connectivity (through Wi-Fi, GSM, Bluetooth, Zig bee etc.)
Home systems like light, fan, air conditioner, air heater by using different switches in different places.
Therefore, people, especially adult people need to put a lot of afford to switch all those components
separately and with enough power to press. Those switches are mostly made very unsafe way and it is
also asking more energy to put. These problems could be solved if load control and safety security system
would be used.

1.2 Objectives
Load control system has different kinds like, remote control, mobile phone load control. Aim of this
project is to demonstrate an unostentatious safety security system that apprehends an outlying key
controller and home machineries (here I will try to show that by using some LED’s, DC Fan). The home
appliances to be controlled include, lights, switches, air conditioners and also doors & windows.

1.3 Methodology

2 Creating an idea for design and construction of design and construction of IoT based load
control and safety security system and environment monitoring system and designing a
block diagram and circuit diagram to know which components need to construct it.
3 Collecting the all components and programming for the microcontroller to controlled the
system.
4 Setting all components in a PCB board and soldering. Then assembling the all blocks in a
board and finally run the system and checking.

1.4 Justification
Load control system is necessary in that the user can enjoy the user-friendliness of the system in the
control of their home appliances from in or outside home. By using this system anyone can simply
maintain all the home appliances without any physical attendance at home. In addition, helps to save on
time and energy.

10
1.5 Project Layout
In chapter 1st, we describe the Overview design and construction of IoT based load control and safety
security system for this project. In chapter 2nd, we briefly describe the project System Architecture. In
chapter 3rd, we implement those components which we used in the Arduino uno and it’s Hardware
Analysis. In chapter 4th, we describe the Software Description. Finally in chapter 5th, we discuss about
project’s Discussion & Conclusion.

11
Chapter 2
System Architecture

2.1 Block Diagram

A block diagram is shown below of design and construction of IoT based load control and safety security
system. At first to giving ac current source,then use a step down transformer for high voltage convert to
low voltage. Then the voltage makes pure dc by using rectifier. Next step the dc voitage is fixed by using
regulator.And finally the voltage transferred to arduino uno microcontroller for control the full system.
Then the sensors is detected data and send to information to arduino, then the arduino instructions to the
relay and finally send this data in bylnk software. Finally circuit diagram to know which components
need to construct it and collecting the all components and programming for the microcontroller to control
the system depends on the block diagram.Finally the whole system depends on IoT(ESP8266).

Figure 2.1 Block diagram of design and construction of IoT based Load Control and Safety
Security System

12
2.2 Schematic Diagram

Figure 2.2 Design and construction of IoT based Load Control and Safety Security System

2.3 Working Principle

Load control setups often include IoT devices. Wireless load control and safety security system
works by deploying low-power equipment that can send and receive information, such as light
sensors that detect the rising sun and send commands to open your bedroom curtains automatically.

The aim of this project is to design an IoT based Load control and safety security system Using
Arduino Uno, in which different home appliances are remotely controlled using Bylnk app. Now
we’ll see the detailed working of the project.

Once we turn on the microcontroller, all the loads connected to it are switched OFF as it receives
logic high continuously from the receiver. The status of the loads is displayed on the LCD.

2.4 Applications Advantages and Disadvantages Advantages


 It’s easy: Smart homes can be easier to manage and comfortable than conventional houses
because your systems can be aligned to your particular needs. Options may vary from
controlling electronics, media players, home security all the way to the managing the
temperature inside your home.
 It saves energy: Smart homes usually offer energy savings, which provided a cost-friendly
and environmentally friendly alternative to traditional models. The devices themselves
utilize very little electricity but are able to offer better control over climate and lighting in
accordance to how you want to use it. Besides, you can use smart appliances to avoid

13
energy usage during peak times, which can save the environment and your budget.
 Safety: Smart homes often include aspects of security including cameras, alarms, motion
sensors, which all allow the homeowners to monitor what is going on around them through
their smart devices.
 Accessibility: According to research, smart homes offer numerous solutions when it comes
to seniors or those dealing with a disability. Most smart home systems can be equipped
with voice commands, which can lock exterior doors, control lights, or better operate
computerized devices such as a microwave.

Disadvantages

 The cost of investment: Compared to standard load control requires you to chip in a more
significant investment.
 Power Gush: According to information institute, one needs to make sure that their home
is not affected by power bursts which could damage the smart home devices.
 Affinity: There are many load control manufacturers, and not all of their products are
compatible. This can mean needing multiple apps to work different devices. Before
purchasing a smart home device, make sure it is compatible with your core platform.
Common smart home management platforms include Amazon’s Alexa and Google Home.
 Rewiring older homes. Not every home is Smart Home ready. For example, today’s smart
light switches require a neutral wire. Homes built in the 80s or earlier often skipped this
wiring process, so a neutral wire needs to be added to your switch boxes before this type
of device can be added.

14
Chapter 3
Hardware Analysis
3.1 Node MCU (ESP-12E)

Figure 3.1 Node MCU (ESP-12E)

This is the famous NodeMCU which is based on ESP8266 WiFi SoC. This is version 3 and it is
based on ESP-12E (An ESP8266 based WiFi module). NodeMCU is also an open-source firmware
and development kit that helps you to prototype your IoT(Internet of Things) product within a few
LUA script lines, and of course you can always program it with Arduino IDE.

15
Note: In case you are looking for alternative NodeMCU compatible boards, here are some others:
 NodeMCU V2 Doit ESP12E (Narrow) - Narrow width, perfect for breadboard
 WeMo’s D1 Mini ESP8266 Dev Board - More compact

As the width of this NodeMCU is 30mm, covering the entire holes on breadboard, so we do
recommend getting the Base board for it to ease the prototyping. The base board comes with many
extended header pins for the GPIO and also power line.

Features:
 Open-source
 Interactive
 Low cost
 Simple
 Smart
 WiFi enabled
 Arduino-like hardware IO
 Advanced API for hardware IO, which can dramatically reduce the redundant work for
configuring and manipulating hardware
 Code like Arduino, but interactively in Lua script
 Nodes style network API
 Event-driven API for network applications, which faciliates developers writing code
running on a 5mm*5mm sized MCU in Nodes style
 Greatly speed up your IoT application developing process
 Lowest cost WiFi
 Less than $2 WiFi MCU ESP8266 integrated and esay to prototyping development kit
 We provide the best platform for IoT application development at the lowest cost
 Input Voltage:
o 3.3V via 3.3V pin
o 5.0V via Vin or USB

Specifications:
The Development Kit based on ESP8266, integrates GPIO, PWM, IIC, 1-Wire and ADC all in one
board.
 Power your development in the fastest way combination with NodeMCU Firmware!
 USB-TTL included, plug play
 10 GPIO, every GPIO can be PWM, I2C, 1-wire
 PCB antenna

16
3.2 Smoke/Gas Sensor

Figure 3.2 Smoke Sensor

Features:

 Operating Voltage is +5V


 Can be used to Measure or detect LPG, Alcohol, Propane, Hydrogen, CO and even methane
 Analog output voltage: 0V to 5V
 Digital Output Voltage: 0V or 5V (TTL Logic)
 Preheat duration 20 seconds
 Can be used as a Digital or analog sensor
 The Sensitivity of Digital pin can be varied using the potentiometer

3.3 PIR Sensor

The term PIR is the short form of the Passive Infra-Red. The term “passive “indicates that the
sensor does not actively take part in the process, which means, it does not emit the referred IR
signals itself, rather passively detects the infrared radiations coming from the human body in the
surrounding area.

17
Figure 3.3.1 PIR Sensor

.
The detected radiations are converted into an electrical charge, which is proportional to the
detected level of the radiation. Then this charge is further improved by a built in FET and fed to
the output pin of the device which becomes applicable to an external circuit for further triggering
and amplification of the alarm stages. The PIR sensor range is up to 10 meters at an angle of +15o
or -15o.
The below image shows a typical pin configuration of the PIR sensor, which is quite simple to
understand the pinouts; and, one may easily arrange them into a working circuit with the help of
the following points:
The Passive infrared sensors consist of three pins as indicated in the diagram shown below

Figure 3.3.2 PIR sensor Pin Configuration

Pin1 corresponds to the drain terminal of the device, which should be connected to the positive
supply 5V DC.
Pin2 corresponds to the source terminal of the device, which should be connected to the ground
terminal via a 100K or 47K resistor. The Pin2 is the output pin of the sensor, and the detected IR

18
signal is carried forward to an amplifier from the pin 2 of the sensor.Pin3 of the sensor is connected
to the ground.

PIR Sensor’s Working Principle

Figure 3.3.3 PIR Sensor

The PIR sensors are more complicated than the other sensors as they consists of two slots. These
slots are made of a special material which is sensitive to IR. The Fresnel lens is used to see that
the two slots of the PIR can see out past some distance. When the sensor is inactive, then the two
slots sense the same amount of IR. The ambient amount radiates from the outdoors, walls or room
etc.

When a human body or any animal passes by, then it intercepts the first slot of the PIR sensor.
This causes a positive differential change between the two bisects. When a human body leaves the
sensing area, the sensor generates a negative differential change between the two bisects. The
infrared sensor itself is housed in a hermetically sealed metal to improve
humidity/temperature/noise/immunity. There is a window which is made of typically coated
silicon material to protect the sensing element.

19
3.4 Flame Sensor
A sensor which is most sensitive to a normal light is known as a flame sensor. That’s why this
sensor module is used in flame alarms. This sensor detects flame otherwise wavelength within the
range of 760 nm – 1100 nm from the light source. This sensor can be easily damaged to high
temperature. So this sensor can be placed at a certain distance from the flame. The flame detection
can be done from a 100cm distance and the detection angle will be 600. The output of this sensor
is an analog signal or digital signal. These sensors are used in fire fighting robots like as a flame
alarm.
What is a Flame Sensor?
A flame-sensor is one kind of detector which is mainly designed for detecting as well as responding
to the occurrence of a fire or flame. The flame detection response can depend on its fitting. It
includes an alarm system, a natural gas line, propane & a fire suppression system. This sensor is
used in industrial boilers. The main function of this is to give authentication whether the boiler is
properly working or not. The response of these sensors is faster as well as more accurate compare
with a heat/smoke detector because of its mechanism while detecting the flame.

Figure 3.4 Flame Sensor

Features & Specifications


The features of this sensor include the following.
• Photosensitivity is high
• Response time is fast
• Simple to use
• Sensitivity is adjustable
• Detection angle is 600,
• It is responsive to the flame range.
• Accuracy can be adjustable
• Operating voltage of this sensor is 3.3V to 5V
• Analog voltage o/ps and digital switch o/ps
• The PCB size is 3cm X 1.6cm
• Power indicator & digital switch o/p indicator
• If the flame intensity is lighter within 0.8m then the flame test can be activated, if the
flame intensity is high, then the detection of distance will be improved.

20
3.5 Relay Module

A relay is an electrically operated switch. It consists of a set of input terminals for a single or
multiple control signals, and a set of operating contact terminals. The switch may have any
number of contacts in multiple contact forms, such as make contacts, break contacts, or
combinations thereof.

Relay Circuit Diagram

Relays are used where it is necessary to control a circuit by an independent low-power signal, or
where several circuits must be controlled by one signal. Relays were first used in long-distance
telegraph circuits as signal repeaters, they refresh the signal coming in from one circuit by
transmitting it on another circuit. Relays were used extensively in telephone exchanges and early
computers to perform logical operations. The traditional form of a relay uses an electromagnet to
close or open the contacts, but other operating principles have been invented, such as in solid-state
relays which use semiconductor properties for control without relying on moving parts. Relays
with calibrated operating characteristics and sometimes multiple operating coils are used to protect
electrical circuits from overload or faults; in modern electric power systems these functions are
performed by digital instruments still called protective relays. Relays are switches that open and
close circuits electromechanically or electronically. Relays control one electrical circuit by
opening and closing contacts in another circuit. As relay diagrams show, when a relay contact is
normally open (NO), there is an open contact when the relay is not energized. When a relay contact
is Normally Closed (NC), there is a closed contact when the relay is not energized. In either case,
applying electrical current to the contacts will change their state. Relays are generally used to
switch smaller currents in a control circuit and do not usually control power consuming devices
except for small motors and Solenoids that draw low amps. Nonetheless, relays can "control" larger
voltages and amperes by having an amplify.

Figure 3.5.1 Relay Circuit

21
Relay Working Process

When power flows through the first circuit (1) it activates the electromagnet (brown), generating
a magnetic field (blue) that attracts a contact (red) and activates the second circuit (2). When the
power is switched off, a spring pulls the contact back up to its original position, switching the
second circuit off again. This is an example of a "normally open" (NO) relay: the contacts in the
second circuit are not connected by default, and switch on only when a current flows through the
magnet. Other relays are "normally closed" (NC; the contacts are connected so a current flows
through them by default) and switch off only when the magnet is activated, pulling or pushing the
contacts apart. Normally open relays are the most common. Here's another animation showing
how a relay links two circuits together. It's essentially the same thing drawn in a slightly different
way. On the left side, there's an input circuit powered by a switch or a sensor of some kind. When
this circuit is activated, it feeds current to an electromagnet that pulls a metal switch closed and
activates the second, output circuit (on the right side). The relatively small current in the input
circuit thus activates the larger current in the output circuit. Relays don't always turn things on;
sometimes they very helpfully turn things off instead. In power plant equipment and electricity
transmission lines, for example, you'll find protective relays that trip when faults occur to
prevent damage from things like current surges. Electromagnetic relays similar to the ones
described above were once widely used for this purpose. These days, electronic relays based on
integrated circuits do the same job instead; they measure the voltage or current in a circuit and take
action automatically if it exceeds a preset limit. When a small current flows in this circuit, the relay
will activate its output circuit, allowing a much bigger current to flow and turning on the lights.

Figure 3.5.2 Relay Working Process

The input circuit (blue loop) is switched off and no current flows through it until something (either
a sensor or a switch closing) turns it on. The output circuit (red loop) is also switched off and then
the current flow is permanently off. When a small current flows in the input circuit, it activates the
electromagnet (shown here as a dark blue coil), which produces a magnetic field all around it. The
energized electromagnet pulls the metal bar in the output circuit toward it, closing the switch and
allowing a much bigger current to flow through the output circuit. The output circuit operates a

22
high-current appliance such as a lamp. These solid-state devices trigger when the frequency of an
alternating current is high.

3.6 Dc Motor

 Reliable and affordable 5V to 6V DC motor is perfect for hobby projects


 RPM : 2000
 Easily Solderable

Figure: 3.6 DC Motor

 3.7 LED

Figure 3.15 LED

23
A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator lamps
in many devices and are increasingly used for general lighting. Appearing as practical electronic
components in 1962, early LEDs emitted low-intensity red light, but modern versions are available
across the visible, ultraviolet, and infrared wavelengths, with very high brightness. When a light-
emitting diode is switched on, electrons are able to recombine with holes within the device,
releasing energy in the form of photons. This effect is called electroluminescence, and the color of
the light (corresponding to the energy of the photon) is determined by the energy band gap of the
semiconductor. An LED is often small in area (less than 1 mm), and integrated optical components
may be used to shape its radiation pattern. LEDs have many advantages over incandescent light
sources including lower energy consumption, longer lifetime, improved physical robustness,
smaller size, and faster switching.

3.8 Resistors

Figure 3.8 Resistor

A resistor is a passive two-terminal electrical component that implements electrical resistance as


a circuit element. In electronic circuits, resistors are used to reduce current flow, adjust signal
levels, to divide voltages, bias active elements, and terminate transmission lines, among other
uses. High-power resistors that can dissipate many watts of electrical power as heat may be used
as part of motor controls, in power distribution systems, or as test loads for generators. Fixed
resistors have resistances that only change slightly with temperature, time or operating voltage.
Variable resistors can be used to adjust circuit elements (such as a volume control or a lamp

24
dimmer) or as sensing devices for heat, light, humidity, force, or chemical activity

3.9 Jumper Wire

Figure 3.9 Jumper Wire

A jump wire (also known as jumper wire, or jumper) is an electrical wire, or group of them in a
cable, with a connector or pin at each end (or sometimes without them – simply "tinned"), which
is normally used to interconnect the components of a breadboard or other prototype or test circuit,
internally or with other equipment or components, without soldering.
Individual jump wires are fitted by inserting their "end connectors" into the slots provided in a
breadboard, the header connector of a circuit board, or a piece of test equipment.

3.10 Adapter
• Kindly Note: The size of the plug is ID: 1.35 mm and OD: 3.5 mm. Please check if it fits
in the power jack on your devices before your purchase. It doesn't work with common Android
phones or tablets.
• Wide & Universal Application: UGREEN AC-DC adapter is suitable for hubs, switches,
Led Strip, String Lights, Wireless Router, LCD, CCTV Cameras with 1.35mm x 3.5mm DC
Connector. Please kindly note: this product only works for devices with Center Positive Polarity.
• Faster Charging: The AC DC Charger is with 2000mA high current output for faster
charging; It is also backwards compatible with 1000mA and 1500mA device. Important Note:
Please do make sure your device rated voltage is within 4.75V-5.25V. Otherwise this adapter
would not work and even got damaged; Do make sure your device needs smaller than 2A current.
Rated current beyond 2A of your device would trigger the overcurrent protection of this adapter
and cause no charging.
• Stable Charging: Built-in EMI cores filters and enables your device to work normally while
charging without any fuss.
• Longer Transfer Distance: The 5V power supply with 1.5M/5ft power cord and no loss
current, makes long-distance transfer free. READ BEFORE PURCHASE: Please kindly note this
product’s DC Connector size is 1.35mm x 3.5mm. Please confirm the DC port size of your product
before purchase.

25
Figure 3.10 Step Down Transformer

3.11 Bread Board

Figure 3.11 Bread Board

A breadboard is a solder less device for temporary prototype with electronics and test circuit
designs. Most electronic components in electronic circuits can be interconnected by inserting their
leads or terminals into the holes and then making connections through wires where appropriate.

26
CHAPTER 4
SOFTWARE DESCRIPTION

4.1 Arduino Software

The smart microcontroller unit named as Arduino mega can be programmed with the Arduino
software. There is no any requirement for installing other software rather than Arduino. Firstly,
Select "Arduino UNO from the Tools , Board menu (according to the microcontroller on your
board).The IC used named as ATmega328 on the Arduino UNO comes pre burned with a boot
loader that allows you to upload new code to it without the use of an external hardware
programmer.

Figure 4.1: Arduino Software Interface IDE

Communication is using the original STK500 protocol (reference, C header files). We can also
bypass the boot loader and programs the microcontroller through the ICSP (In Circuit Serial
Programming) header. The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source
code is available. The ATmega16U2/8U2 is loaded with a DFU boot loader, which can be
activated. On Rev1 boards: connecting the solder jumper on the back of the board (near the map
of Italy) and then resetting the 8U2. On Rev2 or later boards: there is a resistor that pulling the
8U2/16U2 HWB line to ground, making it easier to put into DFU mode. The Arduino UNO is one
of the latest smart microcontroller units and has a number of facilities for communicating with a

27
computer, another Arduino, or other microcontrollers. The ATmega328 provides UART TTL at
(5V).

Which is available on digital pins 0 -(RX) for receive the data and pin no.1 (TX) for transmit the
data. 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, an .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 Software Serial 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. Arduino programs are written in
C or C++ and the program code written for Arduino is called sketch. The Arduino IDE uses the
GNU tool chain and AVR Libc to compile programs, and for uploading the programs it uses
avrdude. As the Arduino platform uses Atmel microcontrollers, Atmel's development
environment, AVR Studio or the newer Atmel Studio, may also be used to develop software for
an arduino. If you want to program your Arduino Nano while offline you need to install the
Arduino Desktop IDE To connect the Arduino Nano to your computer, you'll need a Mini-B USB
cable. This also provides power to the board, as indicated by the blue LED (which is on the bottom
of the Arduino Nano 2.x and the top of the Arduino Nano 3.0). We have updated the NANO board
with a fresh bootloader. Boards sold from us from January 2018 have this new bootloader, while
boards manufactured before that date have the old bootloader. First, make sure you have the
Arduino AVR Core 1.16.21 or later looking at the Board Manager. Then, to program the NEW
Arduino UNO boards you need to chose Processor > "ATmega328P". To program old boards you
need to choose Processor > "ATmega328P (Old Bootloader)". If you get an error while uploading
or you are not sure which bootloader you have, try each type of processor 328P until your board
gets properly programmed. Ever since computers first entered the world, programming has always
been seen as a rather esoteric process. With all its codes and symbols, programming has never
been very beginner friendly. It usually takes years and years of studying to get even the most basic
concepts down and it’s especially difficult to apply these codes to real work devices. Nowadays,
however, knowing how to code and program is a very useful skill to have. Arduino IDE is a coding
software that makes the programming world more accessible to beginners with its simple interface
and community-driven system. One of the best things about the Arduino IDE is the fact that it’s
community-driven. Arduino has a very active forum where users can share their creations with
other programmers and get feedback and troubleshooting tips. More advanced users can provide
their own tips as well. What’s great about the Arduino IDE is that this focus on community is
accommodated by the software itself.

4.2 Proteus

The Proteus Design Suite is a proprietary software tool suite used primarily for electronic design
automation. The software is used mainly by electronic design engineers and technicians to create

28
schematics and electronic prints for manufacturing printed circuit boards. The first version of what
is now the Proteus Design Suite was called PC-B and was written by the company chairman, John
Jameson, for DOS in 1988. Schematic Capture support followed in 1990, with a port to the
Windows environment shortly thereafter. Mixed mode SPICE Simulation was first integrated into
Proteus in 1996 and microcontroller simulation then arrived in Proteus in 1998. Shape based auto
routing was added in 2002 and 2006 saw another major product update with 3D Board
Visualization. More recently, a dedicated IDE for simulation was added in 2011 and MCAD
import/export was included in 2015. Support for high speed design was added in 2017.Feature led
product releases are typically biannual, while maintenance based service packs are released as
required. Before start simulation need to make sure that in file preferences, compilation is marked.
Because compilation compile the code and generate hex file. This .hex file is needed for running
the proteus simulation. Proteus is the software where we run our simulation. First make sure that
you have Proteus installed in your operating system. If not, then download and install Proteus.
After run the Proteus software, if you don't find arduino in the library. Then, there is a rar file
download it and copy/cut the file. After that paste it into the Proteus library. I am using windows
10 operating system. In my case the location of the Proteus library is, C drive>Program
Files>Labcenter Electronics>Proteus 10 Professional>LIBRARY. After that you will find arduino
in your library. Run arduino IDE and go to File>Examples>01.Basics>Blink and open it. Click on
"Verify" button. Then copy(Ctrl+C) the .hex file. Run the Proteus and draw the circuit like the
picture. You can directly connect Led with pin 13.But it is a good practice to add a 220 ohm resistor
with led in series. Resistor limits the current flow. Double click on arduino and paste the .hex file
in "Program File:".Run the simulation by clicking "Run the simulation" button. LED is blinking if
everything is okay. The Proteus Design Suite is a proprietary software tool suite used primarily for
electronic design automation. The software is used mainly by electronic design engineers and
technicians to create schematics and electronic prints for manufacturing printed circuit boards. The
Proteus Design Suite is a Windows application for schematic capture, simulation, and PCB
(Printed Circuit Board) layout design. It can be purchased in many configurations, depending on
the size of designs being produced and the requirements for microcontroller simulation. All PCB
Design products include an auto router and basic mixed mode SPICE simulation capabilities.
Schematic capture in the Proteus Design Suite is used for both the simulation of designs and as the
design phase of a PCB layout project. It is therefore a core component and is included with all
product configurations. The templates provided in the Arduino IDE are extremely helpful. Of
course, not all of them will be relevant to what you’re doing, but they are great for starting out.
They have some very basic codes such as Blink and Keyboard Logout that users can utilize to
create more complex codes. You can either use those codes to create other codes with similar
functions, or you can add those codes to other codes to create multi-functional codes. Once the
sketches have been created, users can easily upload their sketches to their chose Arduino boards.

4.3 Microcontroller Simulation

The micro-controller simulation in proteus works by applying either a hex file or a debug file to
the microcontroller part on the schematic. It is then co-simulated along with any analog and digital
electronics connected to it. This enables its use in a broad spectrum of project prototyping in areas
such as motor control, temperature control and user interface design. It also finds use in the general
hobbyist community and, since no hardware is required, is convenient to use as a training or
teaching tool. Support is available for co- simulation of:

29
Microchip Technologies PIC10, PIC12, PIC16, PIC18, PIC24, dsPIC33.
Atmel AVR (and Arduino), 8051 and ARM Cortex-M3 Microcontrollers.
NXP 8051, ARM7, ARM Cortex and ARM Cortex-M3 Microcontrollers.
Texas Instruments MSP430, DSP and ARM Cortex-M3 Microcontrollers.
Parallax Basic Stamp, PICCOLs Free scale HC11, 8086 Microcontrollers.

4.4 PCB Design

The PCB Layout module is automatically given connectivity information in the form of a net list
from the schematic capture module. It applies this information, together with the user specified
design rules and various design automation tools, to assist with error free board design. PCB's of
up to 16 copper layers can be produced with design size limited by product configuration.

4.5 3D Verification
The 3D Viewer module allows the board under development to be viewed in 3D together with a
semi-transparent height plane that represents the board’s enclosure. STEP output can then be used
to transfer to mechanical CAD software such as Solid works or Autodesk for accurate mounting
and positioning of the board.

30
Chapter 5
Discussion & Conclusion

5.1 Discussion
The heart of Arduino circuit is the low power, high performance microcontroller is programmed
by embedded assembly programming language for implementing these tasks; this program is
stored and operated by means of storage device EPROM.
While coming to the functional block i.e. LEDs, these components are in expensive, smaller in
size, less complexity, highly reliable, low power applications, minimum risk with greater accuracy.
The project is successfully implemented in many home based on the experimental verification
proving that it can save the electrical power to greater extent removing the manual work
completely; the system became the origin for upcoming advanced intelligent systems in saving
both human and electrical power. The switching of the LEDs is operated through coding applied
in Microcontroller using Arduino software.

5.2 Conclusion

This project could be design in nature by using handy portable key fob facility. The cost of the
project is also not that high and it is also take less time to consume. This project can be useful for
the people who want to use unconventional way to use switches and that can help to reduce
exceeding use of energy and power, such as electricity. So, overall it could be a beneficiary project
for the partial and busy and urban life. However, this project can be upgraded by using GSM
modem, which can control home appliances by sending a sms. Benefit of Using this technology

31
References

[1]http://www.electronicshub.org/rf-remote-control-circuit-for-home-appliances/

[2] http://arif‐ece.blogspot.com/2010/05/tv‐remote‐controlled‐home‐appliance.html

[3]http://www.electronicshub.org/wireless-transmitter-and-receiver-using-rf- modules.html

[4]http://www.circuitstoday.com/category/remote‐circuits

[5] www.beyondlogic.org

[6] www.wikipedia.org

[7] http://www.satsleuth.com/schematics.html

[8]http://www.printsasia.com/book/Electronic‐Projects‐for‐Beginners‐Using‐Easily‐

AvailableElectronic‐Components‐with‐A‐Primer‐on‐Basic‐8122301525‐9788122301526

[9] http://www.dapj.net/hobby/?paged=2

[10] http://extremeelectronics.co.in/

[11] BIBILOGRAPHY

32
Appendix

#include <LiquidCrystal.h>

const int rs = 13, en = 12, d4 = 11, d5 = 10, d6 = 9, d7 = 8;


LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

#define relay1 A2
#define relay2 A3
#define relay3 A4
#define relay4 A5

int a, b, c, d;
int Check = 0, SensorVal = 0, val, count = 1;
String sms;

void setup() {
lcd.begin(16, 2);
pinMode(2, INPUT);
pinMode(3, INPUT);
pinMode(4, INPUT);
pinMode(relay1, OUTPUT);
pinMode(relay2, OUTPUT);
pinMode(relay3, OUTPUT);
pinMode(relay4, OUTPUT);
Serial.begin(9600); // initialize serial
}

void loop() {
smoke();
a = digitalRead(2);
b = digitalRead(3);
c = digitalRead(4);

if (a == 0 && b == 0 && c == 0) {
digitalWrite(relay1, LOW);
digitalWrite(relay2, LOW);
digitalWrite(relay3, LOW);
digitalWrite(relay4, LOW);
lcd.clear();
lcd.setCursor(5, 0);
lcd.print("Load All");
lcd.setCursor(6, 1);
lcd.print("Closed"); delay(1000);
}

33
else if (a == 0 && b == 0 && c == 1) {
digitalWrite(relay1, LOW);
digitalWrite(relay2, LOW);
digitalWrite(relay3, LOW);
digitalWrite(relay4, HIGH);
lcd.clear();
lcd.setCursor(6, 0);
lcd.print("Load C");
lcd.setCursor(7, 1);
lcd.print("Open"); delay(1000);
}
else if (a == 0 && b == 1 && c == 0) {
digitalWrite(relay1, LOW);
digitalWrite(relay2, HIGH);
digitalWrite(relay3, HIGH);
digitalWrite(relay4, LOW);
lcd.clear();
lcd.setCursor(6, 0);
lcd.print("Load B");
lcd.setCursor(7, 1);
lcd.print("Open"); delay(1000);
}
else if (a == 0 && b == 1 && c == 1) {
digitalWrite(relay1, LOW);
digitalWrite(relay2, HIGH);
digitalWrite(relay4, HIGH);
digitalWrite(relay3, HIGH);
lcd.clear();
lcd.setCursor(5, 0);
lcd.print("Load BC");
lcd.setCursor(7, 1);
lcd.print("Open"); delay(1000);
}
else if (a == 1 && b == 0 && c == 0) {
digitalWrite(relay1, HIGH);
digitalWrite(relay2, LOW);
digitalWrite(relay3, LOW);
digitalWrite(relay4, LOW);
lcd.clear();
lcd.setCursor(6, 0);
lcd.print("Load A");
lcd.setCursor(7, 1);
lcd.print("Open"); delay(1000);
}
else if (a == 1 && b == 0 && c == 1) {
digitalWrite(relay1, HIGH);

34
digitalWrite(relay2, LOW);
digitalWrite(relay3, LOW);
digitalWrite(relay4, HIGH);
lcd.clear();
lcd.setCursor(5, 0);
lcd.print("Load AC");
lcd.setCursor(7, 1);
lcd.print("Open"); delay(1000);
}
else if (a == 1 && b == 1 && c == 0) {
digitalWrite(relay1, HIGH);
digitalWrite(relay2, HIGH);
digitalWrite(relay3, HIGH);
digitalWrite(relay4, LOW);
lcd.clear();
lcd.setCursor(5, 0);
lcd.print("Load AB");
lcd.setCursor(7, 1);
lcd.print("Open"); delay(1000);
}
else if (a == 1 && b == 1 && c == 1) {
digitalWrite(relay1, HIGH);
digitalWrite(relay2, HIGH);
digitalWrite(relay3, HIGH);
digitalWrite(relay4, HIGH);
lcd.clear();
lcd.setCursor(5, 0);
lcd.print("Load All");
lcd.setCursor(7, 1);
lcd.print("Open");
delay(1000);
}

void smoke() {
SensorVal = analogRead(A0);
val = digitalRead(A1);
// Serial.println(SensorVal);
if (SensorVal < 110) {
Check = 1;
} else {
Check = 0;
}
if (Check == 1 && val == 1) {
Serial.println("Smoke Detected,Your Home Under the Risk and An Object is Detected . . .");

35
sms = "Smoke Detected,Your Home Under the Risk and An Object is Detected . . .";
SendMessage();
}
else if (Check == 1 && val == 0) {
Serial.println("Smoke Detected,Your Home Under the Risk . . .");
sms = "Smoke Detected,Your Home Under the Risk . . .";
SendMessage();

36

You might also like