Sms Based Digital Notice Board
Sms Based Digital Notice Board
TOPICS
Certificates
Acknowledgement........
CHAPTER 1: INTRODUCTION
1.3 Thesis
3.2 Microcontroller.
3.7 LCD
3.8 Buzzer.
1
CHAPTER 4: SOFTWARE DESCRIPTION
4.2AURDINO C
Compiler.
REFERENCES
CHAPTER 1: INTRODUCTION
1.1Introduction:
The purpose of this project is to design and develop a GSM based digital notice board with
display on LCD display. This project makes use of GSM Modem and LCD display.
Micro controller acts as heart of the device. Total operation is depending upon the micro
controller programming. Programming part is written under embedded C language.
2
Control unit can control all the devices externally connected to it. Liquid Crystal Display is
used to monitor the data. Here the user can manually change the brightness of the LCD. Micro
controller is interfaced to LCD with their necessary pins.
Chapter 1 Presents introduction to the overall thesis and the overview of the project. In the project
overview a brief introduction of digital notice board and its applications are discussed.
Chapter 2 Presents the topic embedded systems. It explains the about what is embedded systems,
need for embedded systems, explanation of it along with its applications.
Chapter 3 Presents the hardware description. It deals with the block diagram of the project and
explains the purpose of each block. In the same chapter the explanation of microcontrollers, power
supplies and LCD displays are considered.
3
Chapter 4 Presents the software description. It explains the implementation of the project using PIC
C Compiler software.
Chapter 5 presents the project description along with LCD module interfacing to microcontroller.
Chapter 7 Presents the results, conclusion and future scope of the project.
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. (Each radar
probably includes one or more embedded systems of its own.)
Since the embedded system is dedicated to specific tasks, design engineers can
optimize it to reduce the size and cost of the product and increase the reliability and performance.
Some embedded systems are mass-produced, benefiting from economies of scale.
4
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. 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.
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
5
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.1.1 History:
One of the first recognizably modern embedded systems was the Apollo Guidance
Computer, developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the project'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 Autonetics 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.1.2 Tools:
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.
6
2.1.3 Resources:
To save costs, embedded systems frequently have the cheapest processors that can do
the job. This means your programs need to be written as efficiently as possible. When dealing with
large data sets, issues like memory cache misses that never matter in PC programming can hurt you.
Luckily, this won't happen too often- use reasonably efficient algorithms to start, and optimize only
when necessary. Of course, normal profilers won't work well, due to the same reason debuggers don't
work well.
Memory is also an issue. For the same cost savings reasons, embedded systems usually
have the least memory they can get away with. That means their algorithms must be memory efficient
(unlike in PC programs, you will frequently sacrifice processor time for memory, rather than the
reverse). It also means you can't afford to leak memory. Embedded applications generally use
deterministic memory techniques and avoid the default "new" and "malloc" functions, so that leaks
can be found and eliminated more easily. Other resources programmers expect may not even exist.
For example, most embedded processors do not have hardware FPUs (Floating-Point Processing
Unit). These resources either need to be emulated in software, or avoided altogether.
Embedded systems frequently control hardware, and must be able to respond to them
in real time. Failure to do so could cause inaccuracy in measurements, or even damage hardware such
as motors. This is made even more difficult by the lack of resources available. Almost all embedded
systems need to be able to prioritize some tasks over others, and to be able to put off/skip low priority
tasks such as UI in favor of high priority tasks like hardware control.
The uses of embedded systems are virtually limitless, because every day new products
are introduced to the market that utilizes embedded computers in novel ways. In recent years,
hardware such as microprocessors, microcontrollers, and FPGA chips have become much cheaper. So
when implementing a new form of control, it's wiser to just buy the generic chip and write your own
custom software for it. Producing a custom-made chip to handle a particular task or set of tasks costs
far more time and money. Many embedded computers even come with extensive libraries, so that
"writing your own software" becomes a very trivial task indeed. From an implementation viewpoint,
there is a major difference between a computer and an embedded system. Embedded systems are often
7
required to provide Real-Time response. The main elements that make embedded systems unique are
its reliability and ease in debugging.
2.2.1 Debugging:
2.2.2 Reliability:
8
Embedded systems often reside in machines that are expected to run continuously for
years without errors and in some cases recover by them selves 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:
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
backup s 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.
9
2.3.1 Software Architecture:
In this design, the software simply has a loop. The loop calls subroutines, each of which
manages a part of the hardware or software.
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 receiving a byte. These
kinds of systems are used if event handlers need low latency and the event handlers are short and
simple.
Usually these kinds of systems run a simple task in a main loop also, but this task is not
very sensitive to unexpected delays. Sometimes the interrupt handler will add longer tasks to a queue
structure. Later, after the interrupt handler has finished, these tasks are executed by the main loop.
This method brings the system close to a multitasking kernel with discrete processes.
Cooperative Multitasking:
Primitive Multitasking:
In this type of system, a low-level piece of code switches between tasks or threads
based on a timer (connected to an interrupt). 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
10
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, such as message queues, semaphores or a non-blocking
synchronization scheme.
A microkernel is a logical step up from a real-time OS. The usual arrangement is that
the operating system kernel allocates memory and switches the CPU to different threads of execution.
User mode processes implement major functions such as file systems, network interfaces, etc.
In general, microkernels succeed when the task switching and intertask communication
is fast, and fail when they are slow. Exokernels communicate efficiently by normal subroutine calls.
The hardware and all the software in the system are available to, and extensible by application
programmers. Based on performance, functionality, requirement the embedded systems are divided
into three categories:
These systems takes the input in the form of electrical signals from transducers or
commands from human beings such as pressing of a button etc.., process them and produces desired
output. This entire process of taking input, processing it and giving output is done in standalone mode.
Such embedded systems comes under stand alone embedded systems
11
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.
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.
Eg: consider a system in which we have to open a valve within 30 milliseconds. If this valve is
not opened in 30 ms this may cause damage to the entire equipment. So in such cases we use
embedded systems for doing automatic operations.
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.
Eg:
Consider a web camera that is connected to the computer with internet can be used to
spread communication like sending pictures, images, videos etc.., to another computer
with internet connection throughout anywhere in the world.
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.
12
Fig 2.2: Network communication embedded systems
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, analog
to 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. But the microprocessor requires many external
components like memory, serial communication, hard disk, input output ports etc.., so the
power consumption is also very high when compared to microcontrollers.
Digital signal processing is used mainly for the applications that particularly involved with
processing of signals
13
2.4 APPLICATIONS OF EMBEDDED SYSTEMS:
14
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.
Fig2.6: Robot
In critical industries where human presence is avoided there we can use robots which
are programmed to do a specific operation.
15
Fig2.7: Computer networking
3.1 Introduction:
In this chapter the block diagram of the project and design aspect of independent
modules are considered. Block diagram is shown in fig: 3.1:
16
FIG 3.1: Block diagram of ARDUINO BASED WIRELESS NOTICE BOARD
1. Micro controller
2. Reset button
3. Crystal oscillator
5. Led indicator
6. RS 232 cable
7. GSM modem
8. LCD display
17
3. 2 Micro controller:
18
The Arduino is a family of microcontroller boards to simplify electronic design, prototyping
and experimenting for artists, hackers, hobbyists, but also many professionals. People use it as brains
for their robots, to build new digital music instruments, or to build a system that lets your house plants
tweet you when theyre dry. Arduinos (we use the standard Arduino Uno) are built around an ATmega
microcontroller essentially a complete computer with CPU, RAM, Flash memory, and input/output
pins, all on a single chip. Unlike, say, a Raspberry Pi, its designed to attach all kinds of sensors,
LEDs, small motors and speakers, servos, etc. directly to these pins, which can read in or output
digital or analog voltages between 0 and 5 volts. The Arduino connects to your computer via USB,
where you program it in a simple language (C/C++, similar to Java) from inside the free Arduino IDE
by uploading your compiled code to the board. Once programmed, the Arduino can run with the USB
link back to your computer, or stand-alone without it no keyboard or screen needed, just power.
Looking at the board from the top down, this is an outline of what you will see (parts of the
board you might interact with in the course of normal use are highlighted)
19
Figure 2.3 Arduino Board
Starting clockwise from the top center:
Analog Reference pin (orange)
Digital Ground (light green)
Digital Pins 0-1/Serial In/Out - TX/RX (dark green) - These pins cannot be used for digital i/o
(Digital Read and Digital Write) if you are also using serial communication (e.g. Serial.begin).
Toggles External Power and USB Power (place jumper on two pins closest to desired supply) -
SV1 (purple)
20
USB (used for uploading sketches to the board and for serial communication between the
board and the computer; can be used to power the board) (yellow)
3.2.1Digital Pins
In addition to the specific functions listed below, the digital pins on an Arduino board can be
used for general purpose input and output via the pin Mode(), Digital Read(), and Digital Write()
commands. Each pin has an internal pull-up resistor which can be turned on and off using digital
Write() (w/ a value of HIGH or LOW, respectively) when the pin is configured as an input. The
maximum current per pin is 40mA.
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. On the
Arduino Diecimila, these pins are connected to the corresponding pins of the FTDI USB-to-
TTL Serial chip. On the Arduino BT, they are connected to the corresponding pins of the
WT11 Bluetooth module. On the Arduino Mini and LilyPad Arduino, they are intended for use
with an external TTL serial module (e.g. the Mini-USB Adapter).
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 analog Write() function. On
boards with an ATmega8, PWM output is available only on pins 9, 10, and 11.
BT Reset: 7. (Arduino BT-only) Connected to the reset line of the bluetooth module.
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. On the Diecimila and LilyPad, 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.
3.2.2 Analog Pins
In addition to the specific functions listed below, the analog input pins support 10-bit analog-
to-digital conversion (ADC) using the analog Read() function. Most of the analog inputs can also be
used as digital pins: analog input 0 as digital pin 14 through analog input 5 as digital pin 19. Analog
inputs 6 and 7 (present on the Mini and BT) cannot be used as digital pins.
21
I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire library
(documentation on the Wiring website).
3.2.3 Power Pins
VIN (sometimes labeled "9V"): The input voltage to the Arduino board when it's using an
external power source (as opposed to 5 volts from the USB connection or other regulated
power source). You can supply voltage through this pin, or, if supplying voltage via the power
jack, access it through this pin. Also note that the Lily Pad has no VIN pin and accepts only a
regulated input.
5V: The regulated power supply used to power the microcontroller and other components on
the board. This can come either from VIN via an on-board regulator, or be supplied by USB or
another regulated 5V supply.
3V3 (Diecimila-only) : A 3.3 volt supply generated by the on-board FTDI chip.
3.2.5Atmega328
22
Pin diagram
23
Pin Description
VCC:
GND:
Ground.
Port A (PA7-PA0):
Port A serves as the analog inputs to the A/D Converter. Port A also serves as an 8-bit bi-
directional I/O port, if the A/D Converter is not used. Port pins can provide internal pull-up
resistors (selected for each bit). The Port A output buffers have symmetrical drive characteristics
with both high sink and source capability. When pins PA0 to PA7 are used as inputs and are
externally pulled low, they will source current if the internal pull-up resistors are activated. The
Port A pins are tri-stated when a reset condition becomes active, even if the clock is not running.
Port B (PB7-PB0):
Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The
Port B output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even
if the clock is not running. Port B also serves the functions of various special features of the
ATmega32.
Port C (PC7-PC0):
24
Port C is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The
Port C output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port C pins are tri-stated when a reset condition becomes active, even
if the clock is not running. If the JTAG interface is enabled, the pull-up resistors on pins
PC5(TDI), PC3(TMS) and PC2(TCK) will be activated even if a reset occurs. The TD0 pin is tri-
stated unless TAP states that shift out data are entered. Port C also serves the functions of the
JTAG interface.
Port D (PD7-PD0):
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit).
The Port D output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even
if the clock is not running. Port D also serves the functions of various special features of the
ATmega32.
A low level on this pin for longer than the minimum pulse length will generate a reset, even if the
clock is not running. Shorter pulses are not guaranteed to generate a reset.
XTAL1:
Input to the inverting Oscillator amplifier and input to the internal clock operating circuit.
XTAL2:
AVCC:
AVCC is the supply voltage pin for Port A and the A/D Converter. It should be externally
connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to
VCC through a low-pass filter.
25
AREF:
3.2.7 Features
1.8-5.5V operating range
Up to 20MHz
Part: ATMEGA328P-AU
1kB EEPROM
2 8-bit Timer/Counters
16-bit Timer/Counter
6 PWM Channels
Serial USART
Watchdog timer
Analog comparator
23 IO lines
27
2.6.1 Overview
This section discusses the AVR core architecture in general. The main function of the CPU
core is to ensure correct program execution. The CPU must therefore be able to access memories,
perform calculations, control peripherals, and handle interrupts.
28
fetched from the program memory. This concept enables instructions to be executed in every clock
cycle. The program memory is In-System Reprogrammable Flash memory. The fast-access Register
File contains 32 x 8-bit general purpose working registers with a single clock cycle access time. This
allows single-cycle Arithmetic Logic Unit (ALU) operation. In a typical ALU operation, two operands
are output from the Register File, the operation is executed, and the result is stored back in the
Register File in one clock cycle.
Six of the 32 registers can be used as three 16-bit indirect address register pointers for Data
Space addressing enabling efficient address calculations. One of these address pointers can also be
used as an address pointer for look up tables in Flash program memory. These added function
registers are the 16-bit X-, Y-, and Z-register, described later in this section. The ALU supports
arithmetic and logic operations between registers or between a constant and a register. Single register
operations can also be executed in the ALU. After an arithmetic operation, the Status Register is
updated to reflect information about the result of the operation. Program flow is provided by
conditional and unconditional jump and call instructions, able to directly address the whole address
space. Most AVR instructions have a single 16-bit word format. Every program memory address
contains a 16- or 32-bit instruction. Program Flash memory space is divided in two sections, the
Boot Program section and the Application Program section. Both sections have dedicated Lock bits
for write and read/write protection. The SPM instruction that writes into the Application Flash
memory section must reside in the Boot Program section. During interrupts and subroutine calls, the
return address Program Counter (PC) is stored on the Stack. The Stack is effectively allocated in the
general data SRAM, and consequently the Stack size is only limited by the total SRAM size and the
usage of the SRAM. All user programs must initialize the SP in the Reset routine (before subroutines
or interrupts are executed). The Stack Pointer (SP) is read/write accessible in the I/O space. The data
SRAM can easily be accessed through the five different addressing modes supported in the AVR
architecture.
The memory spaces in the AVR architecture are all linear and regular memory maps. A flexible
interrupt module has its control registers in the I/O space with an additional Global Interrupt Enable
bit in the Status Register. All interrupts have a separate Interrupt Vector in the Interrupt Vector table.
The interrupts have priority in accordance with their Interrupt Vector position. The lower the Interrupt
Vector address, the higher the priority.
3.2.9 ALU Arithmetic Logic Unit
The high-performance AVR ALU operates in direct connection with all the 32 general purpose
working registers. Within a single clock cycle, arithmetic operations between general purpose
29
registers or between a register and an immediate are executed. The ALU operations are divided into
three main categories arithmetic, logical, and bit functions. Some implementations of the
architecture also provide a powerful multiplier supporting both
signed/unsigned multiplication and fractional format. See the Instruction Set section for a detailed
description.
Status Register
The Status Register contains information about the result of the most recently executed
arithmetic instruction. This information can be used for altering program flow in order to perform
conditional operations. Note that the Status Register is updated after all ALU operations, as specified
in the Instruction Set Reference. This will in many cases remove the need for using the dedicated
compare instructions, resulting in faster and more compact code. The Status Register is not
automatically stored when entering an interrupt routine and restored when returning from an interrupt.
This must be handled by software.
The AVR Status Register SREG is defined as:
30
Bit 5 H: Half Carry Flag
The Half Carry Flag H indicates a Half Carry in some arithmetic operations The Half Carry
Flag H indicates a Half Carry in some arithmetic operations. Half Carry Is useful in BCD arithmetic.
See the Instruction Set Description for detailed information.
Bit 4 S: Sign Bit, S = N V
The S-bit is always an exclusive or between the Negative Flag N and the Twos Complement
Overflow Flag V. See the Instruction Set Description for detailed information.
Bit 3 V: Twos Complement Overflow Flag
The Twos Complement Overflow Flag V supports twos complement arithmetic.
Bit 2 N: Negative Flag
The Negative Flag N indicates a negative result in an arithmetic or logic operation.
Bit 1 Z: Zero Flag
The Zero Flag Z indicates a zero result in an arithmetic or logic operation.
Bit 0 C: Carry Flag
The Carry Flag C indicates a carry in an arithmetic or logic operation.
General Purpose Register File
The Register File is optimized for the AVR Enhanced RISC instruction set. In order to achieve
the required performance and flexibility, the following input/output schemes are supported by the
Register File:
One 8-bit output operand and one 8-bit result input
Two 8-bit output operands and one 8-bit result input
Two 8-bit output operands and one 16-bit result input
One 16-bit output operand and one 16-bit result input
Most of the instructions operating on the Register File have direct access to all registers, and
most of them are single cycle instructions. As shown in Figure 6-2, each register is also assigned a
data memory address, mapping them directly into the first32 locations of the user data space.
Although not being physically implemented as SRAM locations, this memory organization provides
31
great flexibility in access of the registers, as the X-, Y-, and Z-pointer registers can be set to index any
register.
Figure 2.8 Structure of the 32 general purpose working registers in the CPU
32
Figure 2.9 X-, Y-,
and Z-Registers
In the different addressing modes these address registers have functions as fixed displacement,
automatic increment, and automatic decrement.
Stack Pointer
The Stack is mainly used for storing temporary data, for storing local variables and for storing
return addresses after interrupts and subroutine calls. Note that the Stack is implemented as growing
from higher to lower memorylocations. The Stack Pointer Register always points to the top of the
Stack. The Stack Pointer points to the data SRAM Stack area where the Subroutine and Interrupt
Stacks are located. A Stack PUSH command will decrease the Stack Pointer.
The Stack in the data SRAM must be defined by the program before any subroutine calls are
executed or interrupts are enabled. Initial Stack Pointer value equals the last address of the internal
SRAM and the Stack Pointer must be set to point above start of the SRAM
Table 2.1 Stack Pointer instructions
33
The AVR ATmega128A Stack Pointer is implemented as two 8-bit registers in the I/O space.
The number of bits actually used is implementation dependent. Note that the data space in some
implementations of the AVR architecture is so small that only SPL is needed. In this case, the SPH
Register will not be present.SPH and SPL - Stack Pointer High and Low Register.
Figure 2.10
SPH and SPL - Stack Pointer High and Low Register
Interrupt Response Time
The interrupt execution response for all the enabled AVR interrupts is four clock cycles
minimum. After four clock cycles the program vector address for the actual interrupt handling routine
is executed. During this four clock cycle period, the Program Counter is pushed onto the Stack. The
vector is normally a jump to the interrupt routine, and this jump takes three clock cycles. If an
interrupt occurs during execution of a multi-cycle instruction, this instruction is completed before the
interrupt is served. If an interrupt occurs when the MCU is in sleep mode, the interrupt execution
response time is increased by four clock cycles. This increase comes in addition to the start-up time
from the selected sleep mode.
AVR Memories
This section describes the different memories in the ATmega328. The AVR architecture has
two main memory spaces, the Data Memory and the Program Memory space. In addition,
theATmega328 features an EEPROM Memory for data storage. All three memory spaces are linear
and regular.
In-System Reprogrammable Flash Program Memory:
The ATmega328 contains 4/8/16/32Kbytes On-chip In-System Reprogrammable Flash
memory for program storage. Since all AVR instructions are 16 or 32 bits wide, the Flash is organized
as 2/4/8/16K x 16. For software security, the Flash Program memory space is divided into two
sections, Boot Loader Section and Application Program Section. The Flash memory has an endurance
34
of at least 10,000 write/erase cycles. The ATmega328 Program Counter (PC) is 11/12/13/14 bits wide,
thus addressing the 2/4/8/16K program memory locations.
SRAM Data Memory:
ATmega328 is a complex microcontroller with more peripheral units than can be supported
within the 64 locations reserved in the Opcode for the IN and OUT instructions. For the Extended I/O
space from 0x60 - 0xFF in SRAM, only the ST/STS/STD and LD/LDS/LDD instructions can be used.
The lower 768/1280/1280/2303 data memory locations address both the Register File, the I/O
memory, Extended I/O memory, and the internal data SRAM. The first 32 locations address the
Register File, the next 64 location the standard I/O memory, then 160 locations of Extended I/O
memory, and the next 512/1024/1024/2048 locations address the internal data SRAM. The five
different addressing modes for the data memory cover: Direct, Indirect with Displacement, Indirect,
Indirect with Pre-decrement, and Indirect with Post-increment. In The Register File, Registers R26 to
R31 Feature the indirect addressing pointer registers. The direct addressing reaches the entire data
space. The Indirect with Displacement mode reaches 63 address locations from the base address given
by the Y- or Z register.
When using register indirect addressing modes with automatic pre-decrement and post-
increment, the address registers X, Y, and Z are decremented or incremented. The 32 general purpose
working registers, 64 I/O Registers, 160 Extended I/O Registers, and the 512/1024/1024/2048 bytes
of internal data SRAM in the ATmega328 are all accessible through all these addressing modes.
35
Table 2.2 Reset and Interrupt Vectors in ATMEGA 328 and ATMEGA 328P
Vector Program Source Interrupt Definition
No. Address
1 0x0000 RESET External Pin, Power-on Reset,
Brown-out Reset and Watchdog
System Reset
2 0x0002 INT0 External Interrupt Request 0
3 0x0004 INT1 External Interrupt Request 0
4 0x0006 PCINTO Pin Change Interrupt Request 0
5 0x0008 PCINT1 Pin Change Interrupt Request 1
6 0x000A PCINT2 Pin Change Interrupt Request 2
7 0x000C WDT Watchdog Time-out Interrupt
8 0x000E TIMER2 COMPA Timer/Counter2 Compare Match A
9 0x0010 TIMER2 COMPB Timer/Counter2 Compare Match B
10 0x0012 TIMER2 OVF Timer/Counter 2 Overflow
11 0x0014 TIMER1 CAPT Timer/Counter 2 Capture Event
12 0x0016 TIMER1 COMPA Timer/Counter1 Compare Match A
13 0x0018 TIMER1 COMPB Timer/Counter1 Compare Match B
14 0x001A TIMER 1 OVF Timer/Counter1 Overflow
15 0x001C TIMER0 COMPA Timer/Counter0 Compare Match A
16 0x001E TIMER0 COMPB Timer/Counter0 Compare Match B
17 0x0020 TIME0 OVF Timer/Counter0 Overflow
18 0x0022 SPI, STC SPI Serial Transfer Complete
19 0x0024 USART, RX USART RX Complete
20 0x0026 USART, UDRE USART, Data Register Empty
21 0x0028 USART, TX USART, TX Complete
22 0x002A ADC ADC Conversion Complete
23 0x002C EE READY EEPROM Ready
24 0x002E ANALOG COMP Analog Comparator
25 0x0030 TWI 2-wire Serial Interface
26 0x0032 SPM READY Store Program Memory Ready
When the IVSEL bit in MCUCR is set, Interrupt Vectors will be moved to the start of the Boot
Flash Section. The address of each Interrupt Vector will then be the address in this table added to the
start address of the Boot Flash Section.Table below shows reset and Interrupt Vectors placement for
the various combinations of BOOTRST and IVSEL settings. If the program never enables an interrupt
source, the Interrupt Vectors are not used, and regular program code can be placed at these locations.
This is also the case if the Reset Vector is in the Application section while the Interrupt Vectors are in
the Boot section or vice versa.
36
Table 2.3 Reset and Interrupt Vectors Placement in ATmega328 and ATmega328P
37
Arduino Characteristics
Power
The Arduino Uno can be powered via the USB connection or with an external power supply.
The power source is selected automatically. External (non-USB) power can come either from an AC-
to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-
positive plug into the board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin
headers of the POWER connector. The board can operate on an external supply of 6 to 20 volts. If
supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be
unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The
recommended range is 7 to 12 volts.
The power pins are as follows:
VIN: The input voltage to the Arduino board when it's using an external power source (as
opposed to 5 volts from the USB connection or other regulated power source). You can supply
voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
5V: This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the
VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the
regulator, and can damage your board. We don't advise it.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
GND. Ground pins.
IOREF. This pin on the Arduino board provides the voltage reference with which the
microcontroller operates. A properly configured shield can read the IOREF pin voltage and
select the appropriate power source or enable voltage translators on the outputs for working
with the 5V or 3.3V.
Memory:
The ATmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has 2 KB of SRAM
and 1 KB of EEPROM (which can be read and written with the EEPROM library).
38
Serial Communication:
The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial
communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the board
channels this serial communication over USB and appears as a virtual com port to software on the
computer. The '16U2 firmware uses the standard USB COM drivers, and no external driver is needed.
However, on Windows, a .inf file is required. The Arduino software includes a serial monitor which
allows simple textual data to be sent to and from the Arduino board. The RX and TX LEDs on the
board will flash when data is being transmitted via the USB-to-serial chip and USB connection to the
computer (but not for serial communication on pins 0 and 1).
A Software Serial library allows for serial communication on any of the Uno's digital pins. The
ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software includes a Wire
library to simplify use of the I2C bus. For SPI communication, use the SPI library.
39
Fig 3.3.1 Regulated Power Supply
The basic circuit diagram of a regulated power supply (DC O/P) with led connected as
load is shown in fig: 3.3.2.
Fig 3.3.2 Circuit diagram of Regulated Power Supply with Led connection
40
The components mainly used in above figure are
230V AC MAINS
TRANSFORMER
BRIDGE RECTIFIER(DIODES)
CAPACITOR
VOLTAGE REGULATOR(IC 7805)
RESISTOR
LED(LIGHT EMITTING DIODE)
The detailed explanation of each and every component mentioned above is as follows:
Transformation: The process of transforming energy from one device to another is called
transformation. For transforming energy we use transformers.
Transformers:
A transformer is a device that transfers electrical energy from one circuit to another
through inductively coupled conductors without changing its frequency. A varying current in the first
or primary winding creates a varying magnetic flux in the transformer's core, and thus a
varying magnetic field through the secondary winding. This varying magnetic field induces a
varying electromotive force (EMF) or "voltage" in the secondary winding. This effect is called mutual
induction.
If a load is connected to the secondary, an electric current will flow in the secondary
winding and electrical energy will be transferred from the primary circuit through the transformer to
the load. This field is made up from lines of force and has the same shape as a bar magnet.
41
If the current is increased, the lines of force move outwards from the coil. If the current
is reduced, the lines of force move inwards.
If another coil is placed adjacent to the first coil then, as the field moves out or in, the
moving lines of force will "cut" the turns of the second coil. As it does this, a voltage is induced in the
second coil. With the 50 Hz AC mains supply, this will happen 50 times a second. This is called
MUTUAL INDUCTION and forms the basis of the transformer.
The input coil is called the PRIMARY WINDING; the output coil is the
SECONDARY WINDING. Fig: 3.3.4. Shows step-down transformer.
For example, if the secondary has half the primary turns; the secondary will have half
the primary voltage.
Another example is if the primary has 5000 turns and the secondary has 500 turns, then
the turns ratio is 10:1.
If the primary voltage is 240 volts then the secondary voltage will be x 10 smaller = 24
volts. Assuming a perfect transformer, the power provided by the primary must equal the power taken
by a load on the secondary. If a 24-watt lamp is connected across a 24 volt secondary, then the
primary must supply 24 watts.
42
To aid magnetic coupling between primary and secondary, the coils are wound on a
metal CORE. Since the primary would induce power, called EDDY CURRENTS, into this core, the
core is LAMINATED. This means that it is made up from metal sheets insulated from each other.
Transformers to work at higher frequencies have an iron dust core or no core at all.
Note that the transformer only works on AC, which has a constantly changing current
and moving field. DC has a steady current and therefore a steady field and there would be no
induction.
Some transformers have an electrostatic screen between primary and secondary. This is
to prevent some types of interference being fed from the equipment down into the mains supply, or in
the other direction. Transformers are sometimes used for IMPEDANCE MATCHING.
Step Up transformer:
In case of step up transformer, primary windings are every less compared to secondary
winding.
Because of having more turns secondary winding accepts more energy, and it releases
more voltage at the output side.
Incase of step down transformer, Primary winding induces more flux than the
secondary winding, and secondary winding is having less number of turns because of that it accepts
less number of flux, and releases less amount of voltage.
A battery is a type of linear power supply that offers benefits that traditional line-
operated power supplies lack: mobility, portability and reliability. A battery consists of multiple
electrochemical cells connected to provide the voltage desired. Fig: 3.3.5 shows Hi-Watt 9V battery
43
Fig 3.3.5: Hi-Watt 9V Battery
The most commonly used dry-cell battery is the carbon-zinc dry cell battery. Dry-cell
batteries are made by stacking a carbon plate, a layer of electrolyte paste, and a zinc plate alternately
until the desired total voltage is achieved. The most common dry-cell batteries have one of the
following voltages: 1.5, 3, 6, 9, 22.5, 45, and 90. During the discharge of a carbon-zinc battery, the
zinc metal is converted to a zinc salt in the electrolyte, and magnesium dioxide is reduced at the
carbon electrode. These actions establish a voltage of approximately 1.5 V.
The lead-acid storage battery may be used. This battery is rechargeable; it consists of
lead and lead/dioxide electrodes which are immersed in sulfuric acid. When fully charged, this type of
battery has a 2.06-2.14 V potential (A 12 volt car battery uses 6 cells in series). During discharge, the
lead is converted to lead sulfate and the sulfuric acid is converted to water. When the battery is
charging, the lead sulfate is converted back to lead and lead dioxide A nickel-cadmium battery has
become more popular in recent years. This battery cell is completely sealed and rechargeable. The
electrolyte is not involved in the electrode reaction, making the voltage constant over the span of the
batteries long service life. During the charging process, nickel oxide is oxidized to its higher oxidation
state and cadmium oxide is reduced. The nickel-cadmium batteries have many benefits. They can be
stored both charged and uncharged. They have a long service life, high current availabilities, constant
voltage, and the ability to be recharged. Fig: 3.3.6 shows pencil battery of 1.5V.
44
Fig 3.3.6: Pencil Battery of 1.5V
Rectification:
Rectifiers:
A rectifier is an electrical device that converts alternating current (AC) to direct current
(DC), a process known as rectification. Rectifiers have many uses including as components of power
supplies and as detectors of radio signals. Rectifiers may be made of solid-state diodes, vacuum tube
diodes, mercury arc valves, and other components.
A device that it can perform the opposite function (converting DC to AC) is known as
an inverter.
When only one diode is used to rectify AC (by blocking the negative or positive
portion of the waveform), the difference between the term diode and the term rectifier is merely one
of usage, i.e., the term rectifier describes a diode that is being used to convert AC to DC. Almost all
rectifiers comprise a number of diodes in a specific arrangement for more efficiently converting AC to
DC than is possible with only one diode. Before the development of silicon semiconductor rectifiers,
vacuum tube diodes and copper (I) oxide or selenium rectifier stacks were used.
For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct, whereas
diodes D2 and D4 remain in the OFF state. The conducting diodes will be in series with the load
resistance RL and hence the load current flows through RL.
45
For the negative half cycle of the input ac voltage, diodes D2 and D4 conduct
whereas, D1 and D3 remain OFF. The conducting diodes D2 and D4 will be in series with the load
resistance RL and hence the current flows through RL in the same direction as in the previous half
cycle. Thus a bi-directional wave is converted into a unidirectional wave.
Input Output
DB107:
Now -a -days Bridge rectifier is available in IC with a number of DB107. In our project
we are using an IC in place of bridge rectifier. The picture of DB 107 is shown in fig: 3.3.8.
Features:
Filtration:
The process of converting a pulsating direct current to a pure direct current using filters
is called as filtration.
Filters:
Introduction to Capacitors:
Units of Capacitance:
Operation of Capacitor:
First, let's consider the case of a "coupling capacitor" where the capacitor is used to
connect a signal from one part of a circuit to another but without allowing any direct current to flow.
48
If the current flow is alternating between zero and a maximum,
our "storage tank" capacitor will allow the current waves to pass
through.
So a coupling capacitor allows "alternating current" to pass through because the ball
valve doesn't get a chance to close as the waves go up and down. However, a steady current quickly
fills the tank so that all flow stops.
A capacitor will pass alternating current but (apart from an initial surge) it will not pass d.c.
Regulation:
Voltage Regulator:
49
A voltage regulator (also called a regulator) with only three terminals appears to be a
simple device, but it is in fact a very complex integrated circuit. It converts a varying input voltage
into a constant regulated output voltage. Voltage Regulators are available in a variety of outputs like
5V, 6V, 9V, 12V and 15V. The LM78XX series of voltage regulators are designed for positive input.
For applications requiring negative input, the LM79XX series is used. Using a pair of voltage-
divider resistors can increase the output voltage of a regulator circuit.
It is not possible to obtain a voltage lower than the stated rating. You cannot use a 12V
regulator to make a 5V power supply. Voltage regulators are very robust. These can withstand over-
current draw due to short circuits and also over-heating. In both cases, the regulator will cut off before
any damage occurs. The only way to destroy a regulator is to apply reverse voltage to its input.
Reverse polarity destroys the regulator almost instantly. Fig: 3.3.11 shows voltage regulator.
Resistors:
A resistor is a two-terminal electronic component that produces a voltage across its terminals
that is proportional to the electric current passing through it in accordance with Ohm's law:
V = IR
Resistors are elements of electrical networks and electronic circuits and are ubiquitous in most
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).
The primary characteristics of a resistor are the resistance, the tolerance, maximum working
voltage and the power rating. Other characteristics include temperature coefficient, noise, and
50
inductance. Less well-known is critical resistance, the value below which power dissipation limits the
maximum permitted current flow, and above which the limit is applied voltage. Critical resistance is
determined by the design, materials and dimensions of the resistor.
Resistors can be made to control the flow of current, to work as Voltage dividers, to
dissipate power and it can shape electrical waves when used in combination of other components.
Basic unit is ohms.
Theory of operation:
Ohm's law:
The behavior of an ideal resistor is dictated by the relationship specified in Ohm's law:
V = IR
Ohm's law states that the voltage (V) across a resistor is proportional to the current (I)
through it where the constant of proportionality is the resistance (R).
Power dissipation:
The power dissipated by a resistor (or the equivalent resistance of a resistor network) is
calculated using the following:
51
Fig 3.3.12: Resistor Fig 3.3.13: Color Bands In Resistor
3.4. LED:
52
Working:
The structure of the LED light is completely different than that of the light bulb.
Amazingly, the LED has a simple and strong structure. The light-emitting semiconductor material is
what determines the LED's color. The LED is based on the semiconductor diode.
When a diode is forward biased (switched on), electrons are able to recombine with
holes within the device, releasing energy in the form of photons. This effect is called
electroluminescence and the color of the light (corresponding to the energy of the photon) is
determined by the energy gap of the semiconductor. An LED is usually small in area (less than
1 mm2), and integrated optical components are used to shape its radiation pattern and assist in
reflection. LEDs present many advantages over incandescent light sources including lower energy
consumption, longer lifetime, improved robustness, smaller size, faster switching, and greater
durability and reliability. However, they are relatively expensive and require more precise current and
heat management than traditional light sources. Current LED products for general lighting are more
expensive to buy than fluorescent lamp sources of comparable output. They also enjoy use in
applications as diverse as replacements for traditional light sources in automotive lighting
(particularly indicators) and in traffic signals. The compact size of LEDs has allowed new text and
video displays and sensors to be developed, while their high switching rates are useful in advanced
communications technology. The electrical symbol and polarities of led are shown in fig: 3.4.3.
No UV Rays
Visual signal application where the light goes more or less directly from the LED to the human
eye, to convey a message or meaning.
Illumination where LED light is reflected from object to give visual response of these objects.
Generate light for measuring and interacting with processes that do not involve the human
visual system.
3.5 GSM
Definition:
GSM, which stands for Global System for Mobile communications, reigns (important) as the
worlds most widely used cell phone technology. Cell phones use a cell phone service carriers GSM
network by searching for cell phone towers in the nearby area. Global system for mobile
communication (GSM) is a globally accepted standard for digital cellular communication.
54
GSM is the name of a standardization group established in 1982 to create a
common European mobile telephone standard that would formulate specifications for a pan-European
mobile cellular radio system operating at 900 MHz. It is estimated that many countries outside of
Europe will join the GSM partnership.
Need of GSM:
High-quality speech
Compatibility with Integrated Services Digital Network (ISDN) and other telephone company
services.
A GSM network consists of several functional entities whose functions and interfaces are
defined. The GSM network can be divided into following broad parts.
55
Fig: GSM Network.
The added components of the GSM architecture include the functions of the databases and messaging
systems:
56
Following fig shows the diagram of GSM Network along with added elements.
The MS and the BSS communicate across the Um interface, also known as the air interface or
radio link. The BSS communicates with the Network Service Switching center across the A interface.
Cell: Cell is the basic service area, one BTS covers one cell. Each cell is given a Cell Global Identity
(CGI), a number that uniquely identifies the cell.
Location Area: A group of cells form a Location Area. This is the area that is paged when a
subscriber gets an incoming call. Each Location Area is assigned a Location Area Identity (LAI). Each
Location Area is served by one or more BSCs.
MSC/VLR Service Area: The area covered by one MSC is called the MSC/VLR service area.
PLMN: The area covered by one network operator is called PLMN. A PLMN can contain one or
more MSCs.
57
The GSM networks parts are explained as follows:
1) Mobile Station:
The mobile station (MS) consists of the physical equipment, such as the radio
transceiver, display and digital signal processors, and a smart card called the Subscriber Identity
Module (SIM). The SIM provides personal mobility, so that the user can have access to all
subscribed services irrespective of both the location of the terminal and the use of a specific terminal.
By inserting the SIM card into another GSM cellular phone, the user is able to receive calls at that
phone, make calls from that phone, or receive other subscribed services.
The mobile equipment is uniquely identified by the International Mobile Equipment Identity
(IMEI). The SIM card contains the International Mobile Subscriber Identity (IMSI), identifying the
subscriber, a secret key for authentication, and other user information. The IMEI and the IMSI are
independent, thereby providing personal mobility. The SIM card may be protected against
unauthorized use by a password or personal identity number.
The Base Station Subsystem is composed of two parts, the Base Transceiver Station (BTS)
and the Base Station Controller (BSC). These communicate across the specified Abis interface,
allowing (as in the rest of the system) operation between components made by different suppliers.
The Base Transceiver Station houses the radio transceivers that define a cell and handles the
radio link protocols with the Mobile Station. In a large urban area, there will potentially be a large
number of BTSs deployed. The requirements for a BTS are ruggedness, reliability, portability, and
minimum cost.
The Base Station Controller manages the radio resources for one or more BTSs. It
handles radio channel setup, frequency hopping, and handovers, as described below. The BSC is the
connection between the mobile and the Mobile service Switching Center (MSC). The BSC also
translates the 13 kbps voice channel used over the radio link to the standard 64 kbps channel used by
the Public Switched Telephone Network or ISDN.
3) Network Subsystem:
58
The central component of the Network Subsystem is the Mobile
services Switching Center (MSC). It acts like a normal switching node of
the PSTN or ISDN, and in addition provides all the functionality needed to
handle a mobile subscriber, such as registration, authentication, location
updating, handovers, and call routing to a roaming subscriber. These
services are provided in conjunction with several functional entities, which together form the Network
Subsystem. The MSC provides the connection to the public fixed network (PSTN or ISDN), and
signaling between functional entities uses the ITUT Signaling System Number 7 (SS7), used in ISDN
and widely used in current public networks.
The Home Location Register (HLR) and Visitor Location Register (VLR), together with the
MSC, provide the call routing and (possibly international) roaming capabilities of GSM. The HLR
contains all the administrative information of each subscriber registered in the corresponding GSM
network, along with the current location of the mobile. The current location of the mobile is in the
form of a Mobile Station Roaming Number (MSRN) which is a regular ISDN number used to route a
call to the MSC where the mobile is currently located. There is logically one HLR per GSM
network, although it may be implemented as a distributed database.
The Visitor Location Register contains selected administrative information from the HLR,
necessary for call control and provision of the subscribed services, for each mobile currently located
in the geographical area controlled by the VLR. Although each functional entity can be implemented
as an independent unit, most manufacturers of switching equipment implement one VLR together
with one MSC, so that the geographical area controlled by the MSC corresponds to that controlled by
the VLR, simplifying the signaling required. Note that the MSC contains no information about
particular mobile stations - this information is stored in the location registers.
The other two registers are used for authentication and security purposes. The Equipment
Identity Register (EIR) is a database that contains a list of all valid mobile equipment on the network,
where each mobile station is identified by its International Mobile Equipment Identity (IMEI). An
IMEI is marked as invalid if it has been reported stolen or is not type approved. The Authentication
Center is a protected database that stores a copy of the secret key stored in each subscriber's SIM card,
which is used for authentication and ciphering of the radio channel.
59
GSM - The Base Station Subsystem (BSS):
The BTS and the BSC communicate across the specified Abis interface, enabling operations
between components that are made by different suppliers. The radio components of a BSS may
consist of four to seven or nine cells. A BSS may have one or more base stations. The BSS uses the
Abis interface between the BTS and the BSC. A separate high-speed line (T1 or E1) is then connected
from the BSS to the Mobile MSC.
The BTS houses the radio transceivers that define a cell and handles the radio link protocols
with the MS. In a large urban area, a large number of BTSs may be deployed.
60
The BTS corresponds to the transceivers and antennas used in each cell of the network. A
BTS is usually placed in the center of a cell. Its transmitting power defines the size of a cell. Each
BTS has between 1 and 16 transceivers, depending on the density of users in the cell. Each BTS
serves a single cell. It also includes the following functions:
Encoding, encrypting, multiplexing, modulating, and feeding the RF signals to the antenna.
Transcoding and rate adaptation
Timing advances
The BSC manages the radio resources for one or more BTSs. It handles radio channel
setup, frequency hopping, and handovers. The BSC is the connection between the mobile and the
MSC. The BSC also translates the 13 Kbps voice channel used over the radio link to the standard 64
Kbps channel used by the Public Switched Telephone Network (PSDN) or ISDN.
61
It assigns and releases frequencies and time slots for the MS. The BSC also handles intercell
handover. It controls the power transmission of the BSS and MS in its area. The function of the BSC
is to allocate the necessary time slots between the BTS and the MSC. It is a switching device that
handles the radio resources. Additional functions include:
Providing an interface to the Operations and Maintenance Center for the BSS
Power management
The Network switching system (NSS), the main part of which is the Mobile Switching
Center (MSC), performs the switching of calls between the mobile and other fixed or mobile network
users, as well as the management of mobile services such as authentication.
62
The switching system includes the following functional elements.
The HLR is a database used for storage and management of subscriptions. The HLR is
considered the most important database, as it stores permanent data about subscribers, including a
subscriber's service profile, location information, and activity status. When an individual buys a
subscription in the form of SIM then all the information about this subscription is registered in the
HLR of that operator.
The central component of the Network Subsystem is the MSC. The MSC performs the
switching of calls between the mobile and other fixed or mobile network users, as well as the
management of mobile services such as such as registration, authentication, location updating,
handovers, and call routing to a roaming subscriber. It also performs such functions as toll ticketing,
network interfacing, common channel signaling, and others. Every MSC is identified by a unique ID.
The VLR is a database that contains temporary information about subscribers that is needed
by the MSC in order to service visiting subscribers. The VLR is always integrated with the MSC.
When a mobile station roams into a new MSC area, the VLR connected to that MSC will request data
about the mobile station from the HLR. Later, if the mobile station makes a call, the VLR will have
the information needed for call setup without having to interrogate the HLR each time.
The Authentication Center is a protected database that stores a copy of the secret key stored
in each subscriber's SIM card, which is used for authentication and ciphering of the radio channel. The
AUC protects network operators from different types of fraud found in today's cellular world.
63
The Equipment Identity Register (EIR) is a database that contains a list of all valid mobile
equipment on the network, where its International Mobile Equipment Identity (IMEI) identifies each
MS. An IMEI is marked as invalid if it has been reported stolen or is not type approved.
The operations and maintenance center (OMC) is connected to all equipment in the switching
system and to the BSC. The implementation of OMC is called the operation and support system
(OSS).
Maintenance Tasks.
The operation and Maintenance functions are based on the concepts of the Telecommunication
Management Network (TMN) which is standardized in the ITU-T series M.30.
Following is the figure which shows how OMC system covers all the GSM elements.
The OSS is the functional entity from which the network operator monitors and controls the
system. The purpose of OSS is to offer the customer cost-effective support for centralized, regional
64
and local operational and maintenance activities that are required for a GSM network. An important
function of OSS is to provide a network overview and support the maintenance activities of different
operation and maintenance organizations.
Specifications for different Personal Communication Services (PCS) systems vary among the
different PCS networks. The GSM specification is listed below with important characteristics.
Modulation:
Modulation is a form of change process where we change the input information into a suitable
format for the transmission medium. We also changed the information by demodulating the signal at
the receiving end.
The GSM uses Gaussian Minimum Shift Keying (GMSK) modulation method.
Access Methods:
Because radio spectrum is a limited resource shared by all users, a method must be devised to
divide up the bandwidth among as many users as possible.
GSM chose a combination of TDMA/FDMA as its method. The FDMA part involves the
division by frequency of the total 25 MHz bandwidth into 124 carrier frequencies of 200 kHz
bandwidth.
One or more carrier frequencies are then assigned to each BS. Each of these carrier
frequencies is then divided in time, using a TDMA scheme, into eight time slots. One time slot is used
for transmission by the mobile and one for reception. They are separated in time so that the mobile
unit does not receive and transmit at the same time.
65
Transmission Rate:
The total symbol rate for GSM at 1 bit per symbol in GMSK produces 270.833 K
symbols/second. The gross transmission rate of the time slot is 22.8 Kbps.
Frequency Band:
The uplink frequency range specified for GSM is 933 - 960 MHz (basic 900 MHz band only).
The downlink frequency band 890 - 915 MHz (basic 900 MHz band only).
Channel Spacing: This indicates separation between adjacent carrier frequencies. In GSM, this is
200 kHz.
Speech Coding:
GSM uses linear predictive coding (LPC). The purpose of LPC is to reduce the bit rate. The
LPC provides parameters for a filter that mimics the vocal tract. The signal passes through this filter,
leaving behind a residual signal. Speech is encoded at 13 kbps.
Duplex Distance:
The duplex distance is 80 MHz. Duplex distance is the distance between the uplink and
downlink frequencies. A channel has two frequencies, 80 MHz apart.
Misc:
66
Advantages of GSM:
GSM is mature, having started in the mid-80s. This maturity means a more stable network
with robust features. CDMA is still building its network.
GSM maturity means engineers cut their teeth on the technology, creating an unconscious
preference.
The availability of Subscriber Identity Modules, which are smart cards that provide secure data
encryption give GSM m-commerce advantages.
Commands always start with AT (which means Attention) and finish with a <CR> character.
Responses start and end with <CR><LF>, except for the ATV0 DCE response format) and the ATQ1
(result code suppression) commands.
_ If command syntax is correct but with some incorrect parameters, the +CME ERROR:
<Err> or +CMS ERROR: <Sms Err> strings are returned with different error codes.
67
In some cases, such as AT+CPIN? or (unsolicited) incoming events, the product does not return the
OK string as a response.
5. Dial command D
Please note that for an international number, the local international prefix does not need to be set
(usually 00) but does need to be replaced by the + character.
Example: to set up a voice call to Wavecom offices from another country, the AT command is:
ATD+33146290800;
Note that some countries may have specific numbering rules for their GSM handset numbering. The
response to the ATD command is one of the following:
6. Hang-Up command H
Description: The ATH (or ATH0) command disconnects the remote user. In the case of multiple calls,
all calls are released (active, on-hold and waiting calls). The specific Wavecom ATH1 command has
been appended to disconnect the current outgoing call, only in dialing or alerting state (ie. ATH1 can
be used only after the ATD command, and before its terminal response (OK, NO CARRIER, ...). It
can be useful in the case of multiple calls.
7. Answer a call A
Description: When the product receives a call, it sets the RingInd signal and sends the ASCII
RING or +CRING: <type> string to the application (+CRING if the cellular result code +CRC
is enabled). Then it waits for the application to accept the call with the ATA command.
68
Command syntax: ATA
Description: This command redials the last number used in the ATD command. The last number
dialed is displayed followed by ; for voice calls only
Description: The message formats supported are text mode and PDU mode. In PDU mode, a
complete SMS Message including all header information is given as a binary string (in hexadecimal
format). Therefore, only the following set of characters is allowed:
{0,1,2,3,4,5,6,7,8,9, A, B,C,D,E,F}. Each pair or characters are converted
to a byte (e.g.: 41 is converted to the ASCII character A, whose ASCII code is 0x41 or 65). In Text
mode, all commands and responses are in ASCII characters. The format selected is stored in
EEPROM by the +CSAS command.
Description: This command allows the application to read stored messages. The messages are read
from the memory selected by +CPMS command.
Description: The <address> field is the address of the terminal to which the message is sent. To send
the message, simply type, <ctrl-Z> character (ASCII 26). The text can contain all existing characters
except <ctrl-Z> and <ESC> (ASCII 27). This command can be aborted using the <ESC> character
when entering text. In PDU mode, only hexadecimal characters are used (09,AF).
69
Description: This command deletes one or several messages from preferred message storage (BM
SMS CB RAM storage, SM SMSPP storage SIM storage or SR SMS Status-Report storage).
General Features:
Tri-band GSM/GPRS900/1800/1900Mhz
GPRS multi-slot class 10
GPRS mobile station class B
Complaint to GSM phase 2/2+
i. -class 4(2W @900MHz)
ii. -class 1(1W @/18001900MHz)
Dimensions: 40x33x2.85 mm
Weight: 8gm
7. Control via AT commands
(GSM 07.07, 07.05 and SIMCOM enhanced AT commands)
SIM application tool kit
supply voltage range 3.5.4.5 v
Low power consumption
70
Normal operation temperature: -20 C to +55 C
Restricted operation temperature : -20 C to -25 C and +55 C to +70 C
storage temperature: -40 C to +80 C
Designed for global market, SIM300 is a Tri-band GSM/GPRS engine that works on frequencies
EGSM 900 MHz, DCS 1800 MHz and PCS1900 MHz. SIM300 provides GPRS multi-slot class 10
capabilities and support the GPRS coding schemes CS-1, CS-2, CS-3 and CS-4. With a tiny
configuration of 40mm x 33mm x 2.85 mm , SIM300 can fit almost all the space requirement in your
application, such as Smart phone, PDA phone and other mobile device. The physical interface to the
mobile application is made through a 60 pins board-to-board connector, which provides all hardware
interfaces between the module and customers boards except the RF antenna interface.
71
The keypad and SPI LCD interface will give you the flexibility to develop customized
applications.
Two serial ports can help you easily develop your applications.
Two audio channels include two microphones inputs and two speaker outputs.
This can be easily configured by AT command. SIM300 provide RF antenna interface with two
alternatives: antenna connector and antenna pad. The antenna connector is MURATA MM9329-2700.
And customers antenna can be soldered to the antenna pad.
The SIM300 is designed with power saving technique, the current consumption to as low as 2.5mA in
SLEEP mode. The SIM300 is integrated with the TCP/IP protocol Extended TCP/IP AT commands
are developed for customers to use the TCP/IP protocol easily, which is very useful for those data
transfer applications.
72
FIG: SIM300 Hardware Interface Description
3. Frequency bands: SIM300 Tri-band: EGSM 900, DCS 1800, PCS 1900. The band can be set by
AT COMMAND, and default band is EGSM 900 and DCS 1800.
73
4. Temperature range:
Normal operation: -20C to +55C
Restricted operation: -25C to -20C and +55C to +70C
Storage temperature -40C to +80C
The power supply of SIM300 is from a single voltage source of VBAT= 3.4V...4.5V. In some case, the
ripple in a transmit burst may cause voltage drops when current consumption rises to typical peaks of
2A, So the power supply must be able to provide sufficient current up to 2A. For the VBAT input, a
local bypass capacitor is recommended. A capacitor (about 100F, low ESR) is recommended. Multi-
layer ceramic chip (MLCC) capacitors can provide the best combination of low ESR and small size
but may not be cost effective. A lower cost choice may be a 100 F tantalum capacitor (low ESR)
with a small (1 F to 10F) ceramic in parallel, which is illustrated as following figure. And the
capacitors should put as closer as possible to the SIM300 VBAT pins. The following figure is the
recommended circuit.
74
The following figure is the VBAT voltage ripple wave at the maximum power transmit phase, the test
condition is VBAT=4.0V, VBAT maximum output current =2A, CA=100 F tantalum capacitor
(ESR=0.7) and CB=4.7F.
Eight VBAT pins of the board-to-board connector are dedicated to connect the supply voltage; four
GND pins are recommended for grounding. BACKUP can be used to back up the RTC.
SIM300 provides two unbalanced asynchronous serial ports. The GSM module is designed as a DCE
(Data Communication Equipment), following the traditional DCE-DTE (Data Terminal Equipment)
connection, the module and the client (DTE) are connected through the following signal (as following
figure shows). Auto bauding supports baud rate from 1200 bps to 115200bps.
Serial port 1
Port/TXD @ Client sends data to the RXD signal line of module
Port/RXD @ Client receives data from the TXD signal line of module
Serial port 2
Port/TXD @ Client sends data to the DGBRXD signal line of module
Port/RXD @ Client receives data from the DGBTXD signal line of module
All pins of two serial ports have 8mA driver, the logic levels are described in following table:
75
3.5.8 Function of Serial Port 1 & 2 supporting
Serial port 1
1. Seven lines on Serial Port Interface
2. Contains Data lines /TXD and /RXD, State lines /RTS and /CTS, Control lines /DTR, /DCD
and RING;
3. Serial Port 1 can be used for CSD FAX, GPRS service and send AT command of controlling
module. Serial Port 1 can use multiplexing function, but you cannot use the Serial Port 2 at the
same time;
4. Serial Port 1 supports the communication rate as following: 1200, 2400, 4800, 9600, 19200,
38400, 57600, and 115200 Default as 115200bps.
5. Autobauding supports the communication rate as following: 1200, 2400, 4800, 9600, 19200,
38400, 57600, and 115200bps.
Absolute maximum rating for power supply and voltage on digital and analog pins of SIM300 are list
in following table:
78
Figure 16
Microphone interface configuration
79
Earphone interface configuration
11. Buzzer
The PIN 36 on the board-to-board connector can be used to drive a buzzer to indicate incoming call.
The output volume of buzzer can be set by AT+CRSL. The reference circuit for buzzer as
80
12. SIM card interface
You can use AT Command to get information in SIM card. The SIM interface supports the
functionality of the GSM Phase 1 specification and also supports the functionality of the new GSM
Phase 2+ specification for FAST 64 kbps SIM (intended for use with a SIM application Tool-kit).
Both 1.8V and 3.0V SIM Cards are supported. The SIM interface is powered from an internal
regulator in the module having nominal voltage 2.8V. All pins reset as outputs driving low.
Figure 20: SIM interface reference circuit with 6 pins SIM card
SIM300 provides a serial LCD display interface that supports serial communication with LCD device.
These are composite pins that can be used as GPIO ports or LCD display interface according to your
application. When use as LCD interface, the following table is the pin define. LCD interface timing
should be united with the LCD device.
14. ADC
81
SIM300 provides one auxiliary ADC (General purpose analog to digital converter.) as voltage input
pin, which can be used to detect the values of some external items such as voltage, temperature etc.
User can use AT command AT+CADC to read the voltage value added on ADC pin.
The PIN 30 on the board-to-board connector can be used to drive a network status indication LED
lamp. The working state of this pin is listed in following table:
82
Figure 25 Reference circuit for Network status LED
The RF interface has an impedance of 50. To suit the physical design of individual applications
SIM300 offers two alternatives:
1. Recommended approach: antenna connector on the component side of the PCB
2. Antenna pad and grounding plane placed on the bottom side.
3. To minimize the loss on the RF cable, it need be very careful to choose RF cable. We
recommend the insertion loss should be meet following requirement:
4. GSM900<1dB
5. DCS1800/PCS1900<1.5dB
SIM300 use MURATAs MM9329-2700 RF connector on the module side, we recommend user use
MURATAs MXTK92XXXXX as matching connector on the application side. Please refer to
appendix for detail info about MURATAs MXTK92XXXXX.
The antenna can be soldered to the pad, or attached via contact springs. To help you to ground the
antenna, SIM300 comes with a grounding plane located close to the antenna pad.
SIM300 material properties:
SIM300 PCB Material: FR4
Antenna pad: Gold plated pad
Antenna pad soldering temperature (fewer 10 seconds): 260C
3.6 RS 232:
83
3.5.1 Serial Communication:
Computers transfer data in two ways: parallel and serial. In parallel data transfers,
often 8 or more lines are used to transfer data to a device that is only a few feet away. Although a lot
of data can be transferred in a short amount of time by using many wires in parallel, the distance
cannot be great. To transfer to a device located many meters away, the serial method is best suitable.
The fact that serial communication uses a single data line instead of the 8-bit data line
instead of the 8-bit data line of parallel communication not only makes it cheaper but also enables two
computers located in two different cities to communicate over the telephone.
Serial data communication uses two methods, asynchronous and synchronous. The synchronous
method transfers a block of data at a time, while the asynchronous method transfers a single byte at a
time. With synchronous communications, the two devices initially synchronize themselves to each
other, and then continually send characters to stay in sync. Even when data is not really being sent, a
constant flow of bits allows each device to know where the other is at any given time. That is, each
character that is sent is either actual data or an idle character. Synchronous communications allows
faster data transfer rates than asynchronous methods, because additional bits to mark the beginning
and end of each data byte are not required.
The serial ports on IBM-style PCs are asynchronous devices and therefore only support
asynchronous serial communications.
Asynchronous means "no synchronization", and thus does not require sending and
receiving idle characters. However, the beginning and end of each byte of data must be identified by
start and stop bits. The start bit indicates when the data byte is about to begin and the stop bit signals
when it ends. The requirement to send these additional two bits causes asynchronous communication
to be slightly slower than synchronous however it has the advantage that the processor does not have
to deal with the additional idle characters.
There are special IC chips made by many manufacturers for serial data
communications. These chips are commonly referred to as UART (universal asynchronous receiver-
transmitter) and USART (universal synchronous-asynchronous receiver-transmitter). The 8051 has a
built-in UART.
Microcontroller
84
PC
RS 232 cable
MAX 232 IC
Hyper Terminal
Serial transmission involves the sending of data one bit at a time, over single
communications line. In contrast, parallel communications require at least as many lines as there
are bits in a word being transmitted (for an 8-bit word, a minimum of 8 lines are needed) serial
transmission is beneficial for long distance communications, where as parallel is designed for
short distance or when very high transmission rates are required.
85
Fig: 3.5.3 RS 232 cable
DATA FORMAT:
Start bit: Binary 0
Data: 5, 6, 7 or 8 bits
Parity: Odd, even, mark or space (not used with 8-bit data), Stop bit: Binary 1, one or two bits
Serial Ports come in two "sizes", There are the D-Type 25 pin connector and the D-Type 9
Pin connector both of which are male on the back of the PC, thus you will require a female connector
on your device. Below is a table of pin connections for the 9 pin and 25 pin D-Type connectors.
87
Fig 3.5.6:DB9 pin connector
Serial Pinouts (D9 Connectors) D-Type-9 Pin No. Abbreviation Full Name:
One of the most common devices attached to a micro controller is an LCD display. Some of the most
common LCDs connected to the many microcontrollers are 16x2 and 20x2 displays. This means 16
characters per line by 2 lines and 20 characters per line by 2 lines, respectively.
Pin description:
The LCD requires 3 control lines as well as either 4 or 8 I/O lines for the data bus. The user may
select whether the LCD is to operate with a 4-bit data bus or an 8-bit data bus. If a 4-bit data bus is
used the LCD will require a total of 7 data lines (3 control lines plus the 4 lines for the data bus). If an
8-bit data bus is used the LCD will require a total of 11 data lines (3 control lines plus the 8 lines for
the data bus).
The three control lines are referred to as EN, RS, and RW.
The EN line is called "Enable." This control line is used to tell the LCD that we are sending it data. To
send data to the LCD, our program should make sure this line is low (0) and then set the other two
control lines and/or put data on the data bus. When the other lines are completely ready, bring EN
high (1) and wait for the minimum amount of time required by the LCD datasheet (this varies from
LCD to LCD), and end by bringing it low (0) again.
91
The RS line is the "Register Select" line. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is high (1), the
data being sent is text data which should be displayed on the screen. For example, to display the letter
"T" on the screen we would set RS high.
The RW line is the "Read/Write" control line. When RW is low (0), the information on the data
bus is being written to the LCD. When RW is high (1), the program is effectively querying (or
reading) the LCD. Only one instruction ("Get LCD status") is a read command. All others are write
commands--so RW will almost always be low.
Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected by
the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3, DB4,
DB5, DB6, and DB7.
Schematic:
Circuit Description:
Above is the quite simple schematic. The LCD panel's Enable and Register Select is connected
to the Control Port. The Control Port is an open collector / open drain output. While most Parallel
Ports have internal pull-up resistors, there is a few which don't. Therefore by incorporating the two
92
10K external pull up resistors, the circuit is more portable for a wider range of computers, some of
which may have no internal pull up resistors.
We make no effort to place the Data bus into reverse direction. Therefore we hard wire the
R/W line of the LCD panel, into write mode. This will cause no bus conflicts on the data lines. As a
result we cannot read back the LCD's internal Busy Flag which tells us if the LCD has accepted and
finished processing the last instruction. This problem is overcome by inserting known delays into our
program.
The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy here. As with
all the examples, I've left the power supply out. We can use a bench power supply set to 5v or use an
onboard +5 regulator. Remember a few de-coupling capacitors, especially if we have trouble with the
circuit working properly.
SETB RW
As we mentioned above, the EN line is used to tell the LCD that we are ready for it to execute
an instruction that we've prepared on the data bus and on the other control lines. Note that the EN line
must be raised/ lowered before/after each instruction sent to the LCD regardless of whether that
instruction is read or write text or instruction. In short, we must always manipulate EN when
communicating with the LCD. EN is the LCD's way of knowing that we are talking to it. If we don't
raise/lower EN, the LCD doesn't know we're talking to it on the other lines.
Thus, before we interact in any way with the LCD we will always bring the EN line low with
the following instruction:
CLR EN
And once we've finished setting up our instruction with the other control lines and data bus lines,
we'll always bring this line high:
SETB EN
93
The line must be left high for the amount of time required by the LCD as specified in its
datasheet. This is normally on the order of about 250 nanoseconds, but checks the datasheet. In the
case of a typical microcontroller running at 12 MHz, an instruction requires 1.08 microseconds to
execute so the EN line can be brought low the very next instruction. However, faster microcontrollers
(such as the DS89C420 which executes an instruction in 90 nanoseconds given an 11.0592 MHz
crystal) will require a number of NOPs to create a delay while EN is held high. The number of NOPs
that must be inserted depends on the microcontroller we are using and the crystal we have selected.
The instruction is executed by the LCD at the moment the EN line is brought low with a final
CLR EN instruction.
As previously mentioned, it takes a certain amount of time for each instruction to be executed
by the LCD. The delay varies depending on the frequency of the crystal attached to the oscillator input
of the LCD as well as the instruction which is being executed.
While it is possible to write code that waits for a specific amount of time to allow the LCD to
execute instructions, this method of "waiting" is not very flexible. If the crystal frequency is changed,
the software will need to be modified. A more robust method of programming is to use the "Get LCD
Status" command to determine whether the LCD is still busy executing the last instruction received.
The "Get LCD Status" command will return to us two tidbits of information; the information
that is useful to us right now is found in DB7. In summary, when we issue the "Get LCD Status"
command the LCD will immediately raise DB7 if it's still busy executing a command or lower DB7 to
indicate that the LCD is no longer occupied. Thus our program can query the LCD until DB7 goes
low, indicating the LCD is no longer busy. At that point we are free to continue and send the next
command.
Applications:
Medical equipment
Electronic test equipment
Industrial machinery Interface
Serial terminal
94
Advertising system
EPOS
Restaurant ordering systems
Gaming box
Security systems
R&D Test units
Climatizing units
PLC Interface
Simulators
Environmental monitoring
Lab development
Student projects
Home automation
PC external display
HMI operator interface.
95
Breadboards are great for prototyping equipment as it allows great flexibility to modify
a design when needed; however the final product of a project, ideally should have a neat PCB, few
cables, and survive a shake test. Not only is a proper PCB neater but it is also more durable as there
are no cables which can yank loose.
Express PCB is a software tool to design PCBs specifically for manufacture by the
company Express PCB (no other PCB maker accepts Express PCB files). It is very easy to use, but it
does have several limitations.
Express PCB has been used to design many PCBs (some layered and with surface-mount
parts. Print out PCB patterns and use the toner transfer method with an Etch Resistant Pen to make
boards. However, Express PCB does not have a nice print layout. Here is the procedure to design in
Express PCB and clean up the patterns so they print nicely.
Express PCB comes with a less then exciting list of parts. So before any project is started
head over to Audio logic and grab the additional parts by morsel, ppl, and tangent, and extract them
into your Express PCB directory. At this point start the program and get ready to setup the workspace
to suit your style.
Click View -> Options. In this menu, setup the units for mm or in depending on how
you think, and click see through the top copper layer at the bottom. The standard color scheme of
red and green is generally used but it is not as pleasing as red and blue.
When a project is first started you will be greeted with a yellow outline. This yellow outline
is the dimension of the PCB. Typically after positioning of parts and traces, move them to their final
96
position and then crop the PCB to the correct size. However, in designing a board with a certain size
constraint, crop the PCB to the correct size before starting.
Fig: 4.1 show the toolbar in which the each button has the following functions:
The select tool: It is fairly obvious what this does. It allows you to move and manipulate parts.
When this tool is selected the top toolbar will show buttons to move traces to the top / bottom
copper layer, and rotate buttons.
The zoom to selection tool: does just that.
The place pad: button allows you to place small soldier pads which are useful for board
connections or if a part is not in the part library but the part dimensions are available. When
this tool is selected the top toolbar will give you a large selection of round holes, square holes
and surface mount pads.
The place component: tool allows you to select a component from the top toolbar and then by
clicking in the workspace places that component in the orientation chosen using the buttons
next to the component list. The components can always be rotated afterwards with the select
tool if the orientation is wrong.
The place trace: tool allows you to place a solid trace on the board of varying thicknesses. The
top toolbar allows you to select the top or bottom layer to place the trace on.
The Insert Corner in trace: button does exactly what it says. When this tool is selected,
clicking on a trace will insert a corner which can be moved to route around components and
other traces.
The remove a trace button is not very important since the delete key will achieve the same
result.
97
4.1.3 Design Considerations:
Before starting a project there are several ways to design a PCB and one must be
chosen to suit the projects needs.
When making a PCB you have the option of making a single sided board, or a double
sided board. Single sided boards are cheaper to produce and easier to etch, but much harder to
design for large projects. If a lot of parts are being used in a small space it may be difficult to make
a single sided board without jumpering over traces with a cable. While theres technically nothing
wrong with this, it should be avoided if the signal travelling over the traces is sensitive (e.g. audio
signals).
When using a double sided board you must consider which traces should be on what
side of the board. Generally, put power traces on the top of the board, jumping only to the bottom if
a part cannot be soldiered onto the top plane (like a relay), and vice- versa.
Some projects like power supplies or amps can benefit from having a solid plane to use
for ground. In power supplies this can reduce noise, and in amps it minimizes the distance between
parts and their ground connections, and keeps the ground signal as simple as possible. However,
care must be taken with stubborn chips such as the TPA6120 amplifier from TI. The TPA6120
datasheet specifies not to run a ground plane under the pins or signal traces of this chip as the
capacitance generated could effect performance negatively.
98
For ATmega328 microcontroller, Aurduino compiler is used for compilation. The
compilation steps are as follows:
Plug in your board and wait for Windows to begin its driver installation process
After a few moments, the process will fail, despite its best efforts
While in the Control Panel, navigate to System and Security. Next, click on System
Look under Ports (COM & LPT). You should see an open port named Arduino UNO
(COMxx). If there is no COM & LPT section, look under Other Devices for Unknown
Device
99
Right click on the Arduino UNO (COMxx) or Unknown Device port and choose the
Update Driver Software option
Next, choose the Browse my computer for Driver software option
Finally, navigate to and select the Unos driver file, named ArduinoUNO.inf, located in the
Drivers folder of the Arduino Software download (not the FTDI USB Drivers sub-
directory). If you cannot see the .inf file, it is probably just hidden. You can select the drivers
folder with the search sub-folders option selected instead.
Windows will finish up the driver installation from there
For earlier versions of the Arduino boards (e.g.Arduino Duemilanove, Nano, or Diecimila) check
out this page for specific directions.
After following the appropriate steps for your software install, we are now ready to test your first
program with your Arduino board!
Open the Blink example sketch by going to: File > Examples > 1.Basics > Blink
Select the type of Arduino board youre using: Tools > Board > your board type
101
Select the serial/COM port that your Arduino is attached to: Tools > Port > COMxx
102
If youre not sure which serial device is your Arduino, take a look at the available ports, then
unplug your Arduino and look again. The one that disappeared is your Arduino.
With your Arduino board connected, and the Blink sketch open, press the Upload button
4.3 Proteus:
Proteus is software which accepts only hex files. Once the machine code is converted
into hex code, that hex code has to be dumped into the microcontroller and this is done by the Proteus.
Proteus is a programmer which itself contains a microcontroller in it other than the one which is to be
programmed. This microcontroller has a program in it written in such a way that it accepts the hex file
from the pic compiler and dumps this hex file into the microcontroller which is to be programmed. As
the Proteus programmer requires power supply to be operated, this power supply is given from the
power supply circuit designed and connected to the microcontroller in proteus. The program which is
to be dumped in to the microcontroller is edited in proteus and is compiled and executed to check any
errors and hence after the successful compilation of the program the program is dumped in to the
microcontroller using a dumper.
103
CHAPTER 5: PROJECT DESCRIPTION
Disadvantages:
Applications:
CHAPTER 7: RESULTS
7.1 Result:
105
The project AURDINO BASED WIRELESS NOTICE
BOARD was designed such that the SMS message was displayed on the notice board from any
mobile phone with the help of GSM modem.
7.2 Conclusion:
Integrating features of all the hardware components used have been developed in it.
Presence of every module has been reasoned out and placed carefully, thus contributing to the best
working of the unit. Secondly, using highly advanced ICs with the help of growing technology, the
project has been successfully implemented. Thus the project has been successfully designed and
tested.
This project can be extended using RS485, which also uses wired mechanism but the distance
is far more than RS232. Also, wireless technology like Zigbee can be used.
REFERENCES
106
The sites which were used while doing this project:
1. www.wikipedia.com
2. www.allaboutcircuits.com
3. www.microchip.com
4. www.howstuffworks.com
Books referred:
6. Embedded C Michael.J.Pont.
107