Top Banner
CHAPTER 1 INTRODUCTION
48
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: New Microsoft Office Word Document

ABSTRACT

CHAPTER 1

INTRODUCTION

Page 2: New Microsoft Office Word Document

A lot of times we need to keep track of data from a device or a sensor located in a remote

location from the point where it is processed. In other situations we desire wireless solutions

for ease.  Using long cables, infrared (IR) or other means are often tedious and not loss-less.

Imagine collecting pH level data from a chemically lethal or toxic treatment plant where

human presence is highly health hazardous. Running long cables from the pH sensor to the

control or monitor station will surely introduce noisy signals and signal-to-noise ratio will

thus drastically decrease. The result is erroneous data acquisition and thereby false decisions

may be generated. If infrared signals or other optical means including lasers are used, they

will need good obstacle-free line of sight or expensive and delicate optical fibers. Thus the

solution stays in the radio frequency (RF) domain. This article talks about interfacing low

cost RF modules (KST-TX01 and KST-RX806) for transmitting data between two remotely

located PIC microcontrollers.

Data broadcast using RF modules In this demo, we will see how to achieve an easy data

transaction between two PIC16F877A microcontrollers using inexpensive RF modules. The

theory is pretty simple and straight. It uses KST-TX01 and KST-RX806 RF modules which is

a 433 MHz serial data transmitter/receiver pair. One PIC16F877A is programmed to transmit

its ADC data (RA0/AN0 channel) serially using its built-in USART hardware at 1200 baud

with no parity and 8-bit data stream. The PIC’s USART transmitter (TX) pin feeds the data

into the data pin of the KST-TX01 which transmits it using 433 MHz ASK RF signal. On the

receiving end the KST-RX806 module receives the data and its output is connected to another

PIC’s USART input pin.

The second PIC is programmed to read its USART receiver (RX) pin. On both ends, two

LCD displays are also connected which show the transmitted and received bytes. Since

RS232 communications typically allow 8-bit data, the 8-bit A/D conversion is used here for

simplicity, instead of the more common 10-bit ADC.

General Use

1. The domestic refrigerator:

Page 3: New Microsoft Office Word Document

A simple domestic refrigerator is shown in Figure 1.1. It needs to maintain a moderately stable, low temperature within it. It does this by sensing its internal temperature and comparing that with the temperature required. It lowers the temperature by switching on a compressor. The temperature measurement requiresone or more sensors, and then whatever signal conditioning and data acquisition circuitry that is needed. Some sort of data processing is required to compare the signal representing the measured temperature to that representing the required temperature and deduce an output. Controlling the compressor requires some form of electronic interface, which accepts a low-level input control signal and then converts this to the electrical drive necessary to switch the compressor power This process of control can be done by a conventional electronic circuit or it can be done by a small embedded computer. If used, the embedded computer could be designed simply to replicate the minimalist control process described above. Once a little computer is in place, however, there is tremendous opportunity for added value. With the signal in digital form and processing power now readily available, it is an easy stepto add features like intelligent displays, more advanced control features, a better user control mechanism and so on. Taking the idea of added value one step further, once an embedded computer is in place it is possible to network it to other computers, embedded or otherwise. This opens up big new horizons, allowing a small system to become a subset of a much larger system and to share information with that system. This is now happening with domestic products, like the refrigerator, as well as much more complex items.The diagram of Figure 1.1, while specific for a fridge, actually represents very well the overall concept ofan embedded system. There is an embedded computer, engaged in reading internal variables, and outputting signals to control the performance of the system. It may have human interaction (but in general terms does not have to) and it may have networked interaction. Generally, the user has no idea that there’s a computer inside the fridge!

Page 4: New Microsoft Office Word Document

2. A car door mechanism :

A very different example of an embedded system is the car door, as shown in Figure 1.2. Once again there are some sensors, some human interaction and a set of actuators that must respond to the requirements of the system. One set of sensors relates to the door lock and another to the window. There are two actuators, the window motor and the lock actuator. It might appear that a car door could be designed as a self-contained embedded system, in a similar way to the fridge. Initially, one might even question whether it is worthy of any form of computer control whatsoever, as the functions seem so simple. Once again, by creating it as an embedded system, we see the opportunity to enhance functionality. Now we have the door status and actuators under electronic control, they can be integrated with the rest of the car. Central locking can be introduced or an alarm sounded if the door is not locked when the driver tries to pull away. There is therefore considerable advantage in having a network which links the humble actions of the door control to other functions of the car.

Page 5: New Microsoft Office Word Document

3. The electronic ‘ping-pong’ :

This little game, shown in Figure 1.3, is one of several projects used to illustrate the material of this book. It is a game for two players, who each have a push button ‘paddle’. Either player can start the game by pressing his/her paddle. The ball, represented by the row of eight LEDs (light-emitting diodes), then flies through the air to the opposing player, who must press his paddle only when the ball is at the end LED and at none other. The ball continues in play until either player violates this rule of play. Once this happens, the non-violating player scores and the associated LED is briefly lit up. When the ball is out of play, an ‘out-of-play’ LED is lit. All the above action is controlled by a tiny embedded computer, a microcontroller, made by a company called Microchip. It takes the form of an 18-pin integrated circuit (IC), and has none of the visible features that one would normally associate with a computer. Nevertheless, electronic technology is now so advanced that inside that little IC there is a Central Processing Unit (CPU), a complex array of memories, and a set of timing and interface circuits. One of its memories contains a stored program, which it executes to run the game. It is able to read in as inputs the position of the switches (the player paddles) and calculate the required LED positions. It then has the output capability to actuallypower the LEDs to which it is connected.

Page 6: New Microsoft Office Word Document

INTRODUCTION

Thus we saw that KST-TX01 and KST-RX806 RF modules are very easy to use for RF transmission and

reception of data as they can be directly interfaced to the UART port of microcontrollers. However,

there are few things that I noted while experimenting with them.

One is, when the ADC value (8-bit in this demo) is around 250 or higher the receiver starts getting

garbage data. It seems like when the data contains too many 1s, it is not recognized by the receiver

which literally “believes” that the data is static. One solution could be dividing the ADC byte into two

nibbles and send them separately.

It will slow down the net data transmission rate but the received data will be less likely to be

erroneous. It also adds an extra overhead of reconstructing the bytes from the nibbles. Similarly, if

you want to use 10-bit (or more) resolution for A/D conversion, the ADC result can also be broken

into two 5-bit fragments (MSB 5-bit and LSB 5-bit) before transmission. Adding three extra 0s on the

MSB end of each fragment completes the transmission byte. By doing so, the numerical value of

each data byte will be less than 32.

Another important fact to note is the range of the modules. Many manufactures claim ranges of up

to 10m or so. In reality this may not be what they claim because of the antenna length and the

quality of the modules themselves. A wire of 12 inches or so is adequate for a reasonably good

wireless communication.

Lastly, we found the two RF modules perform best at 1200 baud. While data transmission at 2400 baud is also possible, it will not be error free. Baud rates more than that are not useful at all. Several improvements can be done to add more features but I have kept it for those who are willing to explore it more and use it in various purposes.

Page 7: New Microsoft Office Word Document

CHAPTER 2

REVIEW OF LITERATURE

Page 8: New Microsoft Office Word Document

HISTORY

Wireless Communication:

The pre-electromagnetic past

Communication systems using electrical and electronic technology have a significant impact on modern society. As the courier speeding from Marathon to Athens in 490 B.C. illustrates, in early history information could be exchanged only by physical transport of messages. Only a few examples exist of non-electrical communication techniques for transfer of information via other infrastructures than those for physical transport: smoke signals, signal flags in maritime operations and the semaphore are among them. Early attempts to communicate visual signals by means of the semaphore, a pole with movable arms, were made in the 1830's in France. A similar experimental system was used by the Dutch during the 'ten days campaign against the Belgian revolt in 1831 / 1832. In 1837, the House of Representatives passed a resolution requesting the Secretary of the Treasury to investigate the feasibility of setting up such a system in the United States. The market interest in enhanced communication systems was also clearly illustrated by the fact that in 1860 the Pony Express started regular physical message services over land in the U.S. But at the same time, electronic systems for communication had started to develop.

The wireless era

The demonstration of (electrical) telegraphy by Joseph Henry and by Samuel F.B. Morse in 1832 followed shortly after the discovery of electromagnetism by Hans Christian Oersted and Andre-Marie Ampere early in the 1820's. In the 1840's, telegraph networks were built on the U.S. East Coast and in California. Rapid extension of their use followed; the first transatlantic cable was laid in 1858. In 1864, James Clerk Maxwell postulated wireless propagation, which was verified and demonstrated by Heinrich Hertz in 1880 and 1887, respectively. Marconi and Popov started experiments with the radio-telegraph shortly thereafter, and Marconi patented a complete wireless system in 1897.

For many years, wireless and radio were used to describe the same thing, the difference being that radio was the American version of the British wireless. The receiver was called a wireless because there were no wires linking to the the transmitting station. It was called radio because the transmitting station radiated electromagnetic waves. The British Broadcasting Company was one of the first to use the term wireless, around 1923 in their program guide "The Radio Times".

Page 9: New Microsoft Office Word Document

In 1876, Alexander Graham Bell patented the telephone. The invention of the diode by Fleming in 1904 and the triode by Lee de Forest in 1906 made possible rapid development of long-distance (radio) telephony. The invention of the transistor by Bardeen, Braittain and Shockley, which later led to the development of integrated circuits, paved the way for miniaturisation of electronic systems.

Important Dates

1864: James Clerk Maxwell proved the existence of electromagnetic waves.

1887: Heinrich Hertz sent and received wireless waves, using a spark transmitter and a resonator receiver.

1895: Guglielmo Marconi sent morese radio signals over more than a mile.

1901: Marconi received the morse message "s" (...) sent across the Atlantic.

1904: J.A. Fleming patented the diode.

1906: Lee DeForest patented the triode amplifier. First speech wireless transmission, by Fessenden.

1907: Commercial Trans-Atlantic Wireless Service, using huge ground stations: 30 x 100m antenna masts Beginning of the end for cable-based telegraphy.

WW I: Rapid development of communications intelligence, intercept technology, cryptography.

1915: Wireless voice transmission NY to SF.

1920: Marconi discovers short wave radio, with wavelengths between 10 and 100 meters.

1920: First commercial radio broadcast (in Pittsburgh)

1921: Police car dispatch radios, Detroit.

1930: BBC began television experiments.

1935: First telephone call around the world.

WW II: Rapid development of radio technology.

Page 10: New Microsoft Office Word Document

1968: Carterphone decision.

1974: FCC allocates 40 MHz for cellular telephony.

1982: European GSM and Inmarsat established.

1984: Breakup of AT&T.

1984: Initial deployment of AMPS cellular system

CHAPTER 3

THEORY AND

DESCRIPTION

Page 11: New Microsoft Office Word Document

BLOCK DIAGRAM

Page 12: New Microsoft Office Word Document

BLOCK DIAGRAM EXPLANATION

Given above the basic block diagram of the wireless data communication. In the above fig. we use two PIC microcontroller for serial data communication. Firstly data is sent from keypad to PIC of transmitter. Which will be shown on LCD then RF module will sense the data given to PIC. Then the RF module will transmit the data using 433KHz frequency which will be received by receiver.

Page 13: New Microsoft Office Word Document

Now the receiver comes in to action, the data received from is sent to the pic . pic maintain the synchronization of data between the transmitter and receiver. The data received by the pic is sent to lcd display using data bus. The 8 bit data is shown on the lcd display.

CIRCUIT DIAGRAM OF TRANSMITTER

Page 14: New Microsoft Office Word Document

Transmitting unit

CIRCUIT DIAGRAM OF RECIEVER

Page 15: New Microsoft Office Word Document

Receiving unit

COMPONENT USED IN TRANSMITTER

S.No Component Name Code Specification

1. Pic microcontroller pic 16F877A 2. Crystal oscillator co 12MHz 3. Resistor R1

Page 16: New Microsoft Office Word Document

4. Potentiometer U1 10KHz 5. capacitor C1 6. Rf module kst Tx01 7. keypad

COMPONENT USED IN RECEIVER

S.No Component Name Code Specification

1. Pic microcontroller pic 16F877A 2. Crystal oscillator co 12MHz 3. Resistor R1 4. Potentiometer U1 10KHz 5. capacitor C1 6. Rf module kst Rx-806

COMPONENT DESCRIPTION

1. PIC Microcontroller(16F877A)2. Resistors3. Capacitors4. RF module kst-tx15. RF module kst-rx8066. LCD7. POWER CONNECTORS

8. BATTERY CAP

9. PIN BUS WIRE

10. Keypad

PIC Microcontroller (16F877A)

Page 17: New Microsoft Office Word Document

The PIC16F877A CMOS FLASH-based 8-bit microcontroller is upward compatible with the

PIC16C5x, PIC12Cxxx and PIC16C7x devices. It features 200 ns instruction execution, 256

bytes of EEPROM data memory, self programming, an ICD, 2 Comparators, 8 channels of

10-bit Analog-to-Digital (A/D) converter, 2 capture/compare/PWM functions, a synchronous

serial port that can be configured as either 3-wire SPI or 2-wire I2C bus, a USART, and a

Parallel Slave Port. 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.

Special Microcontroller Features

Flash Memory: 14.3 Kbytes (8192 words)

Data SRAM: 368 bytes

Data EEPROM: 256 bytes

Self-reprogrammable under software control

In-Circuit Serial Programming via two pins (5V)

Watchdog Timer with on-chip RC oscillator

Programmable code protection

Power-saving Sleep mode

Selectable oscillator options

In-Circuit Debug via two pins

Analog Features

10-bit, 8-channel A/D Converter

Brown-Out Reset

Analog Comparator module

2 analog comparators

Programmable on-chip voltage reference module

Programmable input multiplexing from device inputs and internal VREF

Peripheral Features

Page 18: New Microsoft Office Word Document

33 I/O pins; 5 I/O ports

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

16-bit Capture input; max resolution 12.5 ns

16-bit Compare; max resolution 200 ns

10-bit PWM

Synchronous Serial Port with two modes:

SPI Master

I2C Master and Slave

USART/SCI with 9-bit address detection

Parallel Slave Port (PSP)

8 bits wide with external RD, WR and CS control

Brown-out detection circuitry for Brown-Out Reset

High-Performance RISC CPU

Lead-free; RoHS-compliant

Operating speed: 20 MHz, 200 ns instruction cycle

Operating voltage: 4.0-5.5V

Industrial temperature range (-40° to +85°C)

15 Interrupt Sources

35 single-word instructions

All single-cycle instructions except for program branches (two-cycle)

The PIC architecture is characterized by its multiple attributes:

Separate code and data spaces (Harvard architecture) for devices other than PIC32, which has a Von Neumann architecture.

A small number of fixed length instructions

Most instructions are single cycle execution (2 clock cycles, or 4 clock cycles in 8-bit models), with one delay cycle on branches and skips

One accumulator (W0), the use of which (as source operand) is implied (i.e. is not encoded in the opcode)

Page 19: New Microsoft Office Word Document

All RAM locations function as registers as both source and/or destination of math and other functions.[3]

A hardware stack for storing return addresses

A fairly small amount of addressable data space (typically 256 bytes), extended through banking

Data space mapped CPU, port, and peripheral registers

The program counter is also mapped into the data space and writable (this is used to implement indirect jumps).

There is no distinction between memory space and register space because the RAM serves the job of both memory and registers, and the RAM is usually just referred to as the register file or simply as the registers.

Figure 1 pic microcontroller16F877A

Figure 2 pin diagram

Page 20: New Microsoft Office Word Document

Figure 3 General architecture of PiC16F877A

Data space (RAM)PICs have a set of registers that function as general purpose RAM. Special purpose control registers for on-chip hardware resources are also mapped into the data space. The addressability of memory varies depending on device series, and all PIC devices have some banking mechanism to extend addressing to additional memory. Later series of devices feature move instructions which can cover the whole addressable space, independent of the selected bank. In earlier devices, any register move had to be achieved via the accumulator.

To implement indirect addressing, a "file select register" (FSR) and "indirect register" (INDF) are used. A register number is written to the FSR, after which reads from or writes to INDF will actually be to or from the register pointed to by FSR. Later devices extended this concept with post- and pre- increment/decrement for greater efficiency in accessing sequentially stored data. This also allows FSR to be treated almost like a stack pointer (SP).

Page 21: New Microsoft Office Word Document

External data memory is not directly addressable except in some high pin count PIC18 devices.

Code spaceThe code space is generally implemented as ROM, EPROM or flash ROM. In general, external code memory is not directly addressable due to the lack of an external memory interface. The exceptions are PIC17 and select high pin count PIC18 devices.[

]Word sizeAll PICs handle (and address) data in 8-bit chunks. However, the unit of addressability of the code space is not generally the same as the data space. For example, PICs in the baseline (PIC12) and mid-range (PIC16) families have program memory addressable in the same wordsize as the instruction width, i.e. 12 or 14 bits respectively. In contrast, in the PIC18 series, the program memory is addressed in 8-bit increments (bytes), which differs from the instruction width of 16 bits.

In order to be clear, the program memory capacity is usually stated in number of (single word) instructions, rather than in bytes.

StacksPICs have a hardware call stack, which is used to save return addresses. The hardware stack is not software accessible on earlier devices, but this changed with the 18 series devices.

Hardware support for a general purpose parameter stack was lacking in early series, but this greatly improved in the 18 series, making the 18 series architecture more friendly to high level language compilers.

Instruction setA PIC's instructions vary from about 35 instructions for the low-end PICs to over 80 instructions for the high-end PICs. The instruction set includes instructions to perform a variety of operations on registers directly, the accumulator and a literal constant or the accumulator and a register, as well as for conditional execution, and program branching.

Some operations, such as bit setting and testing, can be performed on any numbered register, but bi-operand arithmetic operations always involve W (the accumulator), writing the result back to either W or the other operand register. To load a constant, it is necessary to load it into W before it can be moved into another register. On the older cores, all register moves needed to pass through W, but this changed on the "high end" cores.

PIC cores have skip instructions which are used for conditional execution and branching. The skip instructions are 'skip if bit set' and 'skip if bit not set'. Because cores before PIC18 had only unconditional branch instructions, conditional jumps are implemented by a conditional skip (with the opposite condition) followed by an unconditional branch. Skips are also of utility for conditional execution of any immediate single following instruction.

The 18 series implemented shadow registers which save several important registers during an interrupt, providing hardware support for automatically saving processor state when servicing interrupts.

In general, PIC instructions fall into 5 classes:

1. Operation on working register (WREG) with 8-bit immediate ("literal") operand. E.g. movlw (move literal to WREG), andlw (AND literal with WREG). One instruction peculiar to the PIC is retlw, load immediate into

WREG and return, which is used with computed branches to produce lookup tables.

2. Operation with WREG and indexed register. The result can be written to either the Working register (e.g. addwf reg,w). or the selected register (e.g. addwf reg,f).

3. Bit operations. These take a register number and a bit number, and perform one of 4 actions: set or clear a bit, and test and skip on set/clear. The latter are used to perform conditional branches. The usual ALU status flags are available in a numbered register so operations such as "branch on carry clear" are possible.

4. Control transfers. Other than the skip instructions previously mentioned, there are only two: goto and call.

5. A few miscellaneous zero-operand instructions, such as return from subroutine, and sleep to enter low-

power mode.

Page 22: New Microsoft Office Word Document

PerformanceThe architectural decisions are directed at the maximization of speed-to-cost ratio. The PIC architecture was among the first scalar CPU designs, and is still among the simplest and cheapest. The Harvard architecture—in which instructions and data come from separate sources—simplifies timing and microcircuit design greatly, and this benefits clock speed, price, and power consumption.

The PIC instruction set is suited to implementation of fast lookup tables in the program space. Such lookups take one instruction and two instruction cycles. Many functions can be modeled in this way. Optimization is facilitated by the relatively large program space of the PIC (e.g. 4096 × 14-bit words on the 16F690) and by the design of the instruction set, which allows for embedded constants. For example, a branch instruction's target may be indexed by W, and execute a "RETLW" which does as it is named - return with literal in W.

Interrupt latency is constant at three instruction cycles. External interrupts have to be synchronized with the four clock instruction cycle, otherwise there can be a one instruction cycle jitter. Internal interrupts are already synchronized. The constant interrupt latency allows PICs to achieve interrupt driven low jitter timing sequences. An example of this is a video sync pulse generator. This is no longer true in the newest PIC models, because they have a synchronous interrupt latency of three or four cycles.

AdvantagesThe PIC architectures have these advantages:

Small instruction set to learn

RISC architecture

Built in oscillator with selectable speeds

Easy entry level, in circuit programming plus in circuit debugging PICK it units available from Microchip.com for less than $50

Inexpensive microcontrollers

Wide range of interfaces including I²C, SPI, USB, USART, A/D, programmable comparators, PWM, LIN, CAN, PSP, and Ethernet

LimitationsThe PIC architectures have these limitations:

One accumulator

Register-bank switching is required to access the entire RAM of many devices

Operations and registers are not orthogonal; some instructions can address RAM and/or immediate constants, while others can only use the accumulator

The following stack limitations have been addressed in the PIC18 series, but still apply to earlier cores:

The hardware call stack is not addressable, so preemptive task switching cannot be implemented

Software-implemented stacks are not efficient, so it is difficult to generate re-entrant code and support local variables

With paged program memory, there are two page sizes to worry about: one for CALL and GOTO and another for computed GOTO (typically used for table lookups). For example, on PIC16, CALL and GOTO have 11 bits of addressing, so the page size is 2048 instruction words. For computed GOTOs, where you add to PCL, the page size is 256 instruction words. In both cases, the upper address bits are provided by the PCLATH register. This register must be changed every time control transfers between pages. PCLATH must also be preserved by any interrupt handler.[9]

Page 23: New Microsoft Office Word Document

Compiler developmentWhile several commercial compilers are available, in 2008, Microchip released their own C compilers, C18 and C30, for the line of 18F 24F and 30/33F processors.

The easy to learn RISC instruction set of the PIC assembly language code can make the overall flow difficult to comprehend. Judicious use of simple macros can increase the readability of PIC assembly language. For example, the original Parallax PIC assembler ("SPASM") has macros which hide W and make the PIC look like a two-address machine. It has macro instructions like "mov b, a" (move the data from address a to address b) and "add b, a"

(add data from address a to data in address b). It also hides the skip instructions by providing three operand branch macro instructions such as "cjne a, b, dest" (compare a with b and jump to dest if they are not equal).

RESISTOR

A resistor is a passive two-terminal electrical component that implements resistance as a circuit element. The current through a resistor is in direct proportion to the voltage across the resistor's terminals. Thus, the ratio of the voltage applied across a resistor's terminals to the intensity of current through the circuit is called resistance. This relation is represented by Ohm's law:

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

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

Page 24: New Microsoft Office Word Document

Theory of operation

Ohm's law The behavior of an ideal resistor is dictated by the relationship specified by Ohm's law:

Ohm's law states that the voltage (V) across a resistor is proportional to the current (I), where the constant of proportionality is the resistance (R).

Equivalently, Ohm's law can be stated:

This formulation states that the current (I) is proportional to the voltage (V) and inversely proportional to the resistance (R). This is directly used in practical computations. For example, if a 300 ohm resistor is attached across the terminals of a 12 volt battery, then a current of 12 / 300 = 0.04 amperes (or 40 milliamperes) occurs across that resistor.

Series and parallel resistorsIn a series configuration, the current through all of the resistors is the same, but the voltage across each resistor will be in proportion to its resistance. The potential difference (voltage) seen across the network is the sum of those voltages, thus the total resistance can be found as the sum of those resistances:

As a special case, the resistance of N resistors connected in series, each of the same resistance R, is given by NR.Resistors in a parallel configuration are each subject to the same potential difference (voltage), however the currents through them add. The conductances of the resistors then add to determine the conductance of the network. Thus the equivalent resistance (Req) of the network can be computed:

Page 25: New Microsoft Office Word Document

The parallel equivalent resistance can be represented in equations by two vertical lines "||" (as in geometry) as a simplified notation. Occasionally two slashes "//" are used instead of "||", in case the keyboard or font lacks the vertical line symbol. For the case of two resistors in parallel, this can be calculated using:

As a special case, the resistance of N resistors connected in parallel, each of the same resistance R, is given by R/N.

A resistor network that is a combination of parallel and series connections can be broken up into smaller parts that are either one or the other. For instance,

Resistor- Color -Code -----------------  

Page 26: New Microsoft Office Word Document

 

 4 Band Color Code 

 

Page 27: New Microsoft Office Word Document

CAPACITOR

A capacitor (originally known as condenser) is a passive two-terminal electrical componentused to store energy in an electric field. The forms of practical capacitors vary widely, but all contain at least two electrical conductors separated by a dielectric (insulator); for example, one common construction consists of metal foils separated by a thin layer of insulating film. Capacitors are widely used as parts of electrical circuits in many common electrical devices.

When there is a potential difference (voltage) across the conductors, a static electric fielddevelops across the dielectric, causing positive charge to collect on one plate and negative charge on the other plate. Energy is stored in the electrostatic field. An ideal capacitor is characterized by a single constant value, capacitance, measured in farads. This is the ratio of the electric charge on each conductor to the potential difference between them.

The capacitance is greatest when there is a narrow separation between large areas of conductor, hence capacitor conductors are often called "plates," referring to an early means of construction. In practice, the dielectric between the plates passes a small amount of leakage current and also has an electric field strength limit, resulting in a breakdown voltage, while the conductors and leads introduce an undesired inductance and resistance.

Capacitors are widely used in electronic circuits for blocking direct current while allowingalternating current to pass, in filter networks, for smoothing the output of power supplies, in theresonant circuits that tune radios to particular frequencies, in electric power transmission systems for stabilizing voltage and power flow, and for many other purposes.

Theory of operation

Page 28: New Microsoft Office Word Document

Charge separation in a parallel-plate capacitor causes an internal electric field. A dielectric (orange) reduces the field and increases the capacitance.

A simple demonstration of a parallel-plate capacitor

A capacitor consists of two conductors separated by a non-conductive region.[8] The non-conductive region is called thedielectric. In simpler terms, the dielectric is just an electrical insulator. Examples of dielectric media are glass, air, paper,vacuum, and even a semiconductor depletion region chemically identical to the conductors. A capacitor is assumed to be self-contained and isolated, with no net electric charge and no influence from any external electric field. The conductors thus hold equal and opposite charges on their facing surfaces,[9] and the dielectric develops an electric field. In SI units, a capacitance of one farad means that one coulomb of charge on each conductor causes a voltage of one volt across the device.[10]

The capacitor is a reasonably general model for electric fields within electric circuits. An ideal capacitor is wholly characterized by a constant capacitance C, defined as the ratio of charge ±Q on each conductor to the voltage V between them:[8]

Sometimes charge build-up affects the capacitor mechanically, causing its capacitance to vary. In this case, capacitance is defined in terms of incremental changes:

NetworksFor capacitors in parallel

Capacitors in a parallel configuration each have the same applied voltage. Their capacitances add up. Charge is apportioned among them by size. Using the schematic diagram to visualize parallel plates, it is apparent that each capacitor contributes to the total surface area.

Page 29: New Microsoft Office Word Document

For capacitors in series

Several capacitors in series.

Connected in series, the schematic diagram reveals that the separation distance, not the plate area, adds up. The capacitors each store instantaneous charge build-up equal to that of every other capacitor in the series. The total voltage difference from end to end is apportioned to each capacitor according to the inverse of its capacitance. The entire series acts as a capacitorsmaller than any of its components.

Capacitors are combined in series to achieve a higher working voltage, for example for smoothing a high voltage power supply. The voltage ratings, which are based on plate separation, add up, if capacitance and leakage currents for each capacitor are identical. In such an application, on occasion series strings are connected in parallel, forming a matrix. The goal is to maximize the energy storage of the network without overloading any capacitor.Series connection is also sometimes used to adapt polarized electrolytic capacitors for bipolar AC use. Two polarized electrolytic capacitors are connected back to back to form a bipolar capacitor with half the capacitance. The anode film can only withstand a small reverse voltage however.[15] This arrangement can lead to premature failure as the anode film is broken down during the reverse-conduction phase and partially rebuilt during the forward phase.[16] A non-polarized electrolytic capacitor has both plates anodized so that it can withstand rated voltage in both directions; such capacitors have about half the capacitance per unit volume of polarized capacitors.

Page 30: New Microsoft Office Word Document

LCD(Liquid Crystal Display)

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 do not emit light directly.

LCDs 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, andtelephones. 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 toimage persistence. [1]

Page 31: New Microsoft Office Word Document

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 anelectronically 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.[2] 

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 Gameboy 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.

Advantages and disadvantages

In spite of LCDs being a well proven and still viable technology, as display devices LCDs are not perfect for all applications.

Advantages

Very compact and light. Low power consumption.

No geometric distortion.

Little or no flicker depending on backlight technology.

Not affected by screen burn-in.

Can be made in almost any size or shape.

No theoretical resolution limit.

Disadvantages

Limited viewing angle, causing color, saturation, contrast and brightness to vary, even within the intended viewing angle, by variations in posture.

Bleeding and uneven backlighting in some monitors, causing brightness distortion, especially toward the edges.

Smearing and ghosting artifacts caused by slow response times (>8 ms) and "sample and hold" operation.

Page 32: New Microsoft Office Word Document

Only one native resolution. Displaying resolutions either requires a video scaler, lowering perceptual quality, or display at 1:1 pixel mapping, in which images will be physically too large or won't fill the whole screen.

Fixed bit depth, many cheaper LCDs are only able to display 262,000 colors. 8-bit S-IPS panels can display 16 million colors and have significantly better black level, but are expensive and have slower response time.

Low bit depth results in images with unnatural or excessive contrast.

Input lag

Dead or stuck pixels  may occur during manufacturing or through use.

In a constant-on situation, thermalization may occur, which is when only part of the screen has overheated and looks discolored compared to the rest of the screen.

Not all LCDs are designed to allow easy replacement of the backlight.

Cannot be used with light guns/pens..

LCD interfacing with PIC16F877A

The most common used for the 44780-based LCD is 16 pin in a row. The pins assignment is listed in Table 1.0.

Table 1.0 Hitachi 44780 Based LCD PinoutPin Description1 Vss, Ground2 Vcc, +5V supply3 Vee, Contrast Voltage4 R/S, Instruction / Data Mode select5 R/W, Read / write6 E, Enable7-14 D0-D7 Data lines15 +Led16 -Led

The hardware setup is shown in Figure 1.0

Page 33: New Microsoft Office Word Document

The LCD requires 3 "control" lines from the microcontroller.

Enable (E)

This line allows access to the display through R/W and RS lines. When this line is low, the LCD is disabled and ignores signals from R/W and RS. When (E) line is high, the LCD checks the state of the two control lines and responds accordingly.

Read/Write (R/W)

This line determines the direction of data between the LCD and microcontroller. When it is low, data is written to the LCD. When it is high, data is read from the LCD.

Register select (RS)

With the help of this line, the LCD interprets the type of data on data lines. When it is low, an instruction is being written to the LCD. When it is high, a character is being written to the LCD.

The LCD module needs to be initialized before you can send command or data to it. The initialization steps is listed below:

1 Wait for about 45ms delay after power is applied2 Clear RS and R/W to select instruction mode and writing mode3 Write the instruction set to set the interface to 8bit, 2 line and 5x7 doti.e. write b’00111011’ to LCD.4 Set the Enable line then wait for 5ms for the instruction to complete.5 Write the same data, b00111011 to LCD and wait >160us for instruction to complete6 Write the same data again, b00111011 to LCD and wait >160us for instruction to complete7 Set the operating Characteristics of the LCD- Write 0x08 to turn off the display, set E = 1 for 3us- Delay 50us- Write 0x01 to clear the display, set E = 1 for 3us- Delay 1.8ms

Page 34: New Microsoft Office Word Document

- Write 0x02 for cursor home, set E = 1 for 3us- Delay 1.8ms- Write 0x0F to turn on the display, set E = 1 for 3us- Delay 50us- Write 0x06 for entry mode set, set E = 1 for 3us- Delay 50us8 Set RS to 0, and R/W to 0

After the LCD initialization, now is ready to send the characters to display in the LCD. Follow the steps below to write data/character to LCD:

1) Set RS to 1 for character mode2) Clear R/W to select writing mode.3) Set the character code (refer to Table 4.0) to data line.4) Set E = 1 for 3us, then E = 0.5) Wait for at least 160us6) Repeat step 3 for the next character.

KEYPAD

A keypad is a set of buttons arranged in a block or "pad" which usually bear digits, symbols and usually a complete set of alphabetical letters. If it mostly contains numbers then it can

also be called a numeric keypad. Keypads are found on many alphanumeric keyboards and on other devices such as calculators, push-button telephones, combination locks, digital door

locks, which require mainly numeric input.

Uses and functions

A computer keyboard usually has a small numeric keypad on the side, in addition to the other number keys on the top, but with a calculator-style arrangement of buttons that allow more

Page 35: New Microsoft Office Word Document

efficient entry of numerical data. This number pad (commonly abbreviated to "numpad") is usually positioned on the right side of the keyboard because most people are right-handed.

Many laptop computers have special function keys which turn part of the alphabetical keyboard into a numerical keypad as there is insufficient space to allow a separate keypad to be built into the laptop's chassis. Separate external plug-in keypads can be purchased.

As a general rule, the keys on calculator-style keypads are arranged such that 123 is on the bottom row. Whereas, in a telephone keypad, either in a home or mobile phone, there will be the 123-keys at the top. A phone key-pad also has the special buttons labelled * (star) and # (octothorpe, number sign, "pound" or "hash") on either side of the zero key. Most of the keys on a telephone also bear letters which have had several auxiliary uses, such as remembering area codes or whole telephone numbers.

The keypad of a calculator contains the digits 0 through 9, from bottom upwards, together with the four arithmetic operations, the decimal point and other more advanced mathematical functions.

The reason that the keypad of keyboards and calculators are different is that the first security keycodes had been invented before the touchtone telephone, and did not require the extra + - % / keys and so the touch tone adopted this 1, 2, 3 at the top rather than 1, 2, 3 at the bottom as it too only required 12 keys

Keypads are also a feature of some combination locks. This type of lock is often used on doors, such as that found at the main entrance to some offices.

RF MODULE

Kst-tx01

KST-TX01 Technical spec for wireless transmitter module

Page 36: New Microsoft Office Word Document

(1) transmit power:1W (1500m)

(2)operating frequency:315MHZ~433.92MHZ

(3)operating temprature:-40.~80.

(4)operating voltage: 3V~5V

(5) modulation type: ASK

Kst Rx806

KST Technology Co. Ltd.

KST-RX806 Superheterodyne receive technical spec

KST-RX806 is wireless data transmit and receive module with VHF/UHF super high

frequency. adopting LSI circuit with hi-frequency and low-noise which import from

famous company of Europe,it has strong anti-static protection and high reliability.

And it is your first choice among the distant transmit products as wireless remote

control (rolling code), eletric gate control system and the like.

Characteristic as follows:

1. The receive sensibility is up to -105dbm; the receive distance is twice of others.

2. It has reasonable receive band width, excellent ability of suppress coordinate

frequency, strong

anti-jamming, adapting to all kinds of environment.

Page 37: New Microsoft Office Word Document

3. It has excellent ability of suppressing assembling and scatterring radiation, easily

passing all kinds

of criterions

4. Due to excellent shield,it can adapt to kinds of installing environment,

consistency is nicer.

5. It has ability to restrain the radiation, can worked with several pieces of modules

(one transmit

module and several receive modules) but neither interfering to each other nor

influencing the receive distance.

6. Adopting the SAW, the ability is immobile, and the temperature range is wide.

7. It is easy to adjust.between frequency range for 250-450 MHz.

8. It has I/O for single-chip, and it is easy to implement (the transmit speed can be

up to 20kbps.)

9. Strenghthen the ability of anti-disturbing against mobile phone and improve the

shape of decoding

waves.

KST-RX 806 product technical spec introduction

..technical parameter:

(1) operating voltage: +5VDC

(2) operating current: .8mA

(3) operating frequency: 315MHz- 433.92MHz

(4) modulation: ASK superheterodyne

(5) receiver sensibility: -115dB

(6)storage temprature: -40.~+85.

.. spec:

.. Function’s spec of foot ‘s position :

1.+5VDC 4.GND

2.DATA 5.ANT

Page 38: New Microsoft Office Word Document

3.GND

Crystal oscillator

A crystal oscillator is an electronic oscillator circuit that uses the mechanical resonance of a

vibrating crystal of piezoelectric material to create an electrical signal with a very precisefrequency. This

frequency is commonly used to keep track of time (as in quartz wristwatches), to provide a stable clock

signal for digital integrated circuits, and to stabilize frequencies for radio transmitters and receivers. The

most common type of piezoelectric resonator used is the quartz crystal, so oscillator circuits designed

around them became known as "crystal oscillators."

Quartz crystals are manufactured for frequencies from a few tens of kilohertz to tens of megahertz. More

than two billion (2×109) crystals are manufactured annually. Most are used for consumer devices such

as wristwatches, clocks, radios, computers, and cellphones. Quartz crystals are also found inside test and

measurement equipment, such as counters, signal generators, and oscilloscopes.

Page 39: New Microsoft Office Word Document