Sei sulla pagina 1di 29

1

Chapter 1
INTRODUCTION

Opening and closing of shutter have been always a boring job, especially
in places where a person is always required to open the shutter. Here is a solution
to open and close the shutter. Here we use an Arduino Nano board, a Bluetooth
module and a proximity sensor to control the whole operation. Arduino Nano is a
compact and breadboard-friendly version board based on ATmega328 processor.
It is more or less same functionality as the Arduino UNO but in different package.
Instead of using the standard USB to connect to the computer, it uses the mini u s
b but without the power plug for external power source that built on Arduino
UNO. The dimension of Arduino Nano is only 43mm x 18mm, it comes with 6
PWM I/O from the total of 14 digitals I/O, 8 analogue inputs, 16Mhz clock speed
and 32kB of flash memory.
Transparent wireless serial connection setup. The HC-05 Bluetooth Module
can be used in a Master or Slave configuration, making it a great solution for
wireless communication. This serial port Bluetooth module is fully qualified
Bluetooth3Mbps Modulation with complete 2.4GHz radio transceiver and
baseband. It uses CSR Blue core 04‐External single chip Bluetooth system with
CMOS technology and with AFH (Adaptive Frequency Hopping Feature).The
slave modules cannot initiate a connection to another Bluetooth device, but can
accept connections. Master module can initiate a connection to other devices. The
user can use it simply for a serial port replacement to establish connection between
MCU and GPS, PC to your embedded project, etc. Just go through the datasheet
for more detail. A proximity sensor is a sensor able to detect the presence of
nearby objects without any physical contact.
It uses a motion-detecting sensor (PIR sensor) to open or close the door
which detects the infrared energy omitted from human's body. When someone
comes in front of the door, the infrared energy detected by the sensor changes and
it triggers the sensor to open the door whenever someone approaches the door.
2

The signal is further sent to arduino uno that controls the door. A proximity
sensor often emits an electromagnetic field or a beam of electromagnetic
radiation (infrared, for instance), and looks for changes the field or return
signal. The object being sensed is often referred to as the proximity sensor's target.
Different proximity sensor targets demanded different sensors. For example, a
capacitive Proximity sensor. Photoelectric be suitable for a plastic target;
inductive Proximity sensor requires a metal target.

Proximity sensors can have a high reliability and long functional life
because of the absence of mechanical parts and lack of physical contact between
the sensor and the sensed object.Proximity sensors are also used in machine
vibration monitoring to measure the variation in distance between a shaft and its
support bearing. This is common in large steam turbines, compressors, and motors
that use sleeve-types bearings

After the huge progress made in the field of electronics that touched
everything of our basic necessities, garage doors was not an exception. Several
garage doors are available that can be opened with remote control and they come
with various safety measures for the users. So the advantages and disadvantages
of various existing types of garage doors are observed and one model is selected
for further development in the project.

We create a mobile application to control the whole system by using


Bluetooth.
3

Chapter 2

BLOCK DIAGRAM

PROXIMITY
SENSOR

Fig 1
4

Chapter 3

DESIGN

Fig 2
5

Chapter 4

HARDWARE REQUIREMENT

Components Quantity

 Arduino Nano 1

 Bluetooth HC05 1

 Motordriver L293D 1

 Proximity sensor 1

 Motor 5v 1

 Stopper switch 1

Table. 1

4.1 Arduino Nano

The Arduino Nano is a small, complete, and breadboard-friendly board


based on the ATmega328 (Arduino Nano 3.0) or ATmega168 (Arduino Nano
2.x). It has more or less the same functionality of the Arduino Duemilanove, but
in a different package. It lacks only a DC power jack, and works with a Mini-B
USB instead of a standard one. The Nano was designed and is beingproduced by
Gravitech.
6

Fig 3

Arduino Nano 2.3 (ATmega168): manual (pdf), Eagle files. Note: since the free
version of Eagle does not handle more than 2 layers, and this version of the Nano
is 4 layers, it is published here unrouted, so users can open and use it in the free
version of Eagle.

Specifications:

 Microcontroller Atmel ATmega168 or ATmega328


 OperatingVoltage: (logic level) 5 V
 Input Voltage: (recommended) 7-12 V
 Input Voltage: (limits) 6-20 Video
 Analog Input Pins: 8
 DC Current per I/O Pin: 40 mA
 Flash Memory: 16 KB (ATmega168) or 32 KB (ATmega328) of which 2
KB used by bootloader
 SRAM: 1 KB (ATmega168) or 2 KB (ATmega328)
 EEPROM: 512 bytes (ATmega168) or 1 KB (ATmega328)
 Clock Speed: 16 MHz
Power:

The Arduino Nano can be powered via the Mini-B USB connection, 6-20V
unregulated external power supply (pin 30), or 5V regulated external power
supply (pin 27). The power source is automatically selected to the highest voltage
source.
7

The FTDI FT232RL chip on the Nano is only powered if the board is being
powered over USB. As a result, when running on external (non-USB) power, the
3.3V output (which is supplied by the FTDI chip) is not available and the RX and
TX LEDs will flicker if digital pins 0 or 1 are high.

Memory

The cable has 16 KB of flash memory for storing code (of which 2 KB is used for
the bootloader); the ATmega328 has 32 KB, (also with 2 KB used for the
bootloader). The ATmega168 has 1 KB of SRAM and 512 bytes of EEPROM
(which can be read and written with the EEPROM library); the ATmega328 has
2 KB of SRAM and 1 KB of EEPROM.

Input and Output

Each of the 14 digital pins on the Nano can be used as an input or output, using
pin Mode(), digital Write(), 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 FTDI 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 attach Interrupt() function for details.

PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the
analogeWrite() function.

SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI


communication, which, although provided by the underlying hardware, is not
currently included in the Arduino language.

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 Nano has 8 analog inputs, each of which provide 10 bits of resolution
(i.e. 1024 different values). By default they measure from ground to 5 volts,
8

though is it possible to change the upper end of their range using the
analogReference() function. Additionally, some pins have specialized
functionality:

I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the
Wire library (documentation on the Wiring website).

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 ATmega168 ports.

Communication

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


computer, another Arduino, or other microcontrollers. The ATmega168 and
ATmega328 provide UART TTL (5V) serial communication, which is available
on digital pins 0 (RX) and 1 (TX). An FTDI FT232RL on the board channels this
serial communication over USB and the FTDI drivers (included with the Arduino
software) provide a virtual com port to software on the computer. 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 FTDI 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


Nano's digital pins.

The ATmega168 and ATmega328 also support I2C (TWI) and SPI
communication. The Arduino software includes a Wire library to simplify use of
the I2C bus; see the documentation for details. To use the SPI communication,
please see the ATmega168 or ATmega328 datasheet.
9

Programming

The Arduino Nano can be programmed with the Arduino software


(download). Select "Arduino Diecimila, Duemilanove, or Nano w/ ATmega168"
or "Arduino Duemilanove or Nano w/ ATmega328" from the Tools > Board menu
(according to the microcontroller on your board). For details, see the reference
and tutorials.The ATmega168 or ATmega328 on the Arduino Nano 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).You can also bypass the bootloader
and program the microcontroller through the ICSP (In-Circuit Serial
Programming) header; see these instructions for details.

Automatic (Software) Reset

Rather then requiring a physical press of the reset button before an upload,
the Arduino Nano 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 the FT232RL is connected to the reset line of the ATmega168 or ATmega328
via a 100 nano farad 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 Nano 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 Nano. 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.
10

4.2 Bluetooth HC 05

HC 05 Module is an easy to use bluetooth app designed for transparent


wireless serial connection setup. The HC-05 Bluetooth Module can be used in a
Master or Slave configuration, making it a great solution for wireless
communication. This serial port bluetooth module is fully qualified Bluetooth
V2.0+EDR (Enhanced Data Rate) 3Mbps Modulation with complete 2.4GHz
radio transceiver and baseband. It uses CSR Bluecore 04‐External single chip
Bluetooth system with CMOS technology and with AFH (Adaptive Frequency
Hopping Feature).

Bluetooth Module HC-05


The Bluetooth module HC-05 is a MASTER/SLAVE module. By default
the factory setting is SLAVE. The Role of the module (Master or Slave) can be
configured only by AT Commands,the slave modules cannot initiate a connection
to another Bluetooth device, but can accept connections. Master module can
initiate a connection to other devices.The user can use it simply for a serial port
replacement to establish connection between MCU and GPS, PC to your
embedded project, etc. Just go through the datasheet for more details
File:Datasheet.pdf

Hardware Features

 Typical ‐80dBm sensitivity.


 Up to +4dBm RF transmit power.
 3.3 to 5 V I/O.
 PIO(Programmable Input/Output) control.
 UART interface with programmable baud rate.
 With integrated antenna.
 With edge connecto
11

Software Features

 Slave default Baud rate: 9600, Data bits:8, Stop bit:1,Parity:No parity.
 Auto‐connect to the last device on power as default.
 Permit pairing device to connect as default.
 Auto‐pairing PINCODE:”1234” as default.

Pin Description
The HC-05 Bluetooth Module has 6pins. They are as follows:

ENABLE:
When enable is pulled LOW, the module is disabled which means the

Fig 4

module will not turn on and it fails to communicate. open or


connectedWhenenable is left to 3.3V, the module is enabled i.e. the
module remains on and communication also takes place.
Vcc:
Supply Voltage 3.3V to 5V
GND:
Ground pin
TXD & RXD:
12

These two pins acts as an UART interface for communication STATE:


 It acts as a status indicator. When the module is not connected to paired
with any other Bluetooth device, signal goes Low. At this low state, the
ledflashes continuously which denotes that the module is not paired with
other device. When this module is connected to/paired with
 any other Bluetoothdevice, the signal goes High. At this high state, the led
blinks with a constant delay say for example 2s delay which indicates that the
module is paired.
4.3 BUTTON SWITCH:
This is used to switch the module into AT command mode. To enable AT
command mode, press the button switch for a second.With the help of AT
commands,the user can change the parameters of this module but only when the
module is not paired with any other BT device. If the module is connected to any
other Bluetooth device, it starts to communicate with that device and fails to work
in AT command mode.

How to connect HC05 blue tooth module with Arduino Uno?


Hardware and Software Required

HC-05 Bluetooth Module


 Arduino Uno
 Arduino IDE(1.0.6V)

Hardware Connections

As we know that Vcc and Gnd of the module goes to Vcc and Gnd of Arduino.
The TXD pin goes to RXD pin of Arduino and RXD pin goes to TXD pin of
Arduino i.e.(digital pin 0 and 1).The user can use the on board Led. But here,LED
is connected to digital pin 12 externally for betterment of the process
13

4.4 Proximity sensor

A proximity sensor is a sensor able to detect the presence of nearby objects


without any physical contact.
A proximity sensor often emits an electromagnetic field or a

Fig 5

beam of electromagnetic radiation (infrared, for instance), and looks for changes in
the field or return signal. The object being sensed is often referred to as the
proximity sensor's target. Different proximity sensor targets demanded different
sensors. For example, a capacitive Proximity sensor. Photoelectric be suitable for
a plastic target; inductive Proximity sensor requires a metal target.

Proximity sensors can have a high reliability and long functional life
because of the absence of mechanical parts and lack of physical contact between
the sensor and the sensed object. Proximity sensors are also used in machine
vibration monitoring to measure the variation in distance between a shaft and its
support bearing. This is common in large steam turbines, compressors, and motors
that use sleeve-types bearing.Proximity Sensor" includes all sensors that perform
non-contact detection in comparison to sensors, such as limit switches, that detect
objects by physically contacting them. Proximity Sensors convert information on
the movement or presence of an object into an electrical signal. There are three
types of detection systems that do this conversion: systems that use the eddy
currents that are generated in metallic sensing objects by electromagnetic
14

induction, systems that detect changes in electrical capacity when approaching the
sensing object, and systems that use magnets and reed switches.
The Japanese Industrial Standards (JIS) define Proximity Sensors in JIS C 8201-
5-2 (Low-voltage switchgear and control gear, Part 5: Control circuit devices and
switching elements, Section 2: Proximity switches), which conforms to the IEC
60947-5-2 definition of non-contact position detection switches.
JIS gives the generic name "proximity switch" to all sensors that provide non-
contact detection of target objects that are close by or within the general vicinity
of the sensor, and classifies them as inductive, capacitive, ultrasonic,
photoelectric,etc.

This Technical Explanation defines all inductive sensors that are used for
detecting metallic objects, capacitive sensors that are used for detecting metallic
or non-metallic objects, and sensors that utilize magnetic DC fields as Proximity
Sensors.

Features

1. Proximity Sensors detect an object without touching it, and they therefore do not cause
abrasion or damage to the object.

Devices such as limit switches detect an object by contacting it, but Proximity Sensors
are able to detect the presence of the object electrically, without having to touch it.

2. No contacts are used for output, so the Sensor has a longer service life (excluding
sensors that use magnets).

Proximity Sensors use semiconductor outputs, so there are no contacts to affect the
service life.

3. Unlike optical detection methods, Proximity Sensors are suitable for use in locations
where water or oil is used.

Detection takes place with almost no effect from dirt, oil, or water on the object being
detected. Models with fluorosis cases are also available for excellent chemical
resistance.

4. Proximity Sensors provide high-speed response, compared with switches that require
physical contact.
15

For information on high-speed response, refer to Explanation of Terms.

5. Proximity Sensors can be used in a wide temperature range.

Proximity Sensors can be used in temperatures ranging from -40 to 200°C.

6. Proximity Sensors are not affected by colours.

Proximity Sensors detect the physical changes of an object, so they are almost
completely unaffected by the object's surface colour.

7. Unlike switches, which rely on physical contact, Proximity Sensors are affected by
ambient temperatures, surrounding objects, and other Sensors.

Both Inductive and Capacitive Proximity Sensors are affected by interaction with other
Sensors. Because of this, care must be taken when installing them to prevent mutual
interference.
Care must also be taken to prevent the effects of surrounding metallic objects on
Inductive Proximity Sensors, and to prevent the effects of all surrounding objects on
Capacitive Proximity Sensors.

8. There are Two-wire Sensors.

The power line and signal line are combined. If only the power line is wired, internal
elements may be damaged.
Always insert a load. (Refer to the Precautions for Safe Use in the Safety Precautions
for All Proximity Sensors.)

Operating Principles

Detection Principle of Inductive Proximity Sensors

Inductive Proximity Sensors detect magnetic loss due to eddy currents that are generated
on a conductive surface by an external magnetic field. An AC magnetic field is generated
on the detection coil, and changes in the impedance due to eddy currents generated on a
metallic object are detected.
Other methods include Aluminum-detecting Sensors, which detect the phase component
of the frequency, and All-metal Sensors, which use a working coil to detect only the
changed component of the impedance. There are also Pulse-response Sensors, which
generate an eddy current in pulses and detect the time change in the eddy current with
the voltage induced in the coil.

(Qualitative Explanation)

The sensing object and Sensor form what appears to be a transformer-like relationship.
16

Fig 6

The transformer-like coupling condition is replaced by impedance changes due to eddy-


current losses. The impedance changes can be viewed as changes in the resistance that
is inserted in series with the sensing object.

Detection Principle of Capacitive Proximity Sensors

Fig 7

Capacitive Proximity Sensors detect changes in the capacitance between the sensing
object and the Sensor. The amount of capacitance varies depending on the size and
distance of the sensing object. An ordinary Capacitive Proximity Sensor is similar to a
capacitor with two parallel plates, where the capacity of the two plates is detected. One
of the plates is the object being measured (with an imaginary ground), and the other is
the Sensor's sensing surface.
17

The changes in the capacity generated between these two poles are detected.
The objects that can be detected depend on their dielectric constant, but they include
resin and water in addition to metals.

Detection Principle of Magnetic Proximity Sensors

The reed end of the switch is operated by a magnet. When the reed switch is turned ON,
the Sensor is turned ON.

Fig 8

Application
 Parking sensors, systems mounted on car bumpers that sense distance to nearby
cars for parking
 Ground proximity warning system for aviation safety
 Vibration measurements of rotating shafts in machinery
18

 Top dead centre (TDC)/camshaft sensor in reciprocating engines.


 Sheet break sensing in paper machine.

 Anti-aircraft warfare
 Roller coasters
 Conveyor systems
 Beverage and food can making
 Mobile devices
 Touch screens that come in close proximity to the face
 Attenuating radio power in close proximity to the body, in order to reduce.

Type of sensors

 Capacitive
 Capacitive displacement sensor
 Doppler effect (sensor based on Doppler effect)
 Eddy-current
 Inductive
 Magnetic, including magnetic proximity fuse
 Optical

 Photoelectric
 Photocell (reflective)
 Laser rangefinder
 Passive (such as charge-coupled devices)
 Passive thermal infrared
 Radar

 Reflection of ionizing -radiation

 Sonar (typically active or passive)


 Ultrasonic sensor
 Fibre optics sensor
19

4.5 L293D MOTOR DRIVER IC

L293D is a typical Motor driver or Motor Driver IC which allows DC motor to


drive on either direction. L293D is a 16-pin IC which can control a set of two DC
motors simultaneously in any direction. It means that you can control two DC
motor with a single L293D IC. Dual H-bridge Motor Driver integrated circuit
(IC).The l293d can drive small and quiet big motors as well, check the Voltage
Specification at the end of this page for more info.You can Buy L293D IC in any
electronic shop very easily and it costs around 70 Rupees (INR) or around 1 $
Dollar (approx. Cost) or even lesser cost. You can find the necessary pin diagram,
working, a circuit diagram, Logic description And Project as you read

Fig 9

working

It works on the concept of H-bridge. H-bridge is a circuit which allows the


voltage to be flown in either direction. As you know voltage need to change its
direction for being able to rotate the motor in clockwise or anticlockwise
direction, Hence H-bridge IC are ideal for driving a DC motor.
20

In a single L293D chip there are two h-Bridge circuit inside the IC which can rotate
two dc motor independently. Due its size it is very much used in robotic application
for controlling DC motors. Given below is the pin diagram of a L293D motor
controller. There are two Enable pins on l293d. Pin 1 and pin 9, for being able to drive
the motor, the pin 1 and 9 need to be high. For driving the motor with left H-bridge
you need to enable pin 1 to high. And for right H-Bridge you need to make the pin 9
to high. If anyone of the either pin1 or pin9 goes low then the motor in the
corresponding section will suspend working. It’s like a switch.
There are 4 input pins for l293d, pin 2,7 on the left and pin 15 ,10 on the right as
shown on the pin diagram. Left input pins will regulate the rotation of motor connected
across left side and right input for motor on the right-hand side. The motors are rotated
on the basis of the inputs provided across the input pins as

fig 10
Let’s consider a Motor connected on left side output pins (pin 3,6). For rotating the
motor in clockwise direction, the input pins have to be provided with Logic 1 and
Logic
21

Logic table

• Pin 2 = Logic 1 and Pin 7 = Logic 0| Clockwise Direction


• Pin 2 = Logic 0 and Pin 7 = Logic 1| Anticlockwise Direction
• Pin 2 = Logic 0 and Pin 7 = Logic 0 | Idle [No rotation] [Hi-Impedance state]
• Pin 2 = Logic 1 and Pin 7 = Logic 1 | Idle [No rotation]

In a very similar way the motor can also operate across input pin 15,10 for
motor on the right hand side.
Voltage specification

VCC is the voltage that it needs for its own internal operation 5v; L293D
will not use this voltage for driving the motor. For driving the motors, it has a
separate provision to provide motor supply VSS (V supply). L293d will use this
to drive the motor. It means if you want to operate a motor at 9V then you need
to provide a Supply of 9V across VSS Motor supply.

The maximum voltage for VSS motor supply is 36V. It can supply a max
current of 600mA per channel. Since it can drive motors Up to 36v hence you can
drive pretty big motors with this l293d.

VCC pin 16 is the voltage for its own internal Operation. The maximum voltage
ranges from 5v and up to 36v.

TIP: Don’t Exceed the vmax Voltage of 36 volts or it will cause damage.

4.6 DC mini motor

A DC motor is any of a class of rotary electrical machines that converts


direct current electrical energy into mechanical energy. The most common types
rely on the forces produced by magnetic fields. Nearly all types of DC motors
have some internal mechanism, either electromechanical or electronic, to
22

periodically change the direction of current flow in part of the motor.

Fig 11

DC motors were the first type widely used, since they could be powered from
existing direct-current lighting power distribution systems. A DC motor's speed can
be controlled over a wide range, using either a variable supply voltage or by changing
the strength of current in its field windings. Small DC motors are used in tools, toys,
and appliances. The universal motor can operate on direct current but is a
lightweight brushed motor used for portable power tools and appliances. Larger DC
motors are used in propulsion of electric vehicles, elevator and hoists, or in drives for
steel rolling mills. The advent of power electronics has made replacement of DC
motors with AC motor possible

4.7 PCB

A printed circuit board (PCB) mechanically supports and electrically connects


electronic components or electrical components using conductive tracks, pads and
other features etched from one or more sheet layers of copper laminated onto
and/or between sheet layers of a non- conductive substrate. Components are
generally soldered onto the PCB to both electrically connect and mechanically fasten
them to it. Alternatives to PCBs include wire wrap and point-to-point construction,
both once popular but now rarely used.
23

PCBs require additional design effort to lay out the circuit, but manufacturing
and assembly can be automated. Specialized CAD software is available to do much of
the work of layout. Mass-producing circuits with PCBs is cheaper and faster than with
other wiring methods, as components are mounted and wired in one operation. Large
numbers of PCBs can be fabricated at the same time, and the layout only has to be
done once. PCBs can also be made manually in small quantities, with reduced benefits.

PCBs can be single-sided (one copper layer), double-sided (two copper layers on
both sides of one substrate layer), or multi-layer (outer and inner layers of copper,
alternating with layers of substrate). Multi-layer PCBs allow for much higher
component density, because circuit traces on the inner layers would otherwise take up
surface space between components. The rise in popularity of multilayer PCBs with
more than two, and especially with more than four, copper planes was concurrent with
the adoption of surface mount technology. However, multilayer PCBs make repair,
analysis, and field modification of circuits much more difficult and usually
impractical.
24

Chapter 5
SOFTWARE REQUIREMENT

PROGRAM

char data = 0; //Variable for storing received data


void setup()
{
Serial.begin(9600);
pinMode(2, OUTPUT); //motor_pin1
pinMode(3, OUTPUT); //motor_pin2
pinMode(4, INPUT); //switch1
pinMode(5, INPUT); //switch2
pinMode(7, INPUT); //proximity
pinMode(8, OUTPUT); // buzzer
}
void loop()
{
if(Serial.available() > 0) // Send data only when you receive data:
{
data = Serial.read();
Serial.print(data);
Serial.print("\n");
if(data == '1')
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
}
else if(data == '0')
{ digitalWrite(2, LOW);
digitalWrite(3, HIGH);
}
if (digitalRead(4)==HIGH)
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
}
else{
//donothing
}

if (digitalRead(5)==HIGH)
{
25

digitalWrite(2, LOW);
digitalWrite(3, LOW);
}
else{
//donothing
}
if (digitalRead(7)==HIGH)
{
digitalWrite(8, HIGH);

}
else{
digitalWrite(8, LOW);
}

}
26

APPLICATION

Chapter 5

To open and close the shutter using smart phone


To avoid men action
Protection from strangers
To increase safety
27

Chapter 6

RESULT

The use of automatic shutter opener with PIR sensor leads to reduce the
action of men at this area and the proximity sensor help sense a person still in
front of the shutter Opening and closing of shutter have been always a boring
job, especially in places where a person is always required to open the shutter.
Here is a solution to open and close the shutter. Here we use an Arduino Nano
board, a Bluetooth module and a proximity sensor to control the whole
operation. Arduino Nano is a compact and breadboard-friendly version board
based on ATmega328 processor. It is more or less same functionality as the
Arduino UNO but in different package. Instead of using the standard USB to
connect to the computer, it uses the mini u s b but without the power plug for
external power source that built on Arduino UNO. The dimension of Arduino
Nano is only 43mm x 18mm, it comes with 6 PWM I/O from the total of 14
digitals I/O, 8 analogue inputs, 16Mhz clock speed and 32kB of flash memory.
Transparent wireless serial connection setup. The HC-05 Bluetooth Module
can be used in a Master or Slave configuration, making it a great solution for
wireless communication. This serial port Bluetooth module is fully qualified
Bluetooth3Mbps Modulation with complete 2.4GHz radio transceiver and
baseband. It uses CSR Blue core 04‐External single chip Bluetooth system with
CMOS technology and with AFH (Adaptive Frequency Hopping Feature).The
slave modules cannot initiate a connection to another Bluetooth device, but can
accept connections. Master module can initiate a connection to other devices. The
user can use it simply for a serial port replacement to establish connection between
MCU and GPS, PC to your embedded project, etc. Just go through the datasheet
for more detail. A proximity sensor is a sensor able to detect the presence of
nearby objects without any physical contact.
28

Chapter 7

CONCLUSION
The system used in this project will help all of the new comers in the
department of home automation and sensing. This project increases our
knowledge and it build a strong mentality about home automation. Here we use
an Arduino Nano board, a Bluetooth module and a proximity sensor to control the
whole operation. Arduino Nano is a compact and breadboard-friendly version
board based on ATmega328 processor. It is more or less same functionality as the
Arduino UNO but in different package.

Instead of using the standard USB to connect to the computer, it uses the
mini u s b but without the power plug for external power source that built on
Arduino UNO. The dimension of Arduino Nano is only 43mm x 18mm, it comes
with 6 PWM I/O from the total of 14 digitals I/O, 8 analogue inputs, 16Mhz clock
speed and 32kB of flash memory. Transparent wireless serial connection setup.
The HC-05 Bluetooth Module can be used in a Master or Slave configuration,
making it a great solution for wireless communication. This serial port Bluetooth
module is fully qualified Bluetooth3Mbps Modulation with complete 2.4GHz
radio transceiver and baseband. It uses CSR Blue core 04‐External single chip
Bluetooth system with CMOS technology and with AFH (Adaptive Frequency
Hopping Feature).
29

Chapter 8
REFERENCE
 https://store.arduino.cc/usa/arduino-uno-rev3

 https://www.arduino.cc/

 https://en.wikipedia.org/wiki/Arduino_Uno

 https://www.trossenrobotics.com/p/arduino-uno.aspx

 https://www.industrial.ai/bently-nevada/sensors/proximity-

sensors?gclid=EAIaIQobChMI7Nqrtu-

D4QIVlYqPCh1_dwujEAAYASAAEgJCgPD_BwE

 https://en.wikipedia.org/wiki/Proximity_sensor

 http://www.ia.omron.com/support/guide/41/introduction.html

 https://www.mouser.in/Sensors/Proximity-Sensors/_/N-7h7mq

 https://www.elprocus.com/simple-proximity-sensor-circuit-

and-working/

 https://www.techopedia.com/definition/15003/proximity-sensor

 https://www.keyence.com/ss/products/sensor/sensorbasics/prox

imity/info/

Potrebbero piacerti anche