Vous êtes sur la page 1sur 55

CHAPTER 1

INTRODUCTION

1.1 General

A movable spy robot with a remote controller is implemented. The robot is not quite huge
one and designed to be easy in transportation. The remote controller is to control the robot to
reach the desirable destination. The spy robot is made up of PICs microcontroller, a wireless
camera, an antenna, batteries and four movable wheels. The robot will transmit the images
that are spied via antenna to the laptop for a good spying system.

The user will get required information due to a movable the spy robot and seeing the
images when it spies. The system is to build a spy robot that has a wireless camera and the
capabilities to control the movement by using the remote controller. The images will appear
on the laptop which is intended for the visual. In this research, the wireless camera is
involved the two direction to rotate left and right. It is just only to monitor the images around
the robot. The block diagram of remote operated spy robot is shown in figure.

1.2 SCOPE OF THE PROJECT

Scope of the project is to handle the spy in efficient way and to operate the spy anywhere
in the world through internet that is to reduce the human energy and time. It is also has the
scope for security purpose and industrial purpose.

1.3 EXISTING SYSTEM

The project is to design and develop an intelligence robot to detect dangerous Gas/Smoke
by using a microcontroller. The robot is designed to move as per the command given by the
controller. To move in all the direction like forward, reverse, right and left. If any gas/smoke
detected, robot will switch ON the Alarm Unit. The video and audio are monitored at the
remote PC. For transmitting audio and video, wireless camera has been used.

Department of Electrical and Electronics Engineering Page 1


1.4 PROPOSED SYSTEM

The proposed system composed of surveillance robot, wireless charge control station.
Surveillance robot is rectangular shape and it has three wheels. It communicates with device
through wireless medium such as Bluetooth. Robot has some sensors like Humidity,
Temperature, Ultra sonic and PIR. Humidity sensor senses the Humidity around the robot.
While Temperature sensor senses the climate changes based on the numerical temperature
value. Ultra sonic sensor senses the object present in the way in which the robot has to go.
PIR sensor senses the presence of human near the robot. These sensor notations and the
information can be received in the mobile with the use of a GSM module. Each and every
change can be sensed and the changes can be seen in a mobile through a message. The
wireless charging system charges the battery in the robot and it gives the power to all the
other modules.

1.5 PROPOSED SYSTEM TECHNIQUE

The proposed system SPY ROBOT uses Embedded System with a technique of
PIC16F866 micro controller with a software of keil uv vision.

By using the hardware components DC gear motor, Batteries, RF module, IR sensor, light
emitting diodes, transmitter, receiver and spy camera. Spy camera is connected to the internet
and operation of the robot is done within a some range and section of viewing can be done
throughout the world via internet

Department of Electrical and Electronics Engineering Page 2


CHAPTER 2

EMBEDDED SYSTEM

2.1 Introduction to Embedded Systems

An embedded system is a computer system designed to perform one or a few dedicated


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

Embedded systems are controlled by one or more main processing cores that are
typically either microcontrollers or digital signal processors (DSP). The key characteristic,
however, is being dedicated to handle a particular task, which may require very powerful
processors. For example, air traffic control systems may usefully be viewed as embedded, even
though they involve mainframe computers and dedicated regional and national networks
between airports and radar sites.

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

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

In general, "embedded system" is not a strictly definable term, as most systems have
some element of extensibility or programmability. For example, handheld computers share
some elements with embedded systems such as the operating systems and microprocessors
which power them, but they allow different applications to be loaded and peripherals to be
connected. Moreover, even systems which don't expose programmability as a primary feature
generally need to support software updates.

Department of Electrical and Electronics Engineering Page 3


On a continuum from "general purpose" to "embedded", large application systems will have
subcomponents at most points even if the system as a whole is "designed to perform one or a
few dedicated functions", and is thus appropriate to call "embedded". A modern example of
embedded system is shown in fig: 2.1.

Fig 2.1:A modern example of embedded system

Labeled parts include microprocessor (4), RAM (6), flash memory (7).Embedded
systems programming is not like normal PC programming. In many ways, programming for an
embedded system is like programming PC 15 years ago. The hardware for the system is usually
chosen to make the device as cheap as possible. Spending an extra dollar a unit in order to
make things easier to program can cost millions. Hiring a programmer for an extra month is
cheap in comparison. This means the programmer must make do with slow processors and low
memory, while at the same time battling a need for efficiency not seen in most PC applications.
Below is a list of issues specific to the embedded field.

2.2 History

In the earliest years of computers in the 1930–40s, computers were sometimes


dedicated to a single task, but were far too large and expensive for most kinds of tasks
performed by embedded computers of today. Over time however, the concept of programmable
controllers evolved from traditional electromechanical sequencers, via solid state devices, to
the use of computer technology.

Department of Electrical and Electronics Engineering Page 4


One of the first recognizably modern embedded systems was the Apollo Guidance
Computer, developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the
project's inception, the Apollo guidance computer was considered the riskiest item in the
Apollo project as it employed the then newly developed monolithic integrated circuits to reduce
the size and weight. An early mass-produced embedded system was the Automatics D-17
guidance computer for the Minuteman missile, released in 1961. It was built
from transistor logic and had a hard disk for main memory. When the Minuteman II went into
production in 1966, the D-17 was replaced with a new computer that was the first high-volume
use of integrated circuits.

2.3 Tools

Embedded development makes up a small fraction of total programming. There's also


a large number of embedded architectures, unlike the PC world where 1 instruction set rules,
and the Unix world where there's only 3 or 4 major ones. This means that the tools are more
expensive. It also means that they're lowering featured, and less developed. On a major
embedded project, at some point you will almost always find a compiler bug of some sort.

Debugging tools are another issue. Since you can't always run general programs on your
embedded processor, you can't always run a debugger on it. This makes fixing your program
difficult. Special hardware such as JTAG ports can overcome this issue in part. However, if
you stop on a breakpoint when your system is controlling real world hardware (such as a
motor), permanent equipment damage can occur. As a result, people doing embedded
programming quickly become masters at using serial IO channels and error message style
debugging.

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

 Interactive resident debugging, using the simple shell provided by the embedded
operating system (e.g. Forth and Basic.

Department of Electrical and Electronics Engineering Page 5


 External debugging using logging or serial port output to trace operation using either a
monitor in flash or using a debug server like the Remedy Debugger which even works
for heterogeneous multicore systems.
 An in-circuit debugger (ICD), a hardware device that connects to the microprocessor via
a JTAG or Nexus interface. This allows the operation of the microprocessor to be
controlled externally, but is typically restricted to specific debugging capabilities in the
processor.
 An in-circuit emulator replaces the microprocessor with a simulated equivalent,
providing full control over all aspects of the microprocessor.
 A complete emulator provides a simulation of all aspects of the hardware, allowing all
of it to be controlled and modified and allowing debugging on a normal PC.
 Unless restricted to external debugging, the programmer can typically load and run
software through the tools, view the code running in the processor.
stop operation.
Because an embedded system is often composed of a wide variety of elements, the
debugging strategy may vary. For instance, debugging a software (and microprocessor) centric
embedded system is different from debugging an embedded system where most of the
processing is performed by peripherals (DSP, FPGA, co-processor). An increasing number of
embedded systems today use more than one single processor core.
A common problem with multi-core development is the proper synchronization of software
execution. In such a case, the embedded system design may wish to check the data traffic on
the busses between the processor cores, which requires very low-level debugging, at signal/bus
level, with a logic analyzer, for instance.

Reliability

Embedded systems often reside in machines that are expected to run continuously for
years without errors and in some cases recover by themselves if an error occurs.

Therefore the software is usually developed and tested more carefully than that for
personal computers, and unreliable mechanical moving parts such as disk drives, switches or
buttons are avoided.

Specific reliability issues may include

Department of Electrical and Electronics Engineering Page 6


 The system cannot safely be shut down for repair, or it is too inaccessible to repair.
Examples include space systems, undersea cables, navigational beacons, bore-hole
systems, and automobiles.
 The system must be kept running for safety reasons. "Limp modes" are less tolerable.
Often backups are selected by an operator. Examples include aircraft navigation, reactor
control systems, safety-critical chemical factory controls, train signals, engines on
single-engine aircraft.
 The system will lose large amounts of money when shut down: Telephone switches,
factory controls, bridge and elevator controls, funds transfer and market making,
automated sales and service.
A variety of techniques are used, sometimes in combination, to recover from errors—
both software bugs such as memory leaks, and also soft errors in the hardware:
 Watchdog timer that resets the computer unless the software periodically notifies the
watchdog
 Subsystems with redundant spares that can be switched over to
 software "limp modes" that provide partial function

2.5 Explanation of Embedded Systems

Software Architecture

There are several different types of software architecture in common use.

Simple Control Loop

In this design, the software simply has a loop. The loop calls subroutines, each of which
manages a part of the hardware or software.

Interrupt Controlled System

Some embedded systems are predominantly interrupt controlled. This means that tasks
performed by the system are triggered by different kinds of events. An interrupt could be
generated for example by a timer in a predefined frequency, or by a serial port controller

Department of Electrical and Electronics Engineering Page 7


receiving a byte. These kinds of systems are used if event handlers need low latency and the
event handlers are short and simple.

Cooperative Multitasking

A non-preemptive multitasking system is very similar to the simple control loop


scheme, except that the loop is hidden in an API. The programmer defines a series of tasks,
and each task gets its own environment to “run” in. When a task is idle, it calls an idle routine,
usually called “pause”, “wait”, “yield”, “nop” (stands for no operation), etc.

The advantages and disadvantages are very similar to the control loop, except that
adding new software is easier, by simply writing a new task, or adding to the queue-interpreter.

Primitive Multitasking

This is the level at which the system is generally considered to have an "operating
system" kernel. Depending on how much functionality is required, it introduces more or less
of the complexities of managing multiple tasks running conceptually in parallel.

As any code can potentially damage the data of another task (except in larger systems using
an MMU) programs must be carefully designed and tested, and access to shared data must be
controlled by some synchronization strategy, semaphores or a non-blocking synchronization
scheme.

Real-time embedded systems

Embedded systems which are used to perform a specific task or operation in a specific
time period those systems are called as real-time embedded systems. There are two types of
real-time embedded systems.

Hard Real-time embedded systems

These embedded systems follow an absolute dead line time period i.e.., if the tasking is
not done in a particular time period then there is a cause of damage to the entire equipment.

Department of Electrical and Electronics Engineering Page 8


Soft Real Time embedded systems :These embedded systems follow a relative dead line time
period i.e.., if the task is not done in a particular time that will not cause damage to the
equipment.

Eg: Consider a TV remote control system, if the remote control takes a few milliseconds delay
it will not cause damage either to the TV or to the remote control. These systems which will
not cause damage when they are not operated at considerable time period those systems comes
under soft real-time embedded systems.

2.6 Network communication embedded systems

A wide range network interfacing communication is provided by using embedded


systems. E.g., Consider a web camera that is connected to the computer with internet can be
used to spread

Whenever a person comes near the door, it captures the image of a person and sends to
the desktop of your computer which is connected to internet. This gives an alerting message
with image on to the desktop of your computer, and then you can open the door lock just by
clicking the mouse. Fig: 2.2 show the network communications in embedded systems.

Department of Electrical and Electronics Engineering Page 9


Fig 2.2: Network communication embedded system

Different types of processing units

The central processing unit (c.p.u) can be any one of the following microprocessor,
microcontroller, digital signal processing.

 Among these Microcontroller is of low cost processor and one of the main advantage
of microcontrollers is, the components such as memory, serial communication
interfaces, analogto digital converters etc.., all these are built on a single chip.

 The numbers of external components that are connected to it are very less according to
the application

 Microprocessors are more powerful than microcontrollers. They are used in major
applications with a number of tasking requirements.

2.7 APPLICATIONS OF EMBEDDED SYSTEMS

1. Consumer applications:

At home we use a number of embedded systems which include microwave oven, remote
control, vcd players, dvd players, camera etc….

Fig.2.3: Automatic coffee makes equipment

Department of Electrical and Electronics Engineering Page 10


2. Office automation

We use systems like fax machine, modem, printer etc…

Fig.2.4: Fax machine

3. Industrial automation

Today a lot of industries are using embedded systems for process control. In industries
we design the embedded systems to perform a specific operation like monitoring temperature,
pressure, humidity ,voltage, current etc.., and basing on these monitored levels we do control
other devices, we can send information to a centralized monitoring station.

In critical industries where human presence is avoided there we can use robots which are
programme

Department of Electrical and Electronics Engineering Page 11


CHAPTER 3

MICROCONTROLLER

3.1 PIN DIAGRAM OF 8051 MICROCONTROLLER

The pin diagram of 8051 microcontroller looks as follows −

 Pins 1 to 8 − These pins are known as Port 1. This port doesn’t serve any other
functions. It is internally pulled up, bi-directional I/O port.

 Pin 9 − It is a RESET pin, which is used to reset the microcontroller to its initial
values.

Department of Electrical and Electronics Engineering Page 12


 Pins 10 to 17 − These pins are known as Port 3. This port serves some functions like
interrupts, timer input, control signals, serial communication signals RxD and TxD,
etc.

 Pins 18 & 19 − These pins are used for interfacing an external crystal to get the
system clock.

 Pin 20 − This pin provides the power supply to the circuit.

 Pins 21 to 28 − These pins are known as Port 2. It serves as I/O port. Higher order
address bus signals are also multiplexed using this port.

 Pin 29 − This is PSEN pin which stands for Program Store Enable. It is used to read
a signal from the external program memory.

 Pin 30 − This is EA pin which stands for External Access input. It is used to
enable/disable the external memory interfacing.

 Pin 31 − This is ALE pin which stands for Address Latch Enable. It is used to
demultiplex the address-data signal of port.

 Pins 32 to 39 − These pins are known as Port 0. It serves as I/O port. Lower order
address and data bus signals are multiplexed using this port.

 Pin 40 − This pin is used to provide power supply to the circuit.

3.2 Features of 8051 microcontroller:

 4 KB on chip program memory.


 128 bytes on chip data memory(RAM).
 128 user defined software flags.
 8-bit data bus
 16-bit address bus
 32 general purpose registers each of 8 bits
 16 bit timers (usually 2, but may have more, or less).
 3 internal and 2 external interrupts.
 Bit as well as byte addressable RAM area of 16 bytes.

Department of Electrical and Electronics Engineering Page 13


 Four 8-bit ports, (short models have two 8-bit ports).
 16-bit program counter and data pointer.
 1 Microsecond instruction cycle with 12 MHz Crystal.

8051 models may also have a number of special, model-specific features, such as UARTs,
ADC, OpAmps, etc…

3.3 8051 ARCHITECTURE:

8051 microcontroller is designed by Intel in 1981. It is an 8-bit microcontroller. It is built with


40 pins DIP (dual inline package), 4kb of ROM storage and 128 bytes of RAM storage, 2 16-
bit timers. It consists of are four parallel 8-bit ports, which are programmable as well as
addressable as per the requirement. An on-chip crystal oscillator is integrated in the
microcontroller having crystal frequency of 12 MHz.

Let us now discuss the architecture of 8051 Microcontroller.

In the following diagram, the system bus connects all the support devices to the CPU. The
system bus consists of an 8-bit data bus, a 16-bit address bus and bus control signals. All other
devices like program memory, ports, data memory, serial interface, interrupt control, timers,
and the CPU are all interfaced together through the system bus.

Department of Electrical and Electronics Engineering Page 14


Fig.3.3 8051 Architecture

8051 microcontrollers have 4 I/O ports each of 8-bit, which can be configured as input or
output. Hence, total 32 input/output pins allow the microcontroller to be connected with the
peripheral devices.

 Pin configuration: i.e. the pin can be configured as 1 for input and 0 for output as
per the logic state.

o Input/Output (I/O) pin − All the circuits within the microcontroller must
be connected to one of its pins except P0 port because it does not have pull-up
resistors built-in.

o Input pin − Logic 1 is applied to a bit of the P register. The output FE


transistor is turned off and the other pin remains connected to the power supply
voltage over a pull-up resistor of high resistance.

 Port 0 − The P0 (zero) port is characterized by two functions −


o When the external memory is used then the lower address byte (addresses
A0A7) is applied on it, else all bits of this port are configured as input/output.

Department of Electrical and Electronics Engineering Page 15


o When P0 port is configured as an output then other ports consisting of pins with
built-in pull-up resistor connected by its end to 5V power supply, the pins of
this port have this resistor left out.

3.4 Input Configuration


If any pin of this port is configured as an input, then it acts as if it “floats”, i.e. the input has
unlimited input resistance and in-determined potential.

3.5 Output Configuration


When the pin is configured as an output, then it acts as an “open drain”. By applying logic 0
to a port bit, the appropriate pin will be connected to ground (0V), and applying logic 1, the
external output will keep on “floating”.

In order to apply logic 1 (5V) on this output pin, it is necessary to build an external pullup
resistor.

Port 1
P1 is a true I/O port as it doesn’t have any alternative functions as in P0, but this port can be
configured as general I/O only. It has a built-in pull-up resistor and is completely compatible
with TTL circuits.

Port 2
P2 is similar to P0 when the external memory is used. Pins of this port occupy addresses
intended for the external memory chip. This port can be used for higher address byte with
addresses A8-A15. When no memory is added then this port can be used as a general
input/output port similar to Port 1.

Port 3
In this port, functions are similar to other ports except that the logic 1 must be applied to
appropriate bit of the P3 register.

3.6 PIC Microcontrollers:

Department of Electrical and Electronics Engineering Page 16


The microcontroller unit (MCU) is now big, or rather small, in electronics. It is one of the most

significant developments in the continuing miniaturization of electronic hardware. Now, even

trivial products, such as a musical birthday card or electronic price tag, can include an MCU.

They are an important factor in the digitization of analog systems, such as sound systems or

television. In addition, they provide an essential component of larger systems, such as

automobiles, robots, and industrial systems. There is no escape from microcontrollers, so it is

pretty useful to know how they work. The computer or digital controller has three main

elements: input and output devices, which communicate with the outside world; a processor,

to make calculations and handle data operations; and memory, to store programs and data.

Figure 1.1 shows these in a little more detail. Unlike the conventional microprocessor system

(such as a PC), which has separate chips on a printed circuit board, the microcontroller contains

all these elements in one chip. The MCU is essentially a computer on a chip; however, it still

needs input and output devices, such as a keypad and display, to form a working system. The

microcontroller stores its program in ROM (read only memory). In the past, UV (ultraviolet)

erasable programmable ROM (EPROM) was used for prototyping or small batch production,

and one-time programmable ROM for longer product runs. Programmable ROM chips are

programmed in the final stages of manufacture, while EPROM could be programmed by the

user.

Department of Electrical and Electronics Engineering Page 17


3.7 MCU Features:

The range of microcontrollers now available developed because the features of the MCU used

in any particular circuit must be as closely matched as possible to the actual needs of the

application. Some of the main features to consider are

● Number of inputs and outputs.

● Program memory size.

● Data RAM size.

● Nonvolatile data memory.

● Maximum clock speed.

● Range of interfaces.

● Development system support.

● Cost and availability.

The PIC16F877A is useful as a reference device because it has a minimal instruction set but

a full range of peripheral features. The general approach to microcontroller application design

followed here is to develop a design using a chip that has spare capacity, and then later select

a related device that has the set of features most closely matching the application requirements.

If necessary, we can drop down to a lower range (PIC10/12 series), or if it becomes clear that

more power is needed, we can move up to a higher specification chip (PIC18/24 series). This

is possible as all devices have the same core architecture and compatible instructions sets.

Department of Electrical and Electronics Engineering Page 18


The most significant variation among PIC chips is the instruction size, which can be 12, 14, or

16 bits. The A suffix indicates that the chip has a maximum clock speed of 20 MHz, the main

upgrade from the original 16F877 device. These chips can otherwise be regarded as identical,

the suffix being optional for most purposes. The 16F877A pin-out is seen in Figure 1.2 and

the internal architecture in Figure 1.3 . The latter is a somewhat simplified version of the

definitive block diagram in the data sheet. Program Execution The chip has 8k (8096 / 14 bits)

of flash ROM program memory, which has to be programmed via the serial programming pins

PGM, PGC, and PGD. The fixed-length instructions contain both the operation code and

operand (immediate data, register address, or jump address). The mid-range PIC has a limited

number of instructions (35) and is therefore classified as a RISC (reduced instruction set

computer) processor.

Department of Electrical and Electronics Engineering Page 19


3.8 PIC16f877 Pin description:
Pin No. Pin Name Description

1. !MCLR/VPP Master Clear (input) or high voltage ICSP programming

enable pin.

2. RA0/AN0 PORTA Digital I/O-Analog input 0.

3. RA1/AN1 PORTA Digital I/O-Analog input 1.

4. RA2/AN2/VREF-/CVref Digital I/O-Analog input 2.-A/D Reference Voltage (Low) input.

5. RA3/AN3/VREF+ Digital I/O-Analog input 3-A/D Reference Voltage (High) input.

Department of Electrical and Electronics Engineering Page 20


6. RA4/T0CKI/C1OUT Digital I/O. Open drain when configured as output-Timer0 external
clock input and Comparator1 output.

7. RA5/AN4/SS/C2OUT Digital I/O-Analog input 4.-SPI Slave Select input.

Comparator2 output.

8. RE0/!RD/AN5 PORTE Digital I/O-Read control for parallel slave port- Analog input 5

9. RE1/!WR/AN6 Digital I/O-Write control for parallel slave port- Analog input 6

10. RE2/!CS/AN7 Digital I/O-Chip Select control for parallel slave port-

Analog input 7.

11,32. VDD Positive supply for logic and I/O pins.

12,31. VSS Ground reference for logic and I/O pins.

13. OSC1/CLKI Oscillator crystal or external clock input.

14. OSC2/CLKO Oscillator crystal or clock output.

15. RC0/T1OSO/T1CKI Digital I/O-Timer1 oscillator output.-Timer1/Timer3 external clock


input.

16. RC1/T1OSI/CCP2 Digital I/O-Timer1 oscillator input-Capture2 input, Compare2 output,


PWM2 output.

17. RC2/CCP1 Digital I/O-Capture1 input/Compare1 output/PWM1 output.

18. RC3/SCK/SCL Digital I/O-Synchronous serial clock input/output for

SPI mode-Synchronous serial clock input/output for

I2C mode.

19. RD0/PSP0 Digital I/O-Parallel Slave Port Data

20. RD1/PSP1 Digital I/O-Parallel Slave Port Data.

21. RD2/PSP2 Digital I/O-Parallel Slave Port Data.

22. RD3/PSP3 Digital I/O-Parallel Slave Port Data

23. RC4/SDI/SDA Digital I/O-SPI Data In-I2C Data I/O.

24. RC5/SDO Digital I/O-SPI Data Out.

25. RC6/TX/CK Digital I/O-USART Asynchronous Transmit-

Department of Electrical and Electronics Engineering Page 21


USART Synchronous Clock (see related RX/DT).

26. RC7/RX/DT Digital I/O-USART Asynchronous Receive.

USART Synchronous Data (see related TX/CK).

27. RD4/PSP4 Digital I/O-Parallel Slave Port Data.

28. RD5/PSP5 Digital I/O-Parallel Slave Port Data.

29. RD6/PSP6 Digital I/O-Parallel Slave Port Data.

30. RD7/PSP7 Digital I/O-Parallel Slave Port Data.

33. RB0/INT Digital I/O-External Interrupt

34. RB1 Digital I/O

35. RB2 Digital I/O

36. RB3 Digital I/O

37. RB4 Digital I/O. Interrupt-on-change pin

38. RB5 Digital I/O. Interrupt-on-change pin

39. RB6/PGC Digital I/O. Interrupt-on-change pin.-In-Circuit Debugger and ICSP


programming clock pin

40. RB7/PGD Digital I/O. Interrupt-on-change pin.-In-Circuit Debugger and ICSP


programming data pin

3.9 I/O PORTS:-

Depending on the device selected, there are either five ports or three ports available. Some pins of

the I/O ports are multiplexed with an alternate function from the peripheral features on the device.

In general, when a peripheral is enabled, that pin may not be used as a general purpose I/O pin. Each

port has three registers for its operation. These registers are:

Department of Electrical and Electronics Engineering Page 22


• TRIS register (data direction register)

• PORT register (reads the levels on the pins of the device)

• LAT register (output latch)

The data latch (LAT register) is useful for read-modify-write operations on the value that the I/O pins

are driving.

3.10 PORTA, TRISA and LATA Registers:

PORTA is a 7-bit wide, bi-directional port. The corresponding Data Direction register is TRISA. Setting

a TRISA bit (= 1) will make the corresponding PORTA pin an input (i.e., put the corresponding output

driver in a Hi-Impedance mode). Clearing a TRISA bit (= 0) will make the corresponding PORTA pin an

output (i.e., put the contents of the output latch on the selected pin). Reading the PORTA register

reads the status of the pins, whereas writing to it will write to the port latch. The Data Latch register

(LATA) is also memory mapped. Read-modify-write operations on the LATA register reads and writes

the latched output value for PORTA. The RA4 pin is multiplexed with the Timer0 module clock input

to become the RA4/T0CKI pin. The RA4/ T0CKI pin is a Schmitt Trigger input and an open drain output.

All other RA port pins have TTL input levels and full CMOS output drivers. The other PORTA pins are

multiplexed with analog inputs and the analog VREF+ and VREF- inputs. The operation of each pin is

selected by clearing/setting the control bits in the ADCON1 register (A/D Control Register1). The TRISA

register controls the direction of the RA pins, even when they are being used as analog inputs. The

user must ensure the bits in the TRISA register are maintained set when using them as analog inputs.

3.10 PORTB, TRISB and LATB Registers:

PORTB is an 8-bit wide, bi-directional port. The corresponding Data Direction register is TRISB. Setting

a TRISB bit (= 1) will make the corresponding PORTB pin an input (i.e., put the corresponding output

driver in a Hi-Impedance mode). Clearing a TRISB bit (= 0) will make the corresponding PORTB pin an

Department of Electrical and Electronics Engineering Page 23


output (i.e., put the contents of the output latch on the selected pin). The Data Latch register (LATB)

is also memory mapped. Read-modify-write operations on the LATB register reads and writes the

latched output value for PORTB. Each of the PORTB pins has a weak internal pull-up. A single control

bit can turn on all the pull-ups. This is performed by clearing bit RBPU (INTCON2<7>). The weak pull-

up is automatically turned off when the portpin is configured as an output. The pull-ups are disabled

on a Power-on Reset Four of the PORTB pins, RB7:RB4, have an interrupt- on-change feature. Only

pins configured as inputs can cause this interrupt to occur (i.e., any RB7:RB4 pin configured as an

output is excluded from the interrupt- on-change comparison). The input pins (of RB7:RB4) are

compared with the old value latched on the last read of PORTB. The “mismatch” outputs of RB7:RB4

are OR’ed together to generate the RB Port Change Interrupt with flag bit, RBIF (INTCON<0>). This

interrupt can wake the device from SLEEP. The user, in the Interrupt Service Routine, can clear the

interrupt in the following manner:

a) Any read or write of PORTB (except with the MOVFF instruction). This will end the

mismatch condition.

b) Clear flag bit RBIF. A mismatch condition will continue to set flag bit RBIF. Reading

PORTB will end the mismatch condition and allow flag bit RBIF to be cleared.

3.12 PORTC, TRISC and LATC Registers:

PORTC is an 8-bit wide, bi-directional port. The corresponding Data Direction register is TRISC. Setting

a TRISC bit (= 1) will make the corresponding PORTC pin an input (i.e., put the corresponding output

driver in a Hi-Impedance mode). Clearing a TRISC bit (= 0) will make the corresponding PORTC pin an

output (i.e., put the contents of the output latch on the selected pin). The Data Latch register (LATC)

is also memory mapped. Read-modify-write operations on the LATC register reads and writes the

latched output value for PORTC. PORTC is multiplexed with several peripheral functions PORTC pins

have Schmitt Trigger input buffers. When enabling peripheral functions, care should be taken in

defining TRIS bits for each PORTC pin. Some peripherals override the TRIS bit to make a pin an out-

Department of Electrical and Electronics Engineering Page 24


put, while other peripherals override the TRIS bit to make a pin an input. The user should refer to the

corresponding peripheral section for the correct TRIS bit settings.

3.13 PORTD, TRISD and LATD Registers:

This section is applicable only to the PIC18F4X2 devices. PORTD is an 8-bit wide, bi-directional port.

The corresponding Data Direction register is TRISD. Setting a TRISD bit (= 1) will make the

corresponding PORTD pin an input (i.e., put the corresponding output driver in a Hi-Impedance mode).

Clearing a TRISD bit (= 0) will make the corresponding PORTD pin an output (i.e., put the contents of

the output latch on the selected pin). The Data Latch register (LATD) is also memory mapped. Read-

modify-write operations on the LATD register reads and writes the latched output value for PORTD.

PORTD is an 8-bit port with Schmitt Trigger input buffers. Each pin is individually configurable as an

input or output. PORTD can be configured as an 8-bit wide microprocessor port (parallel slave port)

by setting control bit PSPMODE (TRISE<4>). In this mode, the input buffers are TTL. See Section 9.6 for

additional information on the Parallel Slave Port (PSP).

3.14 PORTE, TRISE and LATE Registers:

This section is only applicable to the PIC18F4X2 devices. PORTE is a 3-bit wide, bi-directional port. The

corresponding Data Direction register is TRISE. Setting a TRISE bit (= 1) will make the corresponding

PORTE pin an input (i.e., put the corresponding output driver in a Hi-Impedance mode). Clearing a

TRISE bit (= 0) will make the corresponding PORTE pin an output (i.e., put the contents of the output

latch on the selected pin). The Data Latch register (LATE) is also memory mapped. Read-modify-write

operations on the LATE register reads and writes the latched output value for PORTE. PORTE has three

pins (RE0/RD/AN5, RE1/WR/AN6 and RE2/CS/AN7) which are individually configurable as inputs or

outputs. These pins have Schmitt Trigger input buffers. PORTE pins are multiplexed with analog inputs.

When selected as an analog input, these pins will read as '0's. TRISE controls the direction of the RE

Department of Electrical and Electronics Engineering Page 25


pins, even when they are being used as analog inputs. The user must make sure to keep the pins

configured as inputs when using them as analog inputs.

3.5 Clock Options

The 877 chip has two main clock modes, CR and XT. The CR mode needs a simple capacitor and resistor

circuit attached to CLKIN, whose time constant (RC) determines the clock period. R should be between

3 k and 100 k, and C greater than 20pF.

For example, if R=10 k Ω and C=10nF, the clock period will be around 2. C . R . 200 μ s

(calculated from the CR rise/fall time) and the frequency about 5kHz. This option is

acceptable when the program timing is not critical. The XT mode is the one most commonly

used, since the extra component cost is small compared with the cost of the chip itself and

accurate timing is often a necessity. An external crystal and two capacitors are fitted to

CLKIN and CLKOUT pins. The crystal frequency in this mode can be from 200 KHz to 4

MHz and is typically accurate to better than 50 ppm (parts per million) or 0.005%. A

convenient value is 4Mz, as this is the maximum frequency possible with a standard crystal

and gives an instruction execution time of 1.000 μ s (1 million instructions per second, or 1

Mips).

A low-speed crystal can be used to reduce power consumption, which is proportional to clock

speed in CMOS devices. The LP (low-power) mode supports the clock frequency range 32–

200 kHz. To achieve the maximum clock speed of 20MHz, a high-speed (HS) crystal is

needed, with a corresponding increase in power consumption. The MCU configuration fuses

must be set to the required clock mode when the chip is programmed. Many PIC chips now

have an internal oscillator, which needs no external components. It is more accurate than the

Department of Electrical and Electronics Engineering Page 26


RC clock but less accurate than a crystal. It typically runs at 8 MHz and can be calibrated

in the chip configuration phase to provide a more accurate timing source.

RESET:-

The PIC18FXXX differentiates between various kinds of RESET:

1. Power-on Reset (POR)

2. MCLR Reset during normal operation

3. MCLR Reset during SLEEP

4. Watchdog Timer (WDT) Reset (during normal operation)

5. Programmable Brown-out Reset (BOR)

6. RESET Instruction

7. Stack Full Reset

8. Stack Underflow Reset

Most registers are unaffected by a RESET. Their status is unknown on POR and unchanged by all other

RESETS. The other registers are forced to a “RESET state” on Power-on Reset, MCLR, WDT Reset,

Brownout Reset, MCLR Reset during SLEEP and by the RESET instruction. Most registers are not

affected by a WDT wake-up, since this is viewed as the resumption of normal operation. Status bits

from the RCON register, RI, TO, PD,POR and BOR, are set or cleared differently in different RESET

situations. These bits are used in software to determine the nature of the RESET. The Enhanced MCU

devices have a MCLR noise filtering the MCLR Reset path. The filter will detect and ignore small pulses.

The MCLR pin is not driven low by any internal RESETS, including the WDT.

Department of Electrical and Electronics Engineering Page 27


3.6 Power-On Reset (POR):-

A Power-on Reset pulse is generated on-chip when VDD rise is detected. To take advantage of the POR

circuitry, just tie the MCLR pin directly (or through a resistor) to VDD. This will eliminate external RC

components usually needed to create a Power-on Reset delay. A minimum rise rate for VDD is

specified. When the device starts normal operation (i.e., exits the RESET condition), device operating

parameters (voltage, frequency, temperature, etc.) must be met to ensure operation. If these

conditions are not met, the device must be held in RESET until the operating conditions are met.

PIC16 Serial Interfaces:

● USART asynchronous link

● SPI synchronous bus

● I2C synchronous bus

Serial data connections are useful because only one or two signal wires are needed compared

with at least eight data lines for a parallel bus plus control signals. The typical PIC

microcontroller offers a choice of serial interfaces. The best one for any given

communication channel depends on the distance between nodes, the speed, and the number of

hardware connections required.

3.7 USART:

Department of Electrical and Electronics Engineering Page 28


The universal synchronous/asynchronous receive transmit (USART) device is typically used

in asynchronous mode to implement off-board, one-to-one connections. The term

asynchronous means no separate clock signal is needed to time the data reception, so only a

data send, data receive, and ground wires are needed. It is quick and simple to implement if a

limited data bandwidth is acceptable. A common application is connecting the PIC chip to a

host PC for uploading data acquired by the MCU subsystem (Figure 1.10 ). The USART

link can send data up to 100 meters by converting the signal to higher-voltage levels

(typically 12 V). The digital signal is inverted and shifted to become bipolar (symmetrical

about 0 V, line negative when inactive) for transmission.

The PIC 16F877 has a dedicated hardware RS232 port, but CCS C allows any pin to be set

up as an RS232 port, providing functions to generate the signals in software. The basic form

of the signal has 8 data bits and a stop and start bit. The bit period is set by the baud rate. A

typical value is 9600 baud, which is about 10k bits per second. The bit period is then about

100 μ s, about 1 byte per millisecond, or 1K byte per second.

Department of Electrical and Electronics Engineering Page 29


CHAPTER 4
SOFTWARE DESCRIPTION

4.1 ABOUT KEIL SOFTWARE:


The Keil 8051 Development Tools are designed to solve the complex problems facing
embedded software developers.

When starting a new project, simply select the microcontroller you use from the Device
Database and the µVision IDE sets all compiler, assembler, linker, an memory options for
you.

Numerous example programs are included to help you get started with the most popular
embedded 8051 devices.

The Keil µVision Debugger accurately simulates on-chip peripherals (I²C, CAN, UART, SPI,
Interrupts, I/O Ports, A/D Converter, D/A Converter, and PWM Modules) of your 8051
device. Simulation helps you understand hardware configurations and avoids time wasted on
setup problems. Additionally, with simulation, you can write and test applications before
target hardware is available.
When you are ready to begin testing your software application with target hardware, use the
MON51, MON390, MONADI, or FlashMON51 Target Monitors, the ISD51 In-System
Debugger, or the ULINK USB-JTAG Adapter to download and test program code on your
target system.

4.2 MOBIZEN APP

Department of Electrical and Electronics Engineering Page 30


Mobizen Screen Recorder is a nice screen recorder app which enables you to record whatever
is happening on your phone's screen. The user interface of this app is very interactive, which
allows even novices and people with no experience of using screen recorders the chance to
record the perfect videos. There is an Air Circle option offered by this app which appears on
the right-hand side of the screen. Tapping on this option reveals the three main features of this
screen recorder app, Record, Circle menu and Capture. You can find a brief intro of each
feature underneath their titles, explaining what the feature is all about.

The first feature of the Mobizen Screen Recorder is 'Record'. This feature is for recording the
screen of your phone. Once you have tapped on this option of the app, anything that you are
doing on your Smartphone will get recorded. You can use this option for recording high-quality
videos of your games.

To record a video of your game, all you have to do is to tap on the Record option while you are
playing the game. This screen recorder app will begin recording the screen as well as the game
sounds immediately. You can pause or stop the recording at any time by clicking on the Record
option again. The video recorded by the app will get stored on the SD Card if you have one
installed in your Smartphone. Otherwise, it will get stored in the internal memory.

Mobizen Screen Recorder also gives you the opportunity of capturing screenshots by providing
you the 'Capture' option. Like the Record feature, this feature is also very easy-to-use. For
capturing a snapshot of the screen of your phone with this screen recorder app, you have to
simply tap on the 'Capture' option. The app is going to instantly capture the screen and store
the image in the Gallery of your Smartphone.

Aside from the screen recording and screen capture options, Mobizen Screen Recorder offers
up a wide range of video editing tools to you as well. You can find them by tapping on the
Circle menu option of the app. The video editing tools that are made available to you by this
screen recorder app include addition of an intro video, addition of an outro video, trimming of
the video, addition of background music and screen capture. These tools are offered to help
you enhance the quality of your videosMobizen Screen Recorder has a settings menu too which

Department of Electrical and Electronics Engineering Page 31


can be accessed by clicking on the settings icon that is located inside the Circle menu. There
are various customization options available in this settings menu of the app. You can enable or
disable them to customize the app according to your preferences.

A smart feature of this screen recorder app is Face cam. This feature allows you to not only
record a video of the game you are playing but also to record your video and voice as well
while you are playing it. In order to make use of this feature, you will have to enable it in the
settings menu of the app.

4.3 Features:

Interactive and smart user interface

Beautiful layout and design

Various video editing tools

Numerous customization options.

Department of Electrical and Electronics Engineering Page 32


CHAPTER 5

BASIC COMPONENTS

5.1 Diode:

In electronics, a diode is a component that restricts the direction of movement of charge


carriers. Essentially, it allows an electric current to flow in one direction, but blocks it in the
opposite direction. Today germanium.

BASIC COMPONENTS :

Semiconductor Diodes:

Most modern diodes are based on semiconductor P-N junctions. In a P-N diode,
conventional current can flow from the P-type side (the anode) to the N-type side (the
cathode), but not in the opposite direction. A semiconductor diode s current-voltage, or I-V,
characteristic curve is ascribed to the behaviour of the so-called depletion layer or depletion
zone which exists at the P-N junction between the differing semiconductors. When a P-N
junction is first created, conduction band (mobile) electrons from the N-doped region diffuse
into the P-doped region where there is a large population of holes (places for electrons in
which no electron is present) with which the electrons recombine. When a mobile electron
recombines with a hole, the hole vanishes and the electron is no longer mobile. Thus, two
charge carriers have vanished. The region around the P-N junction becomes depleted of
charge carriers and thus behaves as an insulator.

5.2 Voltage regulator:

Department of Electrical and Electronics Engineering Page 33


7805 Voltage regulator 5V DC Voltage Regulator Data Sheet / Specs The 7805 provides circuit
designers with an easy way to regulate DC voltages to 5v.

Encapsulated in a single chip/package (IC), the 7805 is a positive voltage DC regulator that has
only 3 terminals. They are: Input voltage, Ground, Output Voltage. Although the 7805 were
primarily designed for a fixed-voltage output(5V). 7812 Voltage regulator

12V DC Voltage Regulator Data Sheet / Specs The 78012 provides circuit designers with an
easy way to regulate DC voltages to 12v. Encapsulated in a single chip/package (IC), the 78012
is a positive voltage DC regulator that has only 3 terminals. They are: Input voltage, Ground,
Output Voltage. Although the 78012 were primarily designed for a fixed-voltage output (12V).
7812 Voltage regulator It is indeed possible to use external components in order to obtain DC
output voltages of: 5V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 20V, 24V. Note that the input voltage
must, of course, be greater than the required output voltage, so that it can be regulated
downwards

5.3 Capacitor:

In the Regulated power supply the rating of the chosen capacitor filter is 1000µF.

A capacitor (originally known as condenser) is a passive two-terminal electrical component


used to store energy in an electric field. The forms of practical capacitors vary widely, but all
contain at least two electrical conductors separated by a dielectric (insulator); for example, one
common construction consists of metal foils separated by a thin layer of insulating film.
Capacitors are widely used as parts of electrical circuits in many common electrical devices.
When there is a potential difference (voltage) across the conductors, a static electric field
develops across the dielectric, causing positive charge to collect on one plate and negative
charge on the other plate. Energy is stored in the electrostatic field. An ideal capacitor is

Department of Electrical and Electronics Engineering Page 34


characterized by a single constant value, capacitance, measured in farads. This is the ratio of
the electric charge on each conductor to the potential difference between them.

The capacitance is greatest when there is a narrow separation between large areas of conductor,
hence capacitor conductors are often called "plates," referring to an early means of
construction. In practice, the dielectric between the plates passes a small amount of leakage
current and also has an electric field strength limit, resulting in a breakdown voltage, while the
conductors and leads introduce an undesired inductance and resistance. Capacitors are widely
used in electronic circuits for blocking direct current while allowing alternating current to pass,
in filter networks, for smoothing the output of power supplies, in the resonant circuits that tune
radios to particular frequencies, in electric power transmission systems for stabilizing voltage
and power flow, and for many other purposes.

5.4 Transistor:

An NPN transistor can be considered as two diodes with a shared anode. In typical operation,
the base-emitter junction is forward biased and the base–collector junction is reverse biased. In
an NPN transistor, for example, when a positive voltage is applied to the base–emitter junction,
the equilibrium between thermally generated carriers and the repelling electric field of the
depletion region becomes unbalanced, allowing thermally excited electrons to inject into the
base region. These electrons wander (or "diffuse") through the base from the region of high
concentration near the emitter towards the region of low concentration near the collector. The
electrons in the base are called minority carriers because the base is doped p-type which would
make holes the majority carrier in the base.

Department of Electrical and Electronics Engineering Page 35


Transistors can be regarded as a type of switch, as can many electronic components. They are
used in a variety of circuits and you will find that it is rare that a circuit built in a school
Technology Department does not contain at least one transistor. They are central to electronics
and there are two main types; NPN and PNP. Most circuits tend to use NPN. There are hundreds
of transistors which work at different voltages but all of them fall into these two categories.

Transistors are manufactured in different shapes but they have three leads (legs). The BASE -
which is the lead responsible for activating the transistor.

The COLLECTOR - which is the positive lead.The EMITTER - which is the negative lead.The
diagram below shows the symbol of an NPN transistor. They are not always set out as shown
in the diagrams to the left and right, although the ‘tab’ on the type shown to the left is usually
next to the ‘emitter.

5.5 Resistors:

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


as a circuit element. The current through a resistor is in direct proportion to the voltage across
the resistor's terminals. Thus, the ratio of the voltage applied across a resistor's terminals to the
intensity of current through the circuit is called resistance. This relation is represented by Ohm's

Department of Electrical and Electronics Engineering Page 36


law: where I is the current through the conductor in units of amperes, V is the potential
difference measured across the conductor in units of volts, and R is the resistance of the
conductor in units of ohms. More specifically, Ohm's law states that the R in this relation is
constant, independent of the current. Resistors are common elements of electrical networks and
electronic circuits and are ubiquitous in electronic equipment. Practical resistors can be made
of various compounds and films, as well as resistance wire (wire made of a high-resistivity
alloy, such as nickel-chrome). Resistors are also implemented within integrated circuits,
particularly analog devices, and can also be integrated into hybrid and printed circuits.

The electrical functionality of a resistor is specified by its resistance: common commercial


resistors are manufactured over a range of more than nine orders of magnitude. When
specifying that resistance in an electronic design, the required precision of the resistance may
require attention to the manufacturing tolerance of the chosen resistor, according to its specific
application. The temperature coefficient of the resistance may also be of concern in some
precision applications. Practical resistors are also specified as having a maximum power rating
which must exceed the anticipated power dissipation of that resistor in a particular circuit: this
is mainly of concern in power electronics applications. Resistors with higher power ratings are
physically larger and may require heat sinks. In a high-voltage circuit, attention must
sometimes be paid to the rated maximum working voltage of the resistor.

5.6 LED Sensor:

In electronics, an LED circuit or LED driver is an electrical circuit used to power a light-
emitting diode (LED). The circuit must provide sufficient current to light the LED at the
required brightness, but must limit the current to prevent damaging the LED. The voltage
drop across an LED is approximately constant over a wide range of operating current;
therefore, a small increase in applied voltage greatly increases the current. Very simple
circuits are used for low-power indicator LEDs. More complex, current source circuits are

Department of Electrical and Electronics Engineering Page 37


required when driving high-power LEDs for illumination to achieve correct current
regulation .

Department of Electrical and Electronics Engineering Page 38


CHAPTER 6

HARDWARE DESCRIPTION

6.0 Components required

 RF Module
 IR Sensor
 Light Emitting Diodes (LED’s)
 DC Gear Motors
 L293D
 PIC16F866

6.1 RF Module
An RF module (radio frequency module) is a (usually) small electronic circuit used to
transmit and/or receive radio signals on one of a number of carrier frequencies. RF modules
are widely used in electronic design owing to the difficulty of designing radio circuitry. Good
electronic radio design is notoriously complex because of the sensitivity of radio circuits and
the accuracy of components and layouts required to achieve operation on a specific frequency.
Design engineers will design a circuit for an application which requires radio communication
and then "drop in" a radio module rather than attempt a discrete design, saving time and
money on development.

RF modules are most often used in medium and low volume products for consumer
applications such as garage door openers, wireless alarm systems, industrial remote controls,
smart sensor applications, and wireless home automation systems. They are sometimes used
to replace older infra red communication designs as they have the advantage of not requiring
line-of-sight operation.
Several carrier frequencies are commonly used in commercially-available RF modules,
including 433.92 MHz, 315 MHz, 868 MHz and 915 MHz. These frequencies are used
because of national and international regulations governing the used of radio for
communication.

The RF module, as the name suggests, operates at Radio Frequency. The corresponding
frequency range varies between 30 kHz & 300 GHz. In this RF system, the digital data is

Department of Electrical and Electronics Engineering Page 39


represented as variations in the amplitude of carrier wave. This kind of modulation is known
as Amplitudeshiftkeying(ASK).

Transmission through RF is better than IR (infrared) because of many reasons. Firstly,


signals through RF can travel through larger distances making it suitable for long range
applications. Also, while IR mostly operates in line-of-sight mode, RF signals can travel even
when there is an obstruction between transmitter & receiver. Next, RF transmission is more
strong and reliable than IR transmission. RF communication uses a specific frequency unlike
IR signals which are affected by other IR emitting sources.

This RF module comprises of an RF Transmitter and an RF Receiver. The


transmitter/receiver (TX/Rx) pair operates at a frequency of 434 MHz. An RF transmitter
receives serial data and transmits it wirelessly through RF through its antenna connected at
pin4. The transmission occurs at the rate of 1Kbps - 10Kbps.The transmitted data is received
by an RF receiver operating at the same frequency as that of the transmitter.

The RF module is often used along with a pair of encoder/decoder. The encoder is used
for encoding parallel data for transmission feed while reception is decoded by a
decoder. HT12E-HT12D, HT640-HT648, etc. are some commonly used encoder/decoder pair
ICs.

An RF module (radio frequency module) is a (usually) small electronic circuit used to


transmit and/or receive radio signals on one of a number of carrier frequencies. RF modules
are widely used in electronic design owing to the difficulty of designing radio circuitry.
Good electronic radio design is notoriously complex because of the sensitivity of radio
circuits and the accuracy of components and layouts required achieving operation on a
specific frequency. Design engineers will design a circuit for an application which requires
radio communication and then "drop in" a radio module rather than attempt
a discrete design, saving time and money on development. RF modules are most often used
in medium and low volume products for consumer applications such as garage door openers,
wireless alarm systems, industrial remote controls, smart sensor applications, and wireless
home automation systems. They are often used to replace older infrared radio
communication designs as they have the advantage of not requiring line-of-sight operation.
Several carrier frequencies are commonly used in commercially-available RF modules,
including 433.92 MHz, 315 MHz, 868 MHz and 915 MHz These frequencies are used
because of national and international regulations governing the use of radio for
communication.

Department of Electrical and Electronics Engineering Page 40


6.1.1 Pin Description:

RF Transmitter

Pin
Function Name
No

1 Ground (0V) Ground

2 Serial data input pin Data

3 Supply voltage; 5V Vcc

4 Antenna output pin ANT

RF Receiver

Pin
Function Name
No

1 Ground (0V) Ground

2 Serial data output pin Data

3 Linear output pin; not connected NC

Department of Electrical and Electronics Engineering Page 41


4 Supply voltage; 5V Vcc

5 Supply voltage; 5V Vcc

6 Ground (0V) Ground

7 Ground (0V) Ground

8 Antenna input pin ANT

6.1.2 Main factors affecting RF module performance


As with any other radio-frequency device, the performance of an RF module will depend
on a number of factors. For example, by increasing the transmitter power, a larger
communication distance will be achieved. However, this will also result in a higher electrical
power drain on the transmitter device, which will cause shorter operating life for battery
powered devices. Also, using a higher transmit power will make the system more prone to
interference with other RF devices, and may in fact possibly cause the device to become illegal
depending on the jurisdiction.
Correspondingly, increasing the receiver sensitivity will also increase the effective
communication range, but will also potentially cause malfunction due to interference with
other RF devices.
The performance of the overall system may be improved by using matched antennas at each
end of the communication link, such as those described earlier.
Finally, the labeled remote distance of any particular system is normally measured in an open-
air line of sight configuration without any interference, but often there will be obstacles such
as walls, floors to absorb the radio wave signals, so the effective operational distance will in
most practical instances be less than specified.

6.1.3 Typical applications of RF module

 Vehicle monitoring
 Remote control
 Telemetry
 Small-range wireless network
 Wireless meter reading
 Access control systems
 Wireless home security systems

Department of Electrical and Electronics Engineering Page 42


 Area paging
 Industrial data acquisition system
 Radio tags reading
 RF contactless smart cards
 Wireless data terminals
 Wireless fire protection systems
 Biological signal acquisition
 Hydrological and meteorological monitoring
 Robot remote control
 Wireless data transmissions
 Digital video/audio transmission
 Digital home automation, such as remote light/switch
6.2 IR SENSORS

6.2.1 Introduction to IR Sensors


Infrared technology addresses a wide variety of wireless applications. The main areas
are sensing and remote controls. In the electromagnetic spectrum, the infrared portion is
divided into three regions: near infrared region, mid infrared region and far infrared region.

The wavelengths of these regions and their applications are shown below.

 Near infrared region — 700 nm to 1400 nm — IR sensors, fiber optic


 Mid infrared region — 1400 nm to 3000 nm — Heat sensing
 Far infrared region — 3000 nm to 1 mm — Thermal imaging

The frequency range of infrared is higher than microwave and lesser than visible light.
An infrared sensor emits and/or detects infrared radiation to sense its surroundings as shown
in fig 6.2.1 the working of any Infrared sensor is governed by three laws: Planck’s Radiation
law, Stephen – Boltzmann law and Wien’s Displacement law. Planck’s law states that “every
object emits radiation at a temperature not equal to 00K”. Stephen – Boltzmann law states that
“at all wavelengths, the total energy emitted by a black body is proportional to the fourth
power of the absolute temperature”. According to Wien’s Displacement law, “the radiation
curve of a black body for different temperatures will reach its peak at a wavelength inversely
proportional to the temperature”.

Department of Electrical and Electronics Engineering Page 43


Fig 6.2.1 Basic design of IR Sensors

The basic concept of an Infrared Sensor which is used as Obstacle detector is to


transmit an infrared signal, this infrared signal bounces from the surface of an object and the
signal is received at the infrared receiver.

6.2.2 IR Transmitter
Infrared Transmitter is a light emitting diode (LED) which emits infrared radiations.
Hence, they are called IR LED’s. Even though an IR LED looks like a normal LED, the
radiation emitted by it is invisible to the human eye.

The picture of a typical Infrared LED is shown below fig 6.2.2.

Department of Electrical and Electronics Engineering Page 44


Fig 6.2.2 IR Transmitter

There are different types of infrared transmitters depending on their wavelengths,


output power and response time.

A simple infrared transmitter can be constructed using an infrared LED, a current


limiting resistor and a power supply. The schematic of a typical IR transmitter is shown
below. When operated at a supply of 5V, the IR transmitter consumes about 3 to 5 mA of
current. Infrared transmitters can be modulated to produce a particular frequency of infrared
light. The most commonly used modulation is OOK (ON – OFF – KEYING) modulation.

IR transmitters can be found in several applications. Some applications require


infrared heat and the best infrared source is infrared transmitter. When infrared emitters are
used with Quartz, solar cells can be made.

6.2.3 IR Receiver
Infrared receivers are also called as infrared sensors as they detect the radiation from
an IR transmitter. IR receivers come in the form of photodiodes and phototransistors. Infrared
Photodiodes are different from normal photo diodes as they detect only infrared radiation.
The picture of a typical IR receiver or a photodiode is shown below fig 6.2.3.

Fig 6.2.3 IR Receiver

Department of Electrical and Electronics Engineering Page 45


Different types of IR receivers exist based on the wavelength, voltage, package, etc.
When used in an infrared transmitter – receiver combination, the wavelength of the receiver
should match with that of the transmitter.

6.2.4 Principle of Working

The principle of an IR sensor working as an Object Detection Sensor can be explained


using the following figure6.2.4. An IR sensor consists of an IR LED and an IR Photodiode;
together they are called as Photo – Coupler or Opto – Coupler. when the IR transmitter emits
radiation, it reaches the object and some of the radiation reflects back to the IR receiver. Based
on the intensity of the reception by the IR receiver, the output of the sensor is defined.

Fig 6.2.4 With and Without object

It is universal that black colour absorbs the entire radiation incident on it and white
colour reflects the entire radiation incident on it. Based on this principle, the second
positioning of the sensor couple can be made. The IR LED and the photodiode are placed side
by side. When the IR transmitter emits infrared radiation, since there is no direct line of
contact between the transmitter and receiver, the emitted radiation must reflect back to the
photodiode after hitting any object. The surface of the object can be divided into two types:
reflective surface and non-reflective surface. If the surface of the object is reflective in nature
i.e. it is white or other light colour, most of the radiation incident on it will get reflected back

Department of Electrical and Electronics Engineering Page 46


and reaches the photodiode. Depending on the intensity of the radiation reflected back, current
flows in the photodiode.

If the surface of the object is non-reflective in nature i.e. it is black or other dark colour,
it absorbs almost all the radiation incident on it. As there is no reflected radiation, there is no
radiation incident on the photodiode and the resistance of the photodiode remains higher
allowing no current to flow. This situation is similar to there being no object at all. The
positioning and enclosing of the IR transmitter and Receiver is very important. Both the
transmitter and the receiver must be placed at a certain angle, so that the detection of an object
happens properly. This angle is the directivity of the sensor which is +/- 45 degrees.

In order to avoid reflections from surrounding objects other than the object, both the
IR transmitter and the IR receiver must be enclosed properly. Generally the enclosure is made
of plastic and is painted with black colour.

6.3 LIGHT EMITTING DIODES (LED’s)

6.3.1 Introduction to LED:

A light-emitting diode (LED) is a two-lead semiconductor light source. It is a p–n


junction diode that emits light when activated.[5]When a suitable voltage is applied to the
leads, electrons are able to recombine with electron holes within the device, releasing energy
in the form of photons. This effect is called electroluminescence, and the colour of the light
(corresponding to the energy of the photon) is determined by the energy band gap of the
semiconductor. Leds are typically small (less than 1 mm2) and integrated optical components
may be used to shape the radiation pattern.[6]

Appearing as practical electronic components in 1962, the earliest leds emitted low-
intensity infrared light.[7] Infrared leds are still frequently used as transmitting elements in
remote-control circuits, such as those in remote controls for a wide variety of consumer
electronics. The first visible-light leds were also of low intensity and limited to red. Modern
leds are available across the visible, ultraviolet, and infrared wavelengths, with very high
brightness.

Early leds were often used as indicator lamps for electronic devices, replacing small
incandescent bulbs. They were soon packaged into numeric readouts in the form of seven-

Department of Electrical and Electronics Engineering Page 47


segment displays and were commonly seen in digital clocks. Recent developments have
produced leds suitable for environmental and task lighting. Leds have led to new displays and
sensors, while their high switching rates are useful in advanced communications technology.

Fig. 6.3.1 Parts of LED

6.3.2 Working principle

Fig.6.3.2The inner workings of an LED, showing


circuit (top) and band diagram (bottom)
A P-N junction can convert absorbed light energy into a proportional electric current. The
same process is reversed here (i.e. the P-N junction emits light when electrical energy is

Department of Electrical and Electronics Engineering Page 48


applied to it). This phenomenon is generally called electroluminescence, which can be defined
as the emission of light from a semiconductor under the influence of an electric field. The
charge carriers recombine in a forward-biased P-N junction as the electrons cross from the N-
region and recombine with the holes existing in the P-region. Free electrons are in
the conduction band of energy levels, while holes are in the valence energy band. Thus the
energy level of the holes is less than the energy levels of the electrons. Some portion of the
energy must be dissipated to recombine the electrons and the holes. This energy is emitted in
the form of heat and light.

The electrons dissipate energy in the form of heat for silicon and germanium diodes but
in gallium arsenide phosphide (GaAsP) and gallium phosphide (GaP) semiconductors, the
electrons dissipate energy by emitting photons. If the semiconductor is translucent, the
junction becomes the source of light as it is emitted, thus becoming a light-emitting diode.
However, when the junction is reverse biased, the LED produces no light and—if the potential
is great enough, the device is damaged.

6.3.3 Advantages of LED:

LEDs have many advantages over incandescent light sources, including

 lower energy consumption.


 longer lifetime.
 improved physical robustness.
 smaller size, and faster switching.
 They are also significantly more energy efficient and, arguably, have fewer
environmental concerns linked to their disposal.[8][9]
 Traffic signals.

6.4 DC MOTOR SECTION


In any electric motor, operation is based on simple electromagnetism. A current-
carrying conductor generates a magnetic field; when this is then placed in an external
magnetic field, it will experience a force proportional to the current in the conductor, and to
the strength of the external magnetic field. As you are well aware of from playing with
magnets as a kid, opposite (North and South) polarities attract, while like polarities (North
and North, South and South) repel. The internal configuration of a DC motor is designed to

Department of Electrical and Electronics Engineering Page 49


harness the magnetic interaction between a current-carrying conductor and an external
magnetic field to generate rotational motion.

Let's start by looking at a simple 2-pole DC electric motor (here red represents a magnet
or winding with a "North" polarization, while green represents a magnet or winding with a
"South" polarization).

Fig. 6.4 Diagram of DC Motor

Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator, commutator,
field magnet(s), and brushes. In most common DC motors (and all that beamers will see), the
external magnetic field is produced by high-strength permanent magnets1. The stator is the
stationary part of the motor -- this includes the motor casing, as well as two or more permanent
magnet pole pieces. The rotor (together with the axle and attached commutator) rotate with
respect to the stator. The rotor consists of windings (generally on a core), the windings being
electrically connected to the commutator. The above diagram shows a common motor layout
-- with the rotor inside the stator (field) magnets.

The geometry of the brushes, commutator contacts, and rotor windings are such that
when power is applied, the polarities of the energized winding and the stator magnet(s) are
misaligned, and the rotor will rotate until it is almost aligned with the stator's field magnets.
As the rotor reaches alignment, the brushes move to the next commutator contacts, and
energize the next winding. Given our example two-pole motor, the rotation reverses the

Department of Electrical and Electronics Engineering Page 50


direction of current through the rotor winding, leading to a "flip" of the rotor's magnetic field,
driving it to continue rotating.

In real life, though, DC motors will always have more than two poles (three is a very
common number). In particular, this avoids "dead spots" in the commutator. You can imagine
how with our example two-pole motor, if the rotor is exactly at the middle of its rotation
(perfectly aligned with the field magnets), it will get "stuck" there. Meanwhile, with a two-
pole motor, there is a moment where the commutator shorts out the power supply (i.e., both
brushes touch both commutator contacts simultaneously). This would be bad for the power
supply, waste energy, and damage motor components as well. Yet another disadvantage of
such a simple motor is that it would exhibit a high amount of torque "ripple" (the amount
of torque it could produce is cyclic with the position of the rotor).

6.4.1 Principle of Operation

Like all electric motors or generators, torque is produced by the principle of Lorentz
force, which states that any current-carrying conductor placed within an external magnetic
field experiences a torque or force known as Lorentz force. Advantages of a brushed DC
motor include low initial cost, high reliability, and simple control of motor speed.
Disadvantages are high maintenance and low life-span for high intensity uses. Maintenance
involves regularly replacing the brushes and springs which carry the electric current, as well
as cleaning or replacing the commutator. These components are necessary for transferring
electrical power from outside the motor to the spinning wire windings of the rotor inside the
motor.

Fig. 6.4.1 DC motor

Department of Electrical and Electronics Engineering Page 51


In our project we use a DC gear motor which is shown below

Fig. 6.4.2 DC Geared Motor

An assembly composed of an electric motor and a reduction gear in a single unit. The
most common types have planetary, planetary lantem, and wave transmissions. For greater
compactness, the driving gear of the reduction gear is mounted directly on the motor shaft.
Gearmotors are used in universal drivers for general use; they are manufactured serially by
specialized enterprises. They can operate in a horizontal, vertical, or tilted position, depending
on the lubrication system used.

6.5 L293D

The Device is a monolithic integrated high voltage, high current four channel driver
designed to accept standard DTL or TTL logic levels and drive inductive loads (such as relays
solenoids, DC and stepping motors) and switching power transistors. To simplify use as two
bridges each pair of channels is equipped with an enable input. A separate supply input is
provided for the logic, allowing operation at a lower voltage and internal clamp diodes are
included.

Department of Electrical and Electronics Engineering Page 52


This device is suitable for use in switching applications at frequencies up to 5 kHz.The
L293D is assembled in a 16 lead plastic package which has 4 center pins connected together
and used for heat sinking. The L293DD is assembled in a 20 lead surface mount which has 8
center pins connected together and used for heat sinking.

Fig. 6.5 L23D

6.5.1 ABSOLUTE MAXIMUM RATINGS:


Symbol Parameter Value Unit
VS Supply Voltage 36 V
VSS Logic Supply Voltage 36 V
Vi Input Voltage 7V
Ven Enable Voltage 7V
Io Peak Output Current 1.2 A
(100 ms non repetitive)
Ptot Total Power Dissipation 4W
at Tpins = 90 °C

Tstg,Tj Storage and Junction – 40 to 150 °C


Temperature

Department of Electrical and Electronics Engineering Page 53


Fig. 6.5.1 Pin description of L293D

Department of Electrical and Electronics Engineering Page 54


Department of Electrical and Electronics Engineering Page 55

Vous aimerez peut-être aussi