Anda di halaman 1dari 91

GSM MODULE BASED INTEGRATIVE DETECTION OF OPEN

DRAINAGE, OVER FLOW FOR SMART CITIES


ABSTRACT
Open sewage and a faulty over head line falling on the ground during rainy season is a
serious but unattended problem. This may cause death if people near that area fail to notice it.
Garbage overflow cause growth of insects and bad odor leads to spread of disease. This project
provides a solution for this problem. Sewage system is monitored using wireless sensor network
and if it is open or if it gets full, then alert is sent to the corresponding department about the
same. Also, during rainy season, if overhead line gets cut and falls down in logging water, then
using sensors in a water resistant setup, it is intimated to the EB department. This setup kept in a
water resistant box near the sewage. Another module near the transformer receives this alert and
send message to the department using GSM communication. Thus by proper monitoring, life can
be saved from danger. The garbage full is intimated to corporation to manage the solid waste for
a clean society.
EXISTING SYSTEM

 In the existing system, sensors are not yet employed in monitoring the sewage system,
monitoring garbage full and also, if an over head line falls down in rain water, only if some
person notice it and inform to others in the nearby area orally.
 In our system is giving a possibility of power shock while raining. If Wires are
disconnected, automatic power off system not available.
PROPOSED SYSTEM

In this proposed system, a module is set up near the sewage system with float
sensor for monitoring the sewage water level and proximity sensor for monitoring whether the
sewage lid is open or closed. If either the lid is open or the water level is full and the sewage is
overflowing, then the microcontroller sends an alert signal to the GSM module and sends SMS
alert to the concerned department. Also, to alert people about the sewage condition to prevent
death due to falling into open sewage, a buzzer alert is given in the sewage module. Also, the
sewage module consists of a current sensor and a wire is connected to this sensor. This wire is let
open out of the water resistant box so that when a faulty over head line fall into the water logging
in ground during rainy season, then current flows through the water logged in that area and it
reaches the wire exposed outside the box. When a current flows in this wire, it is detected by the
current sensor and microcontroller sends and alert signal to the GSM module and sends SMS
alert to the concerned department regarding the faulty line and the line is disconnected
automatically. Also, buzzer alert is given in the sewage module regarding the faulty line. Float
sensor monitor the over flow of sewage water. The garbage box full is monitored by ultrasonic
sensor and intimated to corporation through message
BLOCK DIAGRAM

SEWAGE MODULE

Power supply

5V

Float Sensor GSM Alert


SMS to
concerned
department

Proximity PIC16F877A
Sensor
Micro
LCD
Controller

FIRE Sensor

Buzzer
IR sensor
HARDWARE REQUIREMENTS

1. PIC 16F877A MICROCONTROLLER


2. POWER SUPPLY 5V
3. LCD
4. FLOAT SENSOR
5. PROXIMITY SENSOR
6. FIRE SENSOR
7. IR SENSOR
8. BUZZER
9. GSM

SOFTWARE REQUIREMENTS

1. MPLAB IDE
2. HI-TECH C Compiler
3. Proteus circuit designer
4. Pickit2 Programming Software
5. Embedded C language

CIRCUIT DIAGRAM
POWER SUPPLIES
There are many types of power supply. Most are designed to convert high voltage AC mains
electricity to a suitable low voltage supply for electronics’ circuits and other devices. A power
supply can by broken down into a series of blocks, each of which performs a particular function.

For example a 5V regulated supply:

Each of the blocks is described in more detail below:

TRANSFORMER

Steps down high voltage AC mains to low voltage AC.


Transformers convert AC electricity from one voltage to another with little loss of power.
Transformers work only with AC and this is one of the reasons why mains electricity is AC.

Step-up transformers increase voltage, step-down transformers reduce voltage. Most power
supplies use a step-down transformer to reduce the dangerously high mains voltage (230V in
UK) to a safer low voltage.

The input coil is called the primary and the output coil is called the secondary. There is no
electrical connection between the two coils, instead they are linked by an alternating magnetic
field created in the soft-iron core of the transformer. The two lines in the middle of the circuit
symbol represent the core.

Transformers waste very little power so the power out is (almost) equal to the power in. Note
that as voltage is stepped down current is stepped up.

The ratio of the number of turns on each coil, called the turn’s ratio, determines the ratio of the
voltages. A step-down transformer has a large number of turns on its primary (input) coil which
is connected to the high voltage mains supply, and a small number of turns on its secondary
(output) coil to give a low output voltage.

Transformer
circuit symbol

turns ratio = Vp = Np and power out = power in


Vs Ns Vs × Is = Vp × Ip
Vp = primary (input) voltage Vs = secondary (output) voltage
Np = number of turns on primary coil Ns = number of turns on secondary coil
Ip = primary (input) current Is = secondary (output) current

RECTIFIER
Converts AC to DC, but the DC output is varying.

There are several ways of connecting diodes to make a rectifier to convert AC to DC. The bridge
rectifier is the most important and it produces full-wave varying DC. A full-wave rectifier can
also be made from just two diodes if a centre-tap transformer is used, but this method is rarely
used now that diodes are cheaper. A single diode can be used as a rectifier but it only uses the
positive (+) parts of the AC wave to produce half-wave varying DC.

SINGLE DIODE RECTIFIER

A single diode can be used as a rectifier but this produces half-wave varying DC which has gaps
when the AC is negative. It is hard to smooth this sufficiently well to supply electronic circuits
unless they require a very small current so the smoothing capacitor does not significantly
discharge during the gaps. Please see the Diodes page for some examples of rectifier diodes.

Output: half-wave varying DC


Single diode rectifier
(using only half the AC wave)

BRIDGE RECTIFIER

A bridge rectifier can be made using four individual diodes, but it is also available in special packages
containing the four diodes required. It is called a full-wave rectifier because it uses all the AC wave (both
positive and negative sections). 1.4V is used up in the bridge rectifier because each diode uses 0.7V
when conducting and there are always two diodes conducting, as shown in the diagram below. Bridge
rectifiers are rated by the maximum current they can pass and the maximum reverse voltage they can
withstand (this must be at least three times the supply RMS voltage so the rectifier can withstand the
peak voltages). Please see the Diodes page for more details, including pictures of bridge rectifiers.

Bridge rectifier Output: full-wave varying DC


(using all the AC wave)

SMOOTHING (FILTER)

Smoothing is performed by a large value electrolytic capacitor connected across the DC supply
to act as a reservoir, supplying current to the output when the varying DC voltage from the
rectifier is falling. The diagram shows the unsmoothed varying DC (dotted line) and the
smoothed DC (solid line). The capacitor charges quickly near the peak of the varying DC, and
then discharges as it supplies current to the output.
Note that smoothing significantly increases the average DC voltage to almost the peak value
(1.4 × RMS value). For example 6V RMS AC is rectified to full wave DC of about 4.6V RMS
(1.4V is lost in the bridge rectifier), with smoothing this increases to almost the peak value
giving 1.4 × 4.6 = 6.4V smooth DC.

Smoothing is not perfect due to the capacitor voltage falling a little as it discharges, giving a
small ripple voltage. For many circuits a ripple which is 10% of the supply voltage is
satisfactory and the equation below gives the required value for the smoothing capacitor. A larger
capacitor will give fewer ripples. The capacitor value must be doubled when smoothing half-
wave DC.

5 × Io
Smoothing capacitor for 10% ripple, C =
Vs × f

C = smoothing capacitance in farads (F)


Io = output current from the supply in amps (A)
Vs = supply voltage in volts (V), this is the peak value of the unsmoothed DC
f = frequency of the AC supply in hertz (Hz), 50Hz in the UK
REGULATOR

Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or variable output
voltages. They are also rated by the maximum current they can pass. Negative VO

To make things really simple let’s start with a simple power supply and it is also the one they
usually give you in your first electronics project. Well the reason is quite obvious because all
electronics circuits require a DC power supply to work. You really do plug in the wires of your
electronic items in AC mains supply but they do have AC to DC converters too provide DC to
the circuits. All this is done with a power supply in the right place.

Pin diagram for 7805

 1. Unregulated voltage in
 2. Ground

 3. Regulated voltage out

Voltage regulator
This circuit is a small +5V power supply. The circuit will provide a regulated voltage to the
external circuit which may also I am required in any part of the external circuit or the whole
external circuit. The best part is that you can also use it to convert AC voltage to DC and then
regulate it ,simply You need a transformer to make the AC main drop down to a safe value i.e 12-
15 volts and then us a rectifier to convert AC into DC.

This circuit can give +5V output at about 150 mA current, but it can be increased to 1 A when
good cooling is added to 7805 regulator chip. The circuit has over overload and terminal
protection. The capacitors must have enough high voltage rating to safely handle the input
voltage feed to circuit. The circuit is very easy to build for example into a piece of overboard.

If you need other voltages than +5V, you can modify the circuit by replacing the 7805 chips with
another regulator with different output voltage from regulator 78xx chip family. The last numbers
in the chip code tells the output voltage. Remember that the input voltage must be at least 3V
greater than regulator output voltage to otherwise the regulator does not work well. Don’t forget
to check the pin diagram before connecting the IC.

TRANSFORMER ONLY

The low voltage AC output is suitable for lamps, heaters and special AC motors. It is not
suitable for electronic circuits unless they include a rectifier and a smoothing capacitor.

TRANSFORMER + RECTIFIER

The varying DC output is suitable for lamps, heaters and standard motors. It is not suitable for
electronic circuits unless they include a smoothing capacitor.
TRANSFORMER + RECTIFIER + SMOOTHING (FILTER)

The smooth DC output has a small ripple. It is suitable for most electronic circuits.

TRANSFORMER + RECTIFIER + SMOOTHING +


REGULATOR

The regulated DC output is very smooth with no ripple. It is suitable for all electronic circuits.

Circuit Diagram:
Circuit Description:

The 230/240VAC line voltage is applied to the transformer primary. Step down transformer is
used to convert 230VAC to 12V/1A output voltage in the transformer secondary. This 12VAC
supply is applied to the bridge rectifier. The bridge rectifier voltage rating should be double the
Vrms of secondary AC and higher forward current rating. The bridge rectifier has four diodes in
that, available as singular. This is the most important and it produces full-wave varying DC or
pulsating DC. This rectified output is smoothed by using shunt capacitor filter (C1). The larger
the filter capacitor lowers the ripple. The larger capacitor C1 across the input bypasses AC
ripples to ground. The pure DC output reaches the regulator IC. The 7805 Voltage regulator IC
(U1) gives 5V /1A regulated output. The capacitor (C2) across the output improves transient
response. Low power red LED is used in the output for power indication. It has voltage drop of
1.8V and gives brightness at 20 mA. This is done by current limiting resistor (R1).

R = (Vout – Vf) / I

Where, Vout –output voltage; Vf- led voltage drop; I- led forward current.

From this we get R as 160E. We use the standard value of 220E. The higher value of limiting
resistor gives low brightness but longer life time. So, here 470E is used.
PIC MICROCONTROLLER

PIC is a family of Harvard architecture microcontrollers made by Microchip Technology, derived


from the PIC1650 originally developed by General Instrument's Microelectronics Division. The
name PIC initially referred to "Peripheral Interface Controller".

PICs are popular with both industrial developers and hobbyists alike due to their low cost, wide
availability, large user base, extensive collection of application notes, availability of low cost or
free development tools, and serial programming (and re-programming with flash memory)
capability.

HIGH-PERFORMANCE RISC CPU:

 Only 35-75 single-word instructions to learn


 All single-cycle instructions except for program branches, which are two-cycle
 Operating speed: DC – 20 MHz clock input
 DC – 200 ns instruction cycle
 Up to 8K x 14 words of Flash Program Memory,
 Up to 368 x 8 bytes of Data Memory (RAM),
 Up to 256 x 8 bytes of EEPROM Data Memory
 Pin out compatible to other 14-pin PIC16FXXX microcontrollers

PERIPHERAL FEATURES:

 Timer0: 8-bit timer/counter with 8-bit prescaler


 Timer1: 16-bit timer/counter with prescaler, can be incremented during Sleep via
external crystal/clock
 Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
 Two Capture, Compare, PWM modules
 Capture is 16-bit, max. Resolution is 12.5 ns
 Compare is 16-bit, max. Resolution is 200 ns
 PWM max. Resolution is 10-bit
 Synchronous Serial Port (SSP) with SPI™ (Master mode) and I2C™
(Master/Slave)
 Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with
9-bit address detection
 Parallel Slave Port (PSP) – 8 bits wide with external RD, WR and CS controls
(14-pin only)
 Brown-out detection circuitry for Brown-out Reset (BOR)

ANALOG FEATURES:

 10-bit, up to 8-channel Analog-to-Digital Converter (A/D)


 Brown-out Reset (BOR)
 Analog Comparator module with:
- Two analog comparators
- Programmable on-chip voltage reference (VREF) module
- Programmable input multiplexing from device inputs and internal voltage
reference
- Comparator outputs are externally accessible

SPECIAL MICROCONTROLLER FEATURES:

 100,000 erase/write cycle Enhanced Flash program memory typical


 1,000,000 erase/write cycle Data EEPROM memory typical
 Data EEPROM Retention > 40 years
 Self-reprogrammable under software control
 In-Circuit Serial Programming™ (ICSP™) via two pins
 Single-supply 5V In-Circuit Serial Programming
 Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation
 Programmable code protection
 Power saving Sleep mode
 Selectable oscillator options
 In-Circuit Debug (ICD) via two pins

CMOS TECHNOLOGY:

 Low-power, high-speed Flash/EEPROM technology


 Fully static design
 Wide operating voltage range (2.0V to 5.5V)
 Commercial and Industrial temperature ranges
 Low-power consumption

PIN DIAGRAMS

DEVICE OVERVIEW
This document contains device specific information for the PIC16F630/676. Additional
information may be found in the PIC® Mid-Range Reference Manual (DS33023), which may be
obtained from your local Microchip Sales Representative or downloaded from the Microchip
web site. The Reference Manual should be considered a complementary document to this Data
Sheet and is highly recommended reading for a better understanding of the device architecture
and operation of the peripheral modules. The PIC16F630 and PIC16F676 devices are covered by
this Data Sheet. They are identical, except the PIC16F676 has a 10-bit A/D converter. They come
in 14-pin PDIP, SOIC and TSSOP packages. Figure shows a block diagram of the
PIC16F630/676 devices. Table shows the pin out description.

PIC16F877A DEVICE FEATURES


Key Features PIC16F877A
Operating Frequency DC – 20 MHz
Resets (and Delays) POR, BOR
(PWRT, OST)
Flash Program Memory 8K
(14-bit words)
Data Memory (bytes) 368
EEPROM Data Memory (bytes) 256
Interrupts 15
I/O Ports Ports A, C
Timers 2
Capture/Compare/PWM modules 1
Serial Communications MSSP, USART
Parallel Communications PSP
10-bit Analog-to-Digital Module 4 input channels
Analog Comparators 2
Instruction Set 35 Instructions
Packages 14-pin PDIP
PIC16F877A BLOCK DIAGRAM
PIC16F877A PINOUT DESCRIPTION
PORT-A (PIN OUT IS 11 TO 13 & 4 TO 2)

Each PORTA pin is multiplexed with other functions. The pins and their combined functions are
briefly described here. For specific information about individual functions such as the
comparator or the A/D, refer to the appropriate section in this Data Sheet.

RA0/AN0/CIN+

The RA0 pin is configurable to function as one of the following:

• A general purpose I/O

• An analog input for the A/D (PIC16F676 only)

• An analog input to the comparator

RA1/AN1/CIN-/VREF

The RA1 pin is configurable to function as one of the following:

• As a general purpose I/O

• An analog input for the A/D (PIC16F676 only)

• An analog input to the comparator

• A voltage reference input for the A/D (PIC16F676 only)

RA2/AN2/T0CKI/INT/COUT

The RA2 pin is configurable to function as one of the following:

• A general purpose I/O

• An analog input for the A/D (PIC16F676 only)

• A digital output from the comparator

• The clock input for TMR0

• An external edge triggered interrupt


RA3/MCLR/VPP

The RA3 pin is configurable to function as one of the following:

• A general purpose input

• As Master Clear Reset

RA4/AN3/T1G/OSC2/CLKOUT

The RA4 pin is configurable to function as one of the following:

• A general purpose I/O

• An analog input for the A/D (PIC16F676 only)

• A TMR1 gate input

• A crystal/resonator connection

• A clock output

RA5/T1CKI/OSC1/CLKIN

The RA5 pin is configurable to function as one of the following:

• A general purpose I/O

• A TMR1 clock input

• A crystal/resonator connection

• A clock input

PORT C (PIN OUT IS 10 TO 8 & 7 TO 5)

The RC0/RC1/RC2/RC3 pins are configurable to function as one of the following:

• A general purpose I/O

• An analog input for the A/D Converter (PIC16F676 only)


RC4 AND RC5

The RC4 and RC5 pins are configurable to function as a general purpose I/Os.

MEMORY ORGANIZATION

The PIC16F630/676 devices have a 13-bit program counter capable of addressing


an 8K x 14 program memory space. Only the first 1K x 14 (0000h-03FFh) for the
PIC16F630/676 devices is physically implemented. Accessing a location above
these boundaries will cause a wrap around within the first 1K x 14 space. The
Reset vector is at 0000h and the interrupt vector is at 0004h.

Data Memory Organization

The data memory is partitioned into two banks, which contain the General Purpose Registers and
the Special Function Registers. The Special Function Registers are located in the first 32
locations of each bank. Register locations 20h-5Fh are General Purpose Registers, implemented
as static RAM and are mapped across both banks. All other RAM is unimplemented and returns
‘0’ when read. RP0 (STATUS<5>) is the bank select bit.

• RP0 = 0 Bank 0 is selected

• RP0 = 1 Bank 1 is selected

PIC16F630/676 PROGRAM MEMORY MAP AND STACK


Data Memory Organization

The data memory is partitioned into multiple banks which contain the General Purpose Registers
and the Special Function Registers. Bits RP1 (Status<6>) and RP0 (Status<5>) are the bank
select bits.

RP1:RP0 Bank
00 0
01 1
10 2
11 3

Each bank extends up to 7Fh (128 bytes). The lower locations of each bank are reserved for the
Special Function Registers. Above the Special Function Registers are General Purpose Registers,
implemented as static RAM. All implemented banks contain Special Function Registers. Some
frequently used Special Function Registers from one bank may be mirrored in another bank for
code reduction and quicker access.
GENERAL PURPOSE REGISTER FILE
The register file is organized as 64 x 8 in the PIC16F630/676 devices. Each register is accessed,
either directly or indirectly, through the File Select Register FSR (see Section 2.4 “Indirect
Addressing, INDF and FSR Registers”).

SPECIAL FUNCTION REGISTERS


The Special Function Registers are registers used by the CPU and peripheral functions for
controlling the desired operation of the device (see Table 2-1). These registers are static RAM.
The special registers can be classified into two sets: core and peripheral. The Special Function
Registers associated with the “core” are described in this section. Those related to the operation
of the peripheral features are described in the section of that peripheral feature.
PIC16F630/676 SPECIAL REGISTERS SUMMARY BANK 0
DATA EEPROM AND FLASH PROGRAM MEMORY

The EEPROM data memory is readable and writable during normal operation (full VDD range).
This memory is not directly mapped in the register file space. Instead, it is indirectly addressed
through the Special Function Registers. There are four SFRs used to read and write this memory:

• EECON1
• EECON2 (not a physically implemented register)
• EEDATA
• EEADR
EEDATA holds the 8-bit data for read/write, and EEADR holds the address of the EEPROM
location being accessed. PIC16F630/676 devices have 128 bytes of data EEPROM with an
address range from 0h to 7Fh.

EEADR and EEADRH


The EEADR register can address up to a maximum of 128 bytes of data EEPROM. Only seven
of the eight bits in the register (EEADR<6:0>) are required. The MSb (bit 7) is ignored.
The upper bit should always be ‘0’ to remain upward compatible with devices that have more
data EEPROM memory.

EECON1 and EECON2 Registers


EECON1 is the control register with four low order bits physically implemented. The upper four
bits are nonimplemented and read as ‘0’s. Control bits RD and WR initiate read and write,
respectively. These bits cannot be cleared, only set, in software. They are cleared in hardware at
completion of the read or write operation. The inability to clear the WR bit in software prevents
the accidental, premature termination of a write operation. The WREN bit, when set, will allow a
write operation. On power-up, the WREN bit is clear. The WRERR bit
is set when a write operation is interrupted by a MCLR Reset, or a WDT Time-out Reset during
normal operation. In these situations, following Reset, the user can check the WRERR bit, clear
it, and rewrite the location. The data and address will be cleared, therefore, the EEDATA and
EEADR registers will need to be re-initialized.
The Interrupt flag bit EEIF in the PIR1 register is set when the write is complete. This bit must
be cleared in software. EECON2 is not a physical register. Reading EECON2 will read all ‘0’s.
The EECON2 register is used exclusively in the data EEPROM write sequence.

Reading Data EEPROM Memory


To read a data memory location, the user must write the address to the EEADR register and then
set control bit RD (EECON1<0>), as shown in Example 8-1. The data is available in the very
next cycle in the EEDATA register. Therefore, it can be read in the next instruction. EEDATA
holds this value until another read, or until it is written to by the user (during a write operation).

Writing to Data EEPROM Memory


To write an EEPROM data location, the user must first write the address to the EEADR register
and the data to the EEDATA register. Then the user must follow a specific sequence to initiate the
write for each byte, as shown in Example.

TIMER0 MODULE
The Timer0 module timer/counter has the following features:
• 8-bit timer/counter
• Readable and writable
• 8-bit software programmable pre scaler
• Internal or external clock select
• Interrupt on overflow from FFh to 00h
• Edge select for external clock

TIMER1 MODULE
The PIC16F630/676 devices have a 16-bit timer. Figure shows the basic block diagram of the
Timer1 module. Timer1 has the following features:
• 16-bit timer/counter (TMR1H:TMR1L)
• Readable and writable
• Internal or external clock selection
• Synchronous or asynchronous operation
• Interrupt on overflow from FFFFh to 0000h
• Wake-up upon overflow (Asynchronous mode)
• Optional external enable input (T1G)
• Optional LP oscillator
LCD

A liquid crystal display (LCD) is a flat panel display, electronic visual display, or video display
that uses the light modulating properties of liquid crystals (LCs). LCs does not emit light
directly.

They are used in a wide range of applications, including computer monitors, television,
instrument panels, aircraft cockpit displays, signage, etc. They are common in consumer devices
such as video players, gaming devices, clocks, watches, calculators, and telephones. LCDs have
replaced cathode ray tube (CRT) displays in most applications. They are available in a wider
range of screen sizes than CRT and plasma displays, and since they do not use phosphors, they
cannot suffer image burn-in. LCDs are, however, susceptible to image persistence.

LCDs are more energy efficient and offer safer disposal than CRTs. Its low electrical power
consumption enables it to be used in battery-powered electronic equipment. It is an electronically
modulated optical device made up of any number of segments filled with liquid crystals and
arrayed in front of a light source (backlight) or reflector to produce images in color or
monochrome. The most flexible ones use an array of small pixels. The earliest discovery leading
to the development of LCD technology, the discovery of liquid crystals, dates from 1888. By
2008, worldwide sales of televisions with LCD screens had surpassed the sale of CRT units.

Illumination

As LCD panels produce no light of their own, they require an external lighting mechanism to be
easily visible. On most displays, this consists of a cold cathode fluorescent lamp that is situated
behind the LCD panel. For battery-operated units (e.g. laptops) this requires an inverter to
convert DC to AC. Passive-matrix displays are usually not backlit, but active-matrix displays
almost always are, with a few exceptions such as the display in the original Game boy Advance.

Recently, two types of LED backlit displays have appeared in some televisions as an alternative
to conventional backlit LCDs. In one scheme, the LEDs are used to backlight the entire LCD
panel. In another scheme, a set of red, green and blue LEDs is used to illuminate a small cluster
of pixels, which can improve contrast and black level in some situations. For example, the LEDs
in one section of the screen can be dimmed to produce a dark section of the image while the
LEDs in another section are kept bright. Both schemes also allow for a slimmer panel than on
conventional displays.

Passive-matrix and active-matrix addressed LCDs

Monochrome passive-matrix LCDs were standard in most early laptops (although a few used
plasma displays) and the original Nintendo Game Boy[25] until the mid-1990s, when color
active-matrix became standard on all laptops. The commercially unsuccessful Macintosh ortable
(released in 1989) was one of the first to use an active-matrix display (though still monochrome).

Passive-matrix LCDs are still used today for applications less demanding than laptops and TVs.
In particular, portable devices with less information content to be displayed, where lowest power
consumption (no backlight), low cost and/or readability in direct sunlight are needed, use this
type of display.

Displays having a passive-matrix structure are employing super-twisted nematic STN or double-
layer STN (DSTN) technology (the latter of which addresses a color-shifting problem with the
former), and color-STN (CSTN) in which color is added by using an internal filter.

STN LCDs have been optimized for passive-matrix addressing. They exhibit a sharper threshold
of the contrast-vs-voltage characteristic than the original TN LCDs. This is important, because
pixels are subjected to partial voltages even while not selected. Crosstalk between activated and
non-activated pixels has to be handled properly by keeping the RMS voltage of non-activated
pixels below the threshold voltage,[26] while activated pixels are subjected to voltages above
threshold. STN LCDs have to be continuously refreshed by alternating pulsed voltages of one
polarity during one frame and pulses of opposite polarity during the next frame. Individual pixels
are addressed by the corresponding row and column circuits. This type of display is called
passive-matrix addressed, because the pixel must retain its state between refreshes without the
benefit of a steady electrical charge. As the number of pixels (and, correspondingly, columns and
rows) increases, this type of display becomes less feasible. Slow response times and poor
contrast are typical of passive-matrix addressed LCDs with too many pixels.

New zero-power (bi-stable) LCDs do not require continuous refreshing. Rewriting is only
required for picture information changes. Potentially, passive-matrix addressing can be used with
these new devices, if their write/erase characteristics are suitable.

High-resolution color displays, such as modern LCD computer monitors and televisions, use an
active matrix structure. A matrix of thin-film transistors (TFTs) is added to the electrodes in
contact with the LC layer. Each pixel has its own dedicated transistor, allowing each column line
to access one pixel. When a row line is selected, all of the column lines are connected to a row of
pixels and voltages corresponding to the picture information are driven onto all of the column
lines. The row line is then deactivated and the next row line is selected. All of the row lines are
selected in sequence during a refresh operation. Active-matrix addressed displays look "brighter"
and "sharper" than passive-matrix addressed displays of the same size, and generally have
quicker response times, producing much better images.

The DV-16100-S2FBLY, dot-matrix LCD unit of a 5 x 7- dot 16-character 1-line dot-matrix LCD
panel, LCD driver, controller LSI and yellow green backlight LED fabricated on a single PCB.
Incorporating mask ROM-based character generator and display data RAM in the controller LSI,
the unit can efficiently display the desired characters under microprocessor control.

General
The LCD of the unit is STN (Super Twisted Nematic) Gray, Transflective type.

Low power consumption with the dot-matrix LCD panel and CMOS LSI. Built-in backlight
LED with high luminance and stable radiation.

Thin, lightweight design permits easy installation in a variety of equipment.

Allowing for being connected at general-purpose CMOS signal level, the unit can be easily
interfaced to a microprocessor with common 4-bit and 8-bit parallel inputs and outputs.

Multiplexing driving: 1/16duty, 1/4bias, 6 o’clock

Built-in character generator ROM and RAM, and display data RAM:

Character generator ROM 225 different 5 x 7 dot-matrix character patterns (Alphanumeric and
symbols)

Character generator RAM 8 different user programmed 5 x 7 dot-matrix patterns

Display data RAM 80 x 8 bits

Numerous instructions Display clear, Cursor home, Display ON/OFF, Cursor ON/OFF, Blink
character, Cursor shift, Display shift

The unit operates from a single 5V power supply

PIN DESCRIPTION

NUMBER SYMBOL FUNCATION


1 VSS 0V Power Supply (GND Level)
2 VCC Power supply for Logic circuit
3 V0 Power Supply for Driving the LCD
4 RS Data / Instruction select
5 R/W Read / Write select
6 EN Enable signal
7-14 DB0-DB7 Data Bus line
15 LED A Power supply for LED
16 LED K Power supply for LED
LEVEL SENSOR
GENERAL DESCRIPTION

Level sensors detect the level of liquids and other fluids and powders that exhibit an upper free
surface. Substances that flow become essentially horizontal in their containers (or other physical
boundaries) because of gravity whereas most bulk solids pile at an angle of repose to a peak.
There are many physical and application variables that affect the selection of the optimal level
monitoring method for industrial and commercial processes. The selection criteria include the
physical: phase (liquid, solid or slurry), temperature, pressure or vacuum, chemistry, dielectric
constant of medium, density (specific gravity) of medium, agitation (action), acoustical or
electrical noise, vibration, mechanical shock, tank or bin size and shape.

PRODUCT DESCRIPTION

Level sensors detect the level of substances that flow, including liquids, Slurries, granular
materials, and powders. The substance to be measured can be inside a container or can be in its
natural form. The level measurement can be either continuous or point values. Continuous level
sensors measure level within a specified range and determine the exact amount of substance in a
certain place. While point-level sensors only indicate whether the substance is above or below
the sensing point generally the latter detect levels that are excessively high or low. Selection of
an appropriate type of sensor suiting to the application requirement is very important.
FEATURES

 Input voltage: 5v

 Output: Analog.

 Output voltage: 0-3v

 Level detecting range: 0 to .2m.

 Level is determined with the resistance.

APPLICATIONS

 Movable arm.

 Air ball.
PROXIMITY SENSOR

GENERAL DESCRIPTION

Proximity Sensors using high-frequency oscillation to detect ferrous and non-ferrous metal objects and in
capacitive models to detect non-metal objects. Models are available with environment resistance; heat
resistance, resistance to chemicals, and resistance to water Proximity Sensors convert information on the
movement or presence of an object into an electrical signal. Inductive Proximity Sensors detect magnetic
loss due to eddy currents that are generated on a conductive surface by an external magnetic field. An AC
magnetic field is generated on the detection coil, and changes in the impedance due to eddy currents
generated on a metallic object are detected.

PRODUCT DESCRIPTION

A proximity sensor is a sensor able to detect the presence of nearby objects without any physical contact.
A proximity sensor often emits an electromagnetic field and looks for changes in the field. The object
being sensed is often referred to as the proximity sensor's target. The maximum distance that this sensor
can detect is defined nominal range. A proximity sensor measures current flow between the sensing
electrode and the target provides readouts in appropriate engineering units. Proximity sensors can have a
high reliability and long functional life because of the absence of mechanical parts and lack of physical
contact between sensor and the sensed object.
FEATURES

 Digital output is standard.

 Analog output is available.

 Operating voltage: 5VDC

 Operating current: 300mA

 Sensing range: 0.5mm to 70mm

APPLICATIONS

 A proximity sensor adjusted to a very short range is often used as a touch switch.

 Vibration measurements of rotating shafts in machinery

 Sheets break sensing in paper machine.

 Detection of weapons such as knives and guns, especially in airport security and other security
systems.
IR SENSOR
Infrared (IR) light is electromagnetic radiation with a wavelength longer than that of visible
light, measured from the nominal edge of visible red light at 0.74 micrometers (µm), and
extending conventionally to 300 µm. These wavelengths correspond to a frequency range of
approximately 1 to 400 THz, and include most of the thermal radiation emitted by objects near
room temperature. Microscopically, IR light is typically emitted or absorbed by molecules when
they change their rotational-vibration movements.

Infrared light is used in industrial, scientific, and medical applications. Night-vision devices
using infrared illumination allow people or animals to be observed without the observer being
detected. In astronomy, imaging at infrared wavelengths allows observation of objects obscured
by interstellar dust. Infrared imaging cameras are used to detect heat loss in insulated systems,
observe changing blood flow in the skin, and overheating of electrical apparatus.

An infrared sensor is an electronic device that emits and/or detects infrared radiation in order to
sense some aspect of its surroundings. Infrared sensors can measure the heat of an object, as well
as detect motion. Many of these types of sensors only measure infrared radiation, rather than
emitting it, and thus are known as passive infrared (PIR) sensors.

All objects emit some form of thermal radiation, usually in the infrared spectrum. This radiation
is invisible to our eyes, but can be detected by an infrared sensor that accepts and interprets it. In
a typical infrared sensor like a motion detector, radiation enters the front and reaches the sensor
itself at the center of the device. This part may be composed of more than one individual sensor,
each of them being made from pyroelectric materials, whether natural or artificial. These are
materials that generate an electrical voltage when heated or cooled.

These pyroelectric materials are integrated into a small circuit board. They are wired in such a
way so that when the sensor detects an increase in the heat of a small part of its field of view, it
will trigger the motion detector's alarm. It is very common for an infrared sensor to be integrated
into motion detectors like those used as part of a residential or commercial security system.

Most motion detectors are fitted with a special type of lens, called a Fresnel lens, on the sensor
face. A set of these lenses on a motion detector can focus light from many directions, giving the
sensor a view of the whole area. Instead of Fresnel lenses, some motion detectors are fitted with
small parabolic mirrors which serve the same purpose.

An infrared sensor can be thought of as a camera that briefly remembers how an area's infrared
radiation appears. A sudden change in one area of the field of view, especially one that moves,
will change the way electricity goes from the pyroelectric materials through the rest of the
circuit. This will trigger the motion detector to activate an alarm. If the whole field of view
changes temperature, this will not trigger the device. This makes it so that sudden flashes of light
and natural changes in temperature do not activate the sensor and cause false alarms.

Infrared motion detectors used in residential security systems are also desensitized somewhat,
with the goal of preventing false alarms. Typically, a motion detector like these will not register
movement by any object weighing less than 40 pounds (18 kg). With this modification,
household pets will be able to move freely around the house without their owners needing to
worry about a false alarm. For households with large pets, sensors with an 80-pound (36 kg)
allowance are also made.

Object Detection using IR light

It is the same principle in ALL Infra-Red proximity sensors. The basic idea is to send infra red
light through IR-LEDs, which is then reflected by any object in front of the sensor.

Then all you have to do is to pick-up the reflected IR light. For detecting the reflected IR light,
we are going to use a very original technique: we are going to use another IR-LED, to detect the
IR light that was emitted from another led off the exact same type!

This is an electrical property of Light Emitting Diodes (LEDs) which is the fact that a led
produces a voltage difference across its leads when it is subjected to light. As if it was a photo-
cell, but with much lower output current. In other words, the voltage generated by the led’s can't
be - in any way - used to generate electrical power from light, it can barely be detected. That’s
why as you will notice in the schematic, we are going to use a Op-Amp (operational Amplifier)
to accurately detect very small voltage changes.

Components positioning:

The correct positioning of the sender LED, the receiver LED with regard to each other and to the
Op-Amp can also increase the performance of the sensor. First, we need to adjust the position of
the sender LED with respect to the receiver LED, in such a way they are as near as possible to
each others , while preventing any IR light to be picked up by the receiver LED before it hit and
object and returns back. The easiest way to do that is to put the sender(s) LED(s) from one side
of the PCB, and the receiver LED from the other side, as shown in the 3D model below.

This 3D model shows the position of the LEDs. The green plate is the PCB holding the
electronic components of the sensor. You can notice that the receiver LED is positioned under the
PCB, this way, there won’t be ambient light falling directly on it, as ambient light usually comes
from the top.
It is also clear that this way of positioning the LEDs prevent the emitted IR light to be detected
before hitting an eventual obstacle.

Another important issue about components positioning, is the distance between the receiver LED
and the Op-Amp. Which should be as small as possible? Generally speaking, the length of wires
or PCB tracks before an amplifier should be reduced, otherwise, the amplifier will amplify -
along with the original signal - a lot of noise picked up from the electromagnetic waves traveling
the surrounding.

Here is an example PCB where the distance between the LED and the Op-Amp is shown. Sure
this distance is not as critical as you may think, it can be up to 35mm without causing serious
problems, but trying to reduce this distance will Always give you better results.

Actually, when I design the PCB, I start by placing the receiver LED and the Op-Amp, as near to
each others as possible, and then continue the rest of the design.
GSM- GLOBAL SYSTEM FOR MOBILE COMMUNICATION

Introduction

GSM (Global System for Mobile communications) is the most popular standard for mobile
phones in the world. Its promoter, the GSM Association, estimates that 80% of the global mobile
market uses the standard. GSM is used by over 3billion people across more than 212 countries
and territories. Its ubiquity makes international roaming very common between mobile phone
operators, enabling subscribers to use their phones in many parts of the world. GSM differs from
its predecessors in that both signaling and speech channels are digital, and thus is considered a
second generation (2G) mobile phone system

GSM services and features

1. Telephonic services:

It includes emergency calls and fax related services.

Supplementary ISDN services:

These are digital in nature and includes call diversion and call identification. It also includes
SMS, which allows GSM subscribers and base station to transmit alphanumeric pages of limited
length.

Subscriber Identity Module:

One of the key features of GSM is the Subscriber Identity Module (SIM), commonly known as a
SIM card. The SIM is a detachable smart card containing the user's subscription information and
phone book. This allows the user to retain his or her information after switching handsets.
Alternatively, the user can also change operators while retaining the handset simply by changing
the SIM. Some operators will block this by allowing the phone to use only a single SIM, or only
a SIM issued by them; this practice is known as SIM locking, and is illegal in some countries.
GSM Security:

GSM was designed with a moderate level of security. Communications between the subscriber
and the base station can beencrypted.GSM uses several cryptographic algorithms for security.
TheA5/1andA5/2 stream ciphers are used for ensuring over-the-air voice privacy.

Voice Codec’s:

GSM has used a variety of voice codec’s to squeeze 3.1 kHz audio into between 5.6 and 13
Kbit/s. Originally, two codec’s, named after the types of data channel they were allocated, were
used, called Half Rate (5.6 Kbit/s) and Full Rate(13 Kbit/s). These used a system based upon
linear predictive coding (LPC). In addition to being efficient with bitrates, these codec’s also
made it easier to identify more important parts of the audio, allowing the air interface layer to
prioritize and better protect these parts of the signal.

GSM Frequencies:

GSM networks operate in a number of different frequency ranges.

a.)Most2GGSM networks operate in the 900 MHz or 1800 MHz bands.

b.)The rarer 400 and 450 MHz frequency bands are assigned in some countries where these
frequencies were previously used for first-generation systems.

c.)Most3GGSM networks in Europe operate in the 2100 MHz frequency band.

d.)GSM-900 uses 890–915 MHz to send information from the mobile station to the base station
(uplink) and 935–960 MHz for the other direction (downlink), providing 124 RF channels
(channel numbers 1 to 124) spaced at 200 kHz. Duplex spacing of 45 MHz is used.

GSM Architecture

1. BSS {Base Station Subsystem}:

The base station subsystem (BSS) is the section of a traditional cellular telephone network
which is responsible for handling traffic and signaling between a mobile phone and the network
switching subsystem. The BSS carries out transcoding of speech channels, allocation of radio
channels to mobile phones, paging, quality management of transmission and reception over the
air interface and many other tasks related to the radio network. It also provides and manage radio
transmission path between mobile station and mobile switching station.

BSC {Base Station Controller}:

The base station controller (BSC) provides, classically, the Intelligence behind the BTS’s.
Typically a BSC has tens or even hundreds of BTSs under its control. The BSC handles
allocation of radio channels, receives measurements from the mobile phones, controls handovers
from BTS to BTS (except in the case of an inter-BSC handover in which case control is in part
the responsibility of the anchor MSC). A key function of the BSC is to act as a concentrator
where many different low capacity connections to BTSs (with relatively low utilization) become
reduced to a smaller number of connections towards the mobile switching center (MSC) (with a
high level of utilization).A BSC is often based on a distributed computing architecture, with
redundancy applied to critical functional units to ensure availability in the event of fault
conditions. BSC controls the BTS and handoff management.

BTS {Base Transceiver Station}:

Its function is encryption channel selection, allocation and deal location. It also does monitoring
of radio channels whether busy or idles in status. The base transceiver station, or BTS, contains
the equipment for transmitting and receiving of radio signals (transceivers), antennas, and
equipment for encrypting and decrypting communications with the base station controller (BSC).
A BTS is controlled by a parent BSC via the base station control function (BCF). The BCF
provides an operations and maintenance (O&M) connection to the network management system
(NMS), and manages operational states of each TRX, as well as software handling and alarm
collection. Frequency hopping is often used to increase overall BTS performance; this involves
the rapid switching of voice traffic between TRXs in a sector. A hopping sequence is followed by
the TRXs and handsets using the sector.

Transcoder:
The transcoder is responsible for transcoding the voice channel coding between the coding used
in the mobile network, and the coding used by the world's terrestrial circuit-switched network,
the Public Switched Telephone Network.

ABIS Interface:

The interface between the BTS and BSC. Generally carried by a DS-1, ES-1, or E1 TDM circuit.
Uses TDM sub channels for traffic (TCH), LAPD protocol for BTS supervision and telecom
signaling, and carries synchronization from the BSC to the BTS and MS.

2. NSS {Network Switching Subsystem}

Network switching subsystem (NSS) is the component of a GSM system that carries out
switching functions and manages the communications between mobile phones and the Public
Switched Telephone Network (PSTN).It is owned and deployed by mobile phone operators and
allows mobile phones to communicate with each other and telephones in the wider
telecommunications network. The Network Switching Subsystem, also referred to as the GSM
core network, usually refers to the circuit-switched core network, used for traditional GSM
services such as voice calls, SMS, and circuit switched data calls.

MSC {Mobile Switching Center}:

The mobile switching center (MSC) is the primary service delivery node for GSM, responsible
for handling voice calls and SMS as well as other services (such as conference calls, FAX and
circuit switched data). The MSC sets up and releases the end-to-end connection, handles
mobility and hand-over requirements during the call and takes care of charging and real time pre-
paid account monitoring. The gateway MSC (G-MSC) is the MSC that determines which visited
MSC the subscriber who is being called is currently located. It also interfaces with the PSTN.
The visited MSC (V-MSC) is the MSC where a customer is currently located. The VLR
associated with this MSC will have the subscriber's data in it. The anchor MSC is the MSC from
which a hand over has been initiated. The target MSC is the MSC toward which a Handover
should take place. A mobile switching centre server is a part of the redesigned MSC concept
starting from3GPP Release 5.

Mobile Switching Center Server {MSS}:


The mobile switching centre server is a soft-switch variant of the mobile switching centre,
which provides circuit-switched calling, mobility management, and GSM services to the mobile
phones roaming within the area that it serves.

In NSS there are three different databases:

.HLR {Home Location Register}:

The home location register (HLR) is a central database that contains details of each mobile
phone subscriber that is authorized to use the GSM core network. There can be several logical,
and physical, HLRs per public land mobile network(PLMN), though one international mobile
subscriber identity(IMSI)/MSISDN pair can be associated with only one logical HLR(which can
span several physical nodes) at a time. The HLR stores details of every SIM card issued by the
mobile phone operator. Each SIM has a unique identifier called an IMSI which is the primary
key to each HLR record

VLR {Visitor Location Register}:

The visitor location register is a temporary database of the subscribers who have roamed into the
particular area which it serves. Each base station in the network is served by exactly one VLR;
hence a subscriber cannot be present in more than one VLR at a time. The data stored in the
VLR has either been received from the HLR, or collected from the MS. In practice, for
performance reasons, most vendors integrate the VLR directly to the V-MSC and, where this is
not done, the VLR is very tightly linked with the MSC via a proprietary interface.

AC {Authentication Center}:

The authentication centre (AC) has a function to authenticate each SIM card that attempts to
connect to the GSM core network (typically when the phone is powered on). Once the
authentication is successful, the HLR is allowed to manage the SIM and services described
above. An encryption key is also generated that is subsequently used to encrypt all wireless
communications (voice, SMS, etc.) between the mobile phone and the GSM core network. If the
authentication fails, then no services are possible from that particular combination of SIM card
and mobile phone operator attempted. The AUC does not engage directly in the authentication
process, but instead generates data known as triplets for the MSC to use during the procedure.
EIR {Equipment Identity Register}:

The equipment identity register is often integrated to the HLR. The EIR keeps a list of mobile
phones (identified by their IMEI) which are to be banned from the network or monitored. This is
designed to allow tracking of stolen mobile phones. In theory all data about all stolen mobile
phones should be distributed to all EIRs in the world through a Central EIR. The EIR data does
not have to change in real time, which means that this function can be less distributed than the
function of the HLR. The EIR is a database that contains information about the identity of the
mobile equipment that prevents calls from stolen, unauthorized or defective mobile stations.
Some EIR also have the capability to log Handset attempts and store it in a log file.

A-Interface:

The interface between BSC and MSC. It uses the SS7 protocol called the Signaling Correction
Control Protocol {SCCP} which supports communication between MSC and BSS as well as
network message between the individual subscriber and MSC.

OSS {Operation Support Subsystem}

The billing centre is responsible for processing the toll tickets generated by the VLRs and HLRs
and generating a bill for each subscriber. It is also responsible for to generate billing data of
roaming subscriber. The short message service centre supports the sending and reception of text
messages. The multimedia messaging service centre supports the sending of multimedia
messages (e.g., images, audio, video and their combinations) to (or from) MMS-enabled
Handsets. The voicemail system records and stores voicemails. It maintains all
telecommunication hardware and network operation with the particular market. Manage all
mobile equipment in the system.

ISDN: Integrated Services Digital Network is a telephone system network.

ISDN is a circuit-switched telephone network system that also provides access to packet
switched networks, designed to allow digital transmission of voice and data over ordinary
telephone copper wires, resulting in better voice quality than an analog phone. It offers circuit-
switched connections (for either voice or data), and packet-switched connections (for data), in
increments of 64 Kbit/s. Another major market application is Internet access, where ISDN
typically provides a maximum of 128 Kbit/s in both upstream and downstream directions (which
can be considered to be broadband speed, since it exceeds the narrowband speeds of standard
analog56k telephone lines). ISDN B-channels can be bonded to achieve a greater data rate;
typically 3 or 4 BRIs (6 to 8 64 Kbit/s channels) are bonded. ISDN provides simultaneous voice,
video, and text transmission between individual desktop videoconferencing systems and group
(room) videoconferencing systems.

PSTN: The public switched telephone network is the network of the world's public circuit-
switched telephone networks, in much the same way that the Internet is the network of the
world's public IP- based packet-switched networks. Originally a network of fixed-line analog
telephone systems, the PSTN is now almost entirely digital, and now includes mobile as well as
fixed telephones.

GSM Modem

This GSM Modem can accept any GSM network operator SIM card and act just like a mobile
phone with its own unique phone number. Advantage of using this modem will be that you can
use its RS232 port to communicate and develop embedded applications. Applications like SMS
Control, data transfer, remote control and logging can be developed easily. The modem can either
be connected to PC serial port directly or to any microcontroller. It can be used to send and
receive SMS or make/receive voice calls. It can also be used in GPRS mode to connect to
internet and do many applications for data logging and control. In GPRS mode you can also
connect to any remote FTP server and upload files for data logging. This GSM modem is a
highly flexible plug and play quad band GSM modem for direct and easy integration to RS232
applications. Supports features like Voice, SMS, Data/Fax, GPRS and integrated TCP/IP stack.
Applications

 SMS based Remote Control & Alerts

 Security Applications

 Sensor Monitoring

 GPRS Mode Remote Data Logging


Quick Start

 Insert SIM card: Press the yellow pin to remove the tray from the SIM
cardholder. After Properly fixing the SIM card in the tray, insert the tray in the slot
provided.
 Connect Antenna: Screw the RF antenna if not already connected.
 Connect RS232 Cable to PC/MCU: (Cable provided for RS232 communication)
Default baud rate is 115200 with 8-N-1, no hardware handshaking.
 Connect the power Supply (12V) to the power input of board. Polarity should
be Center +ve and outer –ve DC jack.
 Network Led indicating various status of GSM module eg. Power on, network
registration & GPRS connectivity.
 After the Modem registers the network, led will blink in step of 3 seconds. At this
stage you can start using Modem for your application.
 AT commands can be sent to control GSM Modem

Interfacing with microcontroller

Connect MCU TXD/RXD through MAX232 so your MCU can communicate with GSM
Modem.
SERIAL AND UART

The Universal Asynchronous Receiver/Transmitter (UART) controller is the key component of


the serial communications subsystem of a computer. The UART takes bytes of data and transmits
the individual bits in a sequential fashion. At the destination, a second UART re-assembles the
bits into complete bytes.

Serial transmission is commonly used with modems and for non-networked communication
between computers, terminals and other devices.

There are two primary forms of serial transmission: Synchronous and Asynchronous. Depending
on the modes that are supported by the hardware, the name of the communication sub-system
will usually include a A if it supports Asynchronous communications, and a S if it supports
Synchronous communications. Both forms are described below.

Some common acronyms are:

 UART Universal Asynchronous Receiver/Transmitter

 USART Universal Synchronous-Asynchronous Receiver/Transmitter

Synchronous Serial Transmission

Synchronous serial transmission requires that the sender and receiver share a clock with one
another, or that the sender provide a strobe or other timing signal so that the receiver knows
when to “read” the next bit of the data. In most forms of serial Synchronous communication, if
there is no data available at a given instant to transmit, a fill character must be sent instead so
that data is always being transmitted. Synchronous communication is usually more efficient
because only data bits are transmitted between sender and receiver, and synchronous
communication can be more costly if extra wiring and circuits are required to share a clock
signal between the sender and receiver.

A form of Synchronous transmission is used with printers and fixed disk devices in that the data
is sent on one set of wires while a clock or strobe is sent on a different wire. Printers and fixed
disk devices are not normally serial devices because most fixed disk interface standards send an
entire word of data for each clock or strobe signal by using a separate wire for each bit of the
word. In the PC industry, these are known as Parallel devices.

The standard serial communications hardware in the PC does not support Synchronous
operations. This mode is described here for comparison purposes only.

Asynchronous Serial Transmission

Asynchronous transmission allows data to be transmitted without the sender having to send a
clock signal to the receiver. Instead, the sender and receiver must agree on timing parameters in
advance and special bits are added to each word which are used to synchronize the sending and
receiving units.

When a word is given to the UART for Asynchronous transmissions, a bit called the "Start Bit" is
added to the beginning of each word that is to be transmitted. The Start Bit is used to alert the
receiver that a word of data is about to be sent, and to force the clock in the receiver into
synchronization with the clock in the transmitter. These two clocks must be accurate enough to
not have the frequency drift by more than 10% during the transmission of the remaining bits in
the word. (This requirement was set in the days of mechanical teleprinters and is easily met by
modern electronic equipment.)

After the Start Bit, the individual bits of the word of data are sent, with the Least Significant Bit
(LSB) being sent first. Each bit in the transmission is transmitted for exactly the same amount of
time as all of the other bits, and the receiver “looks” at the wire at approximately halfway
through the period assigned to each bit to determine if the bit is a 1 or a 0. For example, if it takes
two seconds to send each bit, the receiver will examine the signal to determine if it is a 1 or a 0
after one second has passed, then it will wait two seconds and then examine the value of the next
bit, and so on.

The sender does not know when the receiver has “looked” at the value of the bit. The sender only
knows when the clock says to begin transmitting the next bit of the word.
When the entire data word has been sent, the transmitter may add a Parity Bit that the transmitter
generates. The Parity Bit may be used by the receiver to perform simple error checking. Then at
least one Stop Bit is sent by the transmitter.

When the receiver has received all of the bits in the data word, it may check for the Parity Bits
(both sender and receiver must agree on whether a Parity Bit is to be used), and then the receiver
looks for a Stop Bit. If the Stop Bit does not appear when it is supposed to, the UART considers
the entire word to be garbled and will report a Framing Error to the host processor when the data
word is read. The usual cause of a Framing Error is that the sender and receiver clocks were not
running at the same speed, or that the signal was interrupted.

Regardless of whether the data was received correctly or not, the UART automatically discards
the Start, Parity and Stop bits. If the sender and receiver are configured identically, these bits are
not passed to the host.

If another word is ready for transmission, the Start Bit for the new word can be sent as soon as
the Stop Bit for the previous word has been sent.

Because asynchronous data is “self synchronizing”, if there is no data to transmit, the


transmission line can be idle.

Other UART Functions

In addition to the basic job of converting data from parallel to serial for transmission and from
serial to parallel on reception, a UART will usually provide additional circuits for signals that
can be used to indicate the state of the transmission media, and to regulate the flow of data in the
event that the remote device is not prepared to accept more data. For example, when the device
connected to the UART is a modem, the modem may report the presence of a carrier on the
phone line while the computer may be able to instruct the modem to reset itself or to not take
calls by raising or lowering one more of these extra signals. The function of each of these
additional signals is defined in the EIA RS232-C standard.
MAX232
The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to signals
suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual driver/receiver
and typically converts the RX, TX, CTS and RTS signals.

The drivers provide RS-232 voltage level outputs (approx. ± 7.5 V) from a single + 5 V supply
via on-chip charge pumps and external capacitors. This makes it useful for implementing RS-232
in devices that otherwise do not need any voltages outside the 0 V to + 5 V range, as power
supply design does not need to be made more complicated just for driving the RS-232 in this
case.

The receivers reduce RS-232 inputs (which may be as high as ± 25 V), to standard 5 V TTL
levels. These receivers have a typical threshold of 1.3 V, and a typical hysteresis of 0.5 V.

The later MAX232A is backwards compatible with the original MAX232 but may operate at
higher baud rates and can use smaller external capacitors – 0.1 μF in place of the 1.0 μF
capacitors used with the original device.

The newer MAX3232 is also backwards compatible, but operates at a broader voltage range,
from 3 to 5.5 V.

Pin to pin compatible: ICL232, ST232, ADM232, and HIN232.

Voltage levels
It is helpful to understand what occurs to the voltage levels. When a MAX232 IC receives a TTL
level to convert, it changes a TTL Logic 0 to between +3 and +15 V, and changes TTL Logic 1 to
between -3 to -15 V, and vice versa for converting from RS232 to TTL. This can be confusing
when you realize that the RS232 Data Transmission voltages at a certain logic state are opposite
from the RS232 Control Line voltages at the same logic state. To clarify the matter, see the table
below. For more information see RS-232 Voltage Levels.

Meets or Exceeds TIA/EIA-232-F and ITU Recommendation V.28


Operates From a Single 5-V Power Supply

With 1.0-uF Charge-Pump Capacitors

Operates Up To 120 Kbit/s

Two Drivers and Two Receivers

±30-V Input Levels

Low Supply Current . . . 8 mA Typical

ESD Protection Exceeds JESD 22

− 2000-V Human-Body Model (A114-A)

Upgrade with Improved ESD (15-kV HBM) and 0.1- F Charge-Pump Capacitors is Available
with the MAX202

Applications
− TIA/EIA-232-F, Battery-Powered Systems,Terminals, Modems, and Computers

MAX232 CONNECT TO MICROCONTROLLER


BUZZER
Piezo buzzer is the handy sound generator used in electronic circuits to give audio indication .It
is widely used as alarm generator in electronic devices. It is available in various types and size to
suit the requirements. A Piezo buzzer has a Piezo disc and an oscillator inside. When the buzzer
is powered, the oscillator generates a frequency around 2-4 kHz and the Piezo element vibrates
accordingly to produce the sound. An ordinary Piezo buzzer works between 3 – 12 volts DC.

WORKING OF THE PIEZO ELEMENT

Piezo element is a circular shaped metal plate with a thin coating of Piezo material. The
piezomaterial used is Lead Zirconate Titanate. This material exhibits both Direct and Indirect
piezoelectric property. Indirect piezoelectric property is the vibration of the piezoelectric crystals
in the presence of an electric field. The piezoelectric crystals also show direct piezoelectric
property in which a mechanical stress like vibration or application of heat generates around 1-2
volts in the Piezoelement. The white Piezo material coating is Positive while the rim of the
element is Negative.

Oscillator circuit inside the buzzer consists of an Inductor, a transistor, capacitors and resistors.
When the oscillator circuit gets 3-12 volt DC, The transistor, Inductor combination oscillates
which are fed to the Piezo crystals and the crystals and the plate vibrate according to the
frequency. In order to give resonance, the rim of the element is glued to a plastic case so that the
plate can vibrate freely.

WHY PIEZO BUZZER GENERATES PIERCING SOUND?

The oscillation in the Piezo buzzer is between 2 – 4 kHz. This sound is piercing because our
hearing threshold is maximum in this frequency. Buzzer uses this frequency to get easy attention
even in a highly noisy environment. Buzzers are used as alarms so this frequency is necessary.

HOW TO HANDLE PIEZO ELEMENT?

Piezo element is prone to weather changes and aging. The piezoelectric property may deteriorate
due to aging and the buzzer may fail to work. The Piezomaterial is coated as a thin film so that
during soldering, the wire along with the piezomaterial may detach. Once a portion of the Piezo
material is detached, that element cannot be used. So always use very thin wire and apply solder
only once. Over heating may damage the piezomaterial. If it is stored, use a plastic cover and
keep it in a place free from moisture and heat.

DIRECT PIEZOELECTRIC EFFECT

Mechanical vibration can generate electricity in Piezo element. Connect a high bright transparent
LED directly on the Piezoelement with correct polarity. Gently tap in the central white part of
Piezoelement. LED will blink.
GENERAL ELECTRONICS

Circuit board
Electronic components are often assembled and interconnected on a flat surface known as
a circuit board. The several types of existing circuit boards may be divided into two broad
categories: those intended for prototype or experimental circuits; and those intended for
production and/or commercial sale. Circuit boards used for experimental work are often referred
to as breadboards or protoboards. Breadboards allow engineers to construct circuits quickly, so
that they can be studied and modified until an optimal design is discovered. In a typical
breadboard use, components and wires are added to a circuit in an ad hoc manner as the design
proceeds, with new data and new understanding dictating the course of the design. Since
breadboard circuits exist only in the laboratory, no special consideration need be given to
creating reliable or simple-to-manufacture circuits - the designer can focus exclusively on the
circuit's behavior. In contrast, circuit boards intended for production or commercial sale must
have highly reliable wires and interconnects permanent bonds to all components, and
topographies amenable to mass production and thorough testing. And further, they must be made
of a material that is reliable, low-cost, and easy to manufacture. A fiberglass substrate with
copper wires (etched from laminated copper sheets) has been the PCB material of choice for the
past several decades. The Digilab board is a simple example of such a board. Note that most
often, production circuit board designs are finalized only after extensive breadboard phases.
Components are permanently affixed to production boards using the soldering process.
Production circuit boards typically start out as thin sheets of fiberglass (about 1mm thick)
that are completely covered on both sides with very thin sheets of metal (typically copper). A
"standard" circuit board might use a 1 ounce copper process, which means that one ounce of
copper is evenly spread across 1 square foot of circuit board. During the manufacturing process,
wire patterns are "printed" onto the copper surfaces using a compound that resists etching (hence
the name Printed Circuit Board or PCB). The boards are subjected to a chemical etching process
that removes all exposed copper. The remaining, un-etched copper forms wires that will
interconnect the circuit board components, and small pads that define the regions where
component leads will be attached.

In a PCB that uses through-hole technology, holes are drilled through the pads so that
component leads can be inserted and then fastened (soldered) in place. In a PCB that uses
surface-mount technology, component leads are soldered directly to the pads on the surface.
Each set of pads (or holes) in the PCB is intended to receive a particular component. To identify
which component must be loaded where, reference designators are printed on the circuit board
immediately adjacent to the pads using a silk-screen process. A parts list (Appendix A) links a
designated set of pads to a physical component by describing the component and assigning it a
particular reference designator. The reference designators guide assemblers and testers when they
are working with the PCB. Many components must be placed into the PCB in a particular
orientation. By convention, components that require a particular orientation have one lead
designated as pin 1. On the PCB, a square pad rather than the typical circular pad denotes pin 1.
On all but the simplest PCBs, wires must be printed on more than one surface of
fiberglass to allow for all the required component interconnections. Each surface containing
printed wires is called a layer. In a relatively simple PCB that requires only two layers, only one
piece of fiberglass is required since wires can be printed on both sides. In a more complex PCB
where several layers are required, individual circuit boards are manufactured separately and then
laminated together to form one multi-layer circuit board. To connect wires on two or more layers,
small holes called vias are drilled through the wires and fiberglass board at the point where the
wires on the different layers cross. The interior surface of these holes is coated with metal so that
electric current can flow through the vias. The Digilab board is a simple two-layer board; some
more complex computer circuit boards have more than 20 layers.

The unloaded PCB appears green because thin sheets of green plastic have been applied
to both sides (otherwise the PCB would appear pale yellow). Called solder masks, these sheets
cover all exposed metal other than the component pads and holes so that errant solder can't
inadvertently short (or electrically connect) the printed wires. All metal surfaces other than the
exposed pads and holes (i.e., the wires) are underneath the solder mask. Not infrequently, blue or
even red solder masks are used.

Circuit components are manufactured with exposed metal pins (or leads) that are used to
fasten them to the PCB both mechanically (so they won't fall off) and electrically (so current can
pass between them). The soldering process, which provides a strong mechanical bond and a very
good electrical connection, is used to fasten components to the PCB. During soldering,
component leads are inserted through the holes in the PCB, and then the component leads and
the through-hole plating metal are heated to above the melting point of the solder (about 500 to
700 degrees F). Solder (a metallic compound) is then melted and allowed to flow in and around
the component lead and through-hole. The solder quickly cools to form a strong bond between
the component and the PCB. The process of associating components with reference designators,
loading them into their respective holes, and then soldering them in place comprises the PCB
assembly process.

Examine the Digilab board, and note the printed wires on either side. Wires on one side
go largely "north and south" while wires on the other side go largely "east and west". The
perpendicular or Manhattan arrangement of wires on alternate layers is very common on multi-
layer PCBs. Locate some vias, and note that they connect wires on opposite sides. Locate various
components, their hole patterns, and associated reference designators. Identify pad 1 for the
various components. Note that the through-holes are somewhat larger than the vias, and that
component leads can easily be inserted into their through-holes, but not into vias.

Connectors

The Digilab board uses several connectors for various purposes, but in general, they all
communicate electronic information between the board and outside devices. By convention,
connectors are given the reference designator "J__". Since connectors come in so many different
sizes and shapes, they are usually shown on the PCB silk screen and on circuit schematics as just
rectangular boxes. In general, connectors must be placed into the PCB in a particular orientation.
Most often, the unique through-hole patterns associated with a given connector make it obvious
how it must be inserted.

Several connectors on the Digilab board allow communication with a computer.


Connector J5 is a PS/2 connector that can accept a standard PC mouse or keyboard. J9 is
standard parallel port connector that can be used to implement any parallel port protocol
(Centronics, ECP, EPP, etc.). Connector J4 is a RS-232 serial port that can use a two-signal
protocol to exchange data with a computer (e.g. XON/XOFF - only RXD and TXD are
connected). J7 is a standard 15-pin VGA connector that can be used to drive any VGA monitor.
The remaining connectors are used for on-board prototyping. J2 is a 72-pin DIP socket that
allows easy connections between the Digilab devices and the integral breadboard (see the "Using
the Digilab Board" section later in this document). J3 is a standard 1/8"stereo audio jack, and
BN1 and BN2 are standard BNC connectors, all of whose inputs are available as connections on
J2. Finally, the header strips J6, J8, J10, and J11 allow for easy connection of test and
measurement equipment.
Output LEDs

Circuits often require output devices to communicate their state to an user. Examples of
electronic output devices include computer monitors, LCD alphanumeric panels (as on a
calculator), small lamps or light-emitting diodes (LED's), etc. Outputs from the Digilab board
consist of eight individual LED's and a four-digit LED display that can display the digits 0-9 in
each digit position. As with diodes, LED's are two-terminal semiconductor devices that conduct
current in only one direction (from the anode to the cathode). The small LED chips are secured
inside a plastic housing, and they emit light at a given frequency (RED, YELLOW, etc.) when a
small electric current (typically 10mA to 25mA) flows through them. On the Digilab board, only
red LEDs are used, but they are available in many colors. Since LEDs are polarised devices, they
must be placed in the circuit board with the correct orientation. As with diodes, LED cathode
terminals are identified using unique marks (see the figure below).

The LED's on the Digilab board are denoted with an "LD__" reference designator.
Applying VDD to the J2 circuit connections labelled LD1-LD8 will illuminate the LEDs. An
LED schematic symbol is shown below, together with a sketch of a physical LED and a typical
silkscreen pattern. As can be seen, the schematic symbol resembles a regular diode, but with
added arrows indicating light emission.
Note that LED components typically have the cathode side of their plastic diffusion lens
slightly flattened, and a longer cathode pin as well. When placing individual LED components
into the PCB, be sure the flattened side matches the flattened side of the silk-screen pattern.

Diodes

Diodes are constructed from the same type of silicon as transistors, but they are simpler
devices that have only two terminals. Called the anode and cathode, the two ends of the diode are
constructed of positively doped silicon (the anode) joined directly to negatively doped silicon
(the cathode). This pn-junction exhibits the unique characteristic of allowing current to flow in
only one direction (from the anode to the cathode). Diodes have a minimum threshold voltage (or
Vth, usually around 0.7V) that must be present between the anode and cathode in order for
current to flow. If the anode voltage is not at least Vth greater than the cathode voltage, no
current will flow. Likewise, if the cathode voltage is greater than the anode voltage, the diode is
said to be reverse-biased and no current will flow. In an ideal diode, if the diode voltage equals
the threshold voltage (plus a small amount), then unlimited current can flow without causing the
voltage across the diode to increase. And, if the diode is reversed-biased, no current will flow
regardless of reverse-voltage magnitude.
Diodes have many uses in electronic circuits. As examples, they are frequently employed
in power supply circuits to turn alternating current (AC) into direct current (DC), they are used to
limit the amount of over-voltage that can be applied to a given circuit node, and they are used to
force given circuit nodes to remain at or below a certain voltage. On the Digilab board, three
individual diodes are used to limit the voltages applied to the Red, Blue, and Green pins of the
VGA connector (J6) to 0.7VDC or less (VGA colour signals must lie in that voltage range to
meet relevant specifications - higher voltages would damage computer display electronics).

Note the identification methods used to mark a diode's cathode terminal: the schematic
symbol has a line at the point of the triangle; the physical diode has a dark line on the plastic
component housing; and the silk-screen pattern has both a line at the cathode end and a square
pad for the cathode lead. When loading a diode into a circuit board, make sure that the dark line
on the diode matches the line in the silk-screen pattern. Remember that since diodes allow
current to flow in only one direction, a backwards diode will cause the circuit to malfunction.

Diodes locations on the circuit board are typically denoted with a "D__" reference designator.

Integrated Circuits

The terms chip and integrated circuit refer circuits using microscopic transistors that are
all co-located on the same small piece of silicon. Chips have been designed to do all sorts of
functions, from very simple and basic logical switching functions to highly complex processing
functions. Some chips contain just a handful of transistors, while others contain several million
transistors. Some of the longest-surviving chips perform the most basic functions. These chips,
denoted with the standard part numbers "74XXX", are simple small-scale integration devices that
house small collections of logic circuits. For example, a chip known as a 7400 contains four
individual NAND gates, with each input and output available at an external pin.

As shown in the figures below, the chips themselves are much smaller than their
packages. During manufacturing, the small, fragile chips are glued (using epoxy) onto the bottom
half of the package, bond-wires are attached to the chip and to the externally available pins, and
then the top half of the chip package is permanently affixed. Smaller chips may only have a few
pins, but larger chips can have more than 500 pins. Since the chips themselves are on the order of
a centimeter on each side, very precise and delicate machines are required to mount them in their
packages.

Smaller chips are usually packaged in a "DIP" package (DIP is an acronym for Dual In-
line Package) as shown below. Typically on the order of 2.5 x 0.75cm, DIP packages are most
often made from black plastic, and they can have anywhere from 8 to 48 pins protruding in equal
numbers from either side. DIPs are used exclusively in through-hole processes. Larger chips use
many different packages - one common package, the "PLCC" (for Plastic Leaded Chip Carrier)
is shown below. Since these larger packages can have up to several hundred pins, it is often not
practical to use the relatively large leads required by through-hole packages. Thus, large chips
usually use surface mount packages, where the external pins can be smaller and more densely
packed.
Shown below is a representation of a 7400 logic IC that contains 16 transistors organised
as four 2-input NAND gates. This small chip is housed in a 14-pin DIP package that provides
pins for each of the NAND gates inputs and outputs, as well as a power and ground pin (labelled
Vdd and GND). Note the picture shows the four logic gates placed inside a DIP outline, thereby
showing both the function and pinout (or pin definition) of the IC.

On schematics and on the PCB silkscreen, chips are often shown as square boxes denoted
with a "U__" reference designator. Note that on the Digilab PCB, all the chips are loaded in
sockets. Sockets are generally used when chips may need to be replaced or upgraded (such as
older PC BIOS ROMs), or when chips are on a circuit board that might be damaged during
frequent handling (such as the Digilab board). Chips, even in their plastic packages, are quite
fragile are subject to damage from a variety of sources, including electrostatic discharge or ESD.
Placing chips in sockets allows them to easily be replaced if they do get damaged.

The Digilab board contains several different ICs. U1 is used to filter (or "clean up") the
button inputs so that they provide clean edges when pressed (more on this process, called
debouncing, later). U1 also provides additional current to drive the LED displays. U2 provides
current for the eight individual LEDs (LEDs are described later). U3 is a "Field Programmable
Gate Array" (or just FPGA) Xilinx chip that can be configured to perform virtually any
moderately-sized digital function this chip is used extensively in many labs. U4 and U5 are
small chips that provide clock sources for the Xilinx FPGA. Although not strictly necessary,
these clock chips can produce the higher frequencies that are needed in some applications. U6 is
an optional configuration ROM for the Xilinx chip, and U7 and U8 are used by the Xilinx PC-
based programming circuit. Finally, U9 converts the RS-232 voltages (-3V to -12V for a "1" and
3V to 12V for a "0") to voltages compatible with digital circuits (0V to 5V).

Capacitors
A capacitor is a two-terminal device that can store electric energy in the form of charged
particles. You can think of a capacitor as a reservoir of charge that
takes time to fill or empty. The voltage across a capacitor is
proportional to the amount of charge it is storing - since it is not
possible to instantaneously move charge to or from a capacitor, it is
not possible to instantaneously change the voltage across a
capacitor. It is this property that makes capacitors useful on the
Digilab board.

Capacitance is measured in Farads - a one Farad capacitor can store one Coloumb of
charge at one volt. For engineering on a small scale (i.e., hand-held or desk-top devices), a one
Farad capacitor stores far too much charge to be of general use (it would be like a car having a
1000 gallon gas tank). More useful capacitors are measured in micro-farads (uF) or pico-farads
(pF). The terms "milli-farad" and "nano-farad" are rarely used. Large capacitors often have their
value printed plainly on them, such as "10 uF" (for 10 microfards). Smaller capacitors, appearing
as small disks or wafers, often have their values printed on them in an encoded manner (similar
to the resistor packs discussed above). For these capacitors, a three digit number indicates the
capacitor value in pico-farads. The first two digits provides the "base" number, and the third digit
provides an exponent of 10 (so, for example, "104" printed on a capacitor indicates a capacitance
value of 10 x 10 4 or 100000 pF). Occasionally, a capacitor will only show a two digit number, in
which case that number is simply the capacitor value in pF. (To be complete, if a capacitor shows
a three digit number and the third digit is 8 or 9, then the first two digits are multiplied by .01
and .1 respectively). Often, a single letter is appended to the capacitance value - this letter
indicates the quality of the capacitor.

Capacitors are used on the Digilab board to keep the voltage supplies and some signals
stable regardless of circuit activity, and to store charge when inputs are activated in order to slow
their assertion times. Twenty-seven capacitors of three different types and values are used on the
Digilab board. The majority of the capacitors (24 out of 27) are used to decouple Digilab's
integrated circuits from the power supply. These 24 bypass capacitors are placed on the board
very close to the Vdd pins of all chips, where they can supply the short-term electrical current
needs of the chips. Without such bypass capacitors, individual chips could cause the Vdd supply
across the entire Digilab board to dip below 5V during times of heavy current demand. Nearly
every chip in every digital system uses bypass capacitors. Bypass capacitor value can be
determined if the worst-case current requirements are known (by using the formula I = C dv/dt),
but more typically, capacitors in the range 0.01uF to 0.1uF are used without regard to the actual
current requirements. The Digilab board uses 0.047uF bypass capacitors. The board also uses a
bulk bypass capacitor (C27) to provide charge storage for the entire circuit board - this large
47uF capacitor can supply the individual bypass capacitors during times of exceptional need.

Two further capacitors (C22 and C23) are used to filter high-frequency noise from two
programming signals required by the Xilinx chip. Filter capacitors are often used in such a
manner to limit the rate at which voltages on a given circuit node can change. The graphs below
indicate the time course of these signals before and after the filter capacitors are applied.
Depending on the size of the capacitor, the PCB silk screen will show either a circle or
rectangle to indicate capacitor placement (usually, smallish capacitors are shown as rectangles,
and larger capacitors as circles). Some capacitors are polarised, meaning they must be placed
into the PCB in a particular orientation (so that one terminal is never at a lower voltage than the
other). Polarised capacitors either have a dark stripe near the pin that must be kept at a higher
voltage, or a "-" near the pin that must be kept at a lower voltage. Silk-screen patterns for
polarised capacitors will also often have a "+" sign nearest the through-hole that must be kept at
a relatively higher voltage. Capacitors use a "C__" reference designator.

VALUE TYPE CODE VALUE TYPE CODE

1.5pF Ceramic 1,000pF / .001uF Ceramic / Mylar 102

3.3pF Ceramic 1,500pF / .0015uF Ceramic / Mylar 152

10pF Ceramic 2,000pF / .002uF Ceramic / Mylar 202

15pF Ceramic 2,200pF / .0022uF Ceramic / Mylar 222

20pF Ceramic 4,700pF / .0047uF Ceramic / Mylar 472

30pF Ceramic 5,000pF / .005uF Ceramic / Mylar 502

33pF Ceramic 5,600pF / .0056uF Ceramic / Mylar 562

47pF Ceramic 6,800pF / .0068uF Ceramic / Mylar 682

56pF Ceramic .01 Ceramic / Mylar 103

68pF Ceramic .015 Mylar

75pF Ceramic .02 Mylar 203

82pF Ceramic .022 Mylar 223

91pF Ceramic .033 Mylar 333

100pF Ceramic 101 .047 Mylar 473

120pF Ceramic 121 .05 Mylar 503

130pF Ceramic 131 .056 Mylar 563

150pF Ceramic 151 .068 Mylar 683


180pF Ceramic 181 .1 Mylar 104

220pF Ceramic 221 .2 Mylar 204

330pF Ceramic 331 .22 Mylar 224

470pF Ceramic 471 .33 Mylar 334

560pF Ceramic 561 .47 Mylar 474

680pF Ceramic 681 .56 Mylar 564

750pF Ceramic 751 1 Mylar 105

820pF Ceramic 821 2 Mylar 205

General Capacitance Codebreaker Information

PicoFarad (pF) NanoFarad (nF) MicroFarad (mF,uF or mfd) Capacitance Code

1000 1 or 1n 0.001 102

1500 1.5 or 1n5 0.0015 152

2200 2.2 or 2n2 0.0022 222

3300 3.3 or 3n3 0.0033 332

4700 4.7 or 4n7 0.0047 472

6800 6.8 or 6n8 0.0068 682

10000 10 or 10n 0.01 103

15000 15 or 15n 0.015 153

22000 22 or 22n 0.022 223

33000 33 or 33n 0.033 333


47000 47 or 47n 0.047 473

68000 68 or 68n 0.068 683

100000 100 or 100n 0.1 104

150000 150 or 150n 0.15 154

220000 220 or 220n 0.22 224

330000 330 or 330n 0.33 334

470000 470 or 470n 0.47 474

Resistors

Resistors are two-terminal devices that restrict, or resist, the flow of current. The larger
the resistor, the less current can flow through it for a given voltage (an equation known as Ohm's
law, V=IR, relates current, resistance, and voltage). Electrical resistance within the resistor body
is caused by the collisions of electrons in motion through the resistor. Such collisions cause
energy to be dissipated in the form of heat or light (as in a toaster or light bulb). Resistance is
measured in Ohms - a 1 Ohm resistor is relatively small, and a 100KOhm resistor is relatively
large. Resistors find many uses in electronic systems. On the Digilab board, resistors are used to
limit the current that flows into an output LED (so they don't burn too bright and destroy
themselves) and to limit the current that flows in response to a button or switch input being
activated. The Digilab board uses several different resistor values. Of course, the correct resistor
must be loaded in the correct place on the PCB.
Resistors come in many shapes and sizes, and depending on their size and construction
technology, they can dissipate differing amounts of power (the amount of power dissipated in a
resistor can be calculated using the equation P=I 2 R, where I is the current flowing through the
resistor and R is the resistance). Typically, resistors used in digital systems encounter relatively
low voltages and currents, and therefore, they can be relatively small. The Digilab resistors are
rated to dissipate 250mW of power, or 1/4 Watt. Resistors that can dissipate more than 1/4 Watt
are physically larger. For example, power resistors that can dissipate several Watts or more can
be cigar-sized or even larger. For small resistors, resistor values are "encoded" as a series of
coloured bands on the resistor body.

To determine the value of a small resistor (i.e., 1/8 Watt or 1/4 Watt), first locate the
tolerance band on one end of the resistor - it will typically be either gold (5% tolerance) or silver
(10% tolerance). The colour band at the other end of the resistor is band1. Use the table below to
find the two-digit number associated with the colors of bands 1 and 2. The band nearest the
tolerance band is the multiplier (or exponent) band - the digits associated with the first two
colour bands are multiplied by 10 raised to the power indicated by the colour of the multiplier
band. The following table associates band colors to digits and multiplier factors. Simply multiply
the two-digit value by the multiplier, and you've got the resistor value.
Resistors are manufactured with many body colors, with tan or light brown being the
most typical. The only significant resistor body colors are white and blue; these colors signify a
non-flammable or fusible resistor. Such resistors are used in circuits where overheating might
pose a safety risk.

In circuit schematics and in parts lists, resistor reference designators always begin with an
"R". You can see several rectangular white boxes with "R__" on the Digilab board silk-screen.
The schematic symbol for a resistor is shown above. Resistors are non-polarised, so they can be
placed in a PCB in any orientation.

Resistor Packs
If a circuit application requires many resistors of the same value, and if those resistors
can be located close together on a PCB, then a resistor pack can be used instead of individual
resistors. Resistors in a pack function identically to discrete resistors - they are just more
economical to work with. Several different types of resistor packs are available. Two of the more
common types, and the types used on the Digilab board, are called "bussed" packs and "isolated"
packs. All resistors in a bussed resistor pack have one lead connected to a common node, while
all resistors in an isolated pack have independent nodes.

Resistor values are also "encoded" on the pack body, but the code uses a three-digit
number instead of colors. The first two digits are simply multiplied by 10 n , where n is the third
digit. For example, if "271" was printed on a resistor pack, the resistors inside would be 270
ohms (27 x 10 1 = 270). The three-digit number corresponding to resistor value is usually the last
number (after the last dash) printed on the resistor pack.

In circuit schematics, resistor packs are shown using the same jagged-line symbol as
discrete resistors. On PCB silk screens, they are typically shown as a narrow rectangular box.
Reference designators are usually "R__" (like discrete resistors), or "RP__". On the Digilab
board, the RP__ designator is used. Resistor packs are usually polarised, and they must be
oriented. A small black dot is located on the pack near pin 1.

The Digilab board uses several resistor packs with three different values. Two bussed
resistor packs (the 270 ohm RP1 and the 10K ohm RP2) are used by the LED circuit - the 270-
ohm resistors set the LED current (and therefore the LED brightness), and the 10K ohm resistors
ensure the LEDs remain off until they are purposely turned on. Similarly, the 270 ohm isolated
resistor packs RP7 and RP8 set the LED current for the seven-segment displays, and the 2.2K
ohm isolated resistor pack RP9 ensures that display digits remain off until expressly turned on.
The remaining packs are all 2.2K isolated packs, and are all used to debounce the buttons and
switches.

Inputs (buttons and switches)

Circuits often require inputs that come directly from users (as opposed to inputs that
come from other devices). Input devices can take many forms, among them keyboards (as on a
PC), buttons (as on a calculator or telephone), rotary dials, switches and levers, etc. The Digilab
board has twelve input devices, including four push buttons (BTN1 - BTN4) and eight slide-
switches and (SW1 - SW8).

The slide switches are also known as single throw-double pole (STDP) switches, because
only one switch (or throw) exists, but two positions (or poles) are available (a pole is an
electrical contact to which the switch can make contact). These switches can be set to output
either Vdd (when the actuator is closest to the boards edge) or GND. The push button switches
are also known as momentary contact buttons, because they only make contact while they are
actively being pressed; they output a GND at rest, and a Vdd only when they are being pressed.

Various input devices have many associated symbols and reference designators that
appear in circuit schematics. Typical symbols for a button and for a switch are shown below. The
reference designators used here are BTN_ for the buttons and S_ for the switches.

COAD
sbit LCD_RS at RE2_bit;

sbit LCD_RW at RE1_bit;

sbit LCD_EN at RE0_bit;

sbit LCD_D0 at RD0_bit;

sbit LCD_D1 at RD1_bit;

sbit LCD_D2 at RD2_bit;

sbit LCD_D3 at RD3_bit;

sbit LCD_D4 at RD4_bit;

sbit LCD_D5 at RD5_bit;

sbit LCD_D6 at RD6_bit;

sbit LCD_D7 at RD7_bit;

sbit LCD_RS_Direction at TRISE2_bit;

sbit LCD_RW_Direction at TRISE1_bit;

sbit LCD_EN_Direction at TRISE0_bit;

sbit LCD_D0_Direction at TRISD0_bit;

sbit LCD_D1_Direction at TRISD1_bit;

sbit LCD_D2_Direction at TRISD2_bit;

sbit LCD_D3_Direction at TRISD3_bit;


sbit LCD_D4_Direction at TRISD4_bit;

sbit LCD_D5_Direction at TRISD5_bit;

sbit LCD_D6_Direction at TRISD6_bit;

sbit LCD_D7_Direction at TRISD7_bit;

sbit buzzer at RC0_bit;

sbit relay at RC1_bit;

sbit motor3 at RC2_bit;

unsigned int value;

unsigned char car,x,y;

unsigned int co_flag=0;

void lcd_puts(char row, char column, const char *s)

char ii;

switch(row){
case 1: Lcd_Cmd(_LCD_FIRST_ROW);

break;

case 2: Lcd_Cmd(_LCD_SECOND_ROW);

break;

for(ii=1;ii<column;ii++)Lcd_Cmd(_LCD_MOVE_CURSOR_RIGHT);

while(*s)Lcd_Chr_Cp(*s++);

void ShowADC(int x, int y, unsigned int adcvalue) // Routine to show the


value of the ADC_read

car = adcvalue / 1000;

LCD_Chr(x,y,48+car);

Delay_ms(3);

adcvalue = adcvalue-1000*car;
car = (adcvalue / 100);

LCD_Chr_CP(48+car);

Delay_ms(3);

adcvalue = adcvalue-100*car;

car = (adcvalue / 10);

LCD_Chr_CP(48+car);

Delay_ms(3);

adcvalue = adcvalue-10*car;

car = adcvalue;

LCD_Chr_CP(48+car);

delay_ms(40);

void sms_config()

uart1_write_text("AT+CMGS=");

delay_ms(1000);

uart1_write('"');
uart1_write_text("8098102770");

uart1_write('"');

delay_ms(1000);

uart1_write('\r');

delay_ms(1000);

void main() {

unsigned int i,j;

ADCON1 = 0b11000010;

ADCON0 = 0b01000000;

CMCON = 7;

TRISC = 0; //To configure PORTD as output

TRISB = 0;

TRISE = 0; //To configure PORTD as output

TRISD = 0; //To configure PORTC as output

TRISC.RC0=0;
TRISC.RC1=0;

motor3=0;

relay=0;

Lcd_init();

lcd_puts(1,6,"SMART SANITATION ");

lcd_puts(2,1,"MONITORING S/M");

motor3=0;

relay=0;

delay_ms(500);

//lcd_cmd(0x01);

delay_ms(1000);

uart1_write_text("AT+CMGF=1\r");

delay_ms(1000);

//enable receive interrupt

while(1) {
if(adc_read(0)> 90)

{ motor3=1;

relay=1;

Lcd_Cmd(_LCD_CLEAR);

Lcd_puts(1,1,"water overflow");

delay_ms(1000);

sms_config();

uart1_write_text("water overflow ");

uart1_write(0x0D);

delay_ms(1000);

uart1_write(0x1A);

delay_ms(1000);

//lcd_cmd(0x01);

}
else if(adc_read(1)> 550)

lcd_cmd(0x01);

motor3=1;

relay=1;

Lcd_Cmd(_LCD_CLEAR);

Lcd_puts(1,1,"drainage close");

delay_ms(1000);

sms_config();

uart1_write_text("drainage close");

uart1_write(0x0D);

delay_ms(1000);

uart1_write(0x1A);

delay_ms(1000);

else if(adc_read(1)> 550)

lcd_cmd(0x01);
motor3=1;

relay=1;

Lcd_Cmd(_LCD_CLEAR);

Lcd_puts(1,1,"drainage open");

delay_ms(1000);

sms_config();

uart1_write_text("drainage open");

uart1_write(0x0D);

delay_ms(1000);

uart1_write(0x1A);

delay_ms(1000);

else if(adc_read(2)< 300)

motor3=1;

Lcd_Cmd(_LCD_CLEAR);

Lcd_puts(1,1,"over current");

delay_ms(1000);
sms_config();

uart1_write_text("over current");

uart1_write(0x0D);

delay_ms(1000);

uart1_write(0x1A);

delay_ms(1000);

co_flag=1;

else if(adc_read(3)< 300)

motor3=1;

Lcd_Cmd(_LCD_CLEAR);

Lcd_puts(1,1,"garbage full");

delay_ms(1000);

sms_config();

uart1_write_text("garbage full");

uart1_write(0x0D);

delay_ms(1000);

uart1_write(0x1A);
delay_ms(1000);

co_flag=1;

Anda mungkin juga menyukai