0% found this document useful (0 votes)
238 views92 pages

Chap 1

This document provides an overview of a wireless device control system using a PC with an RS232 connection. The system allows controlling electric devices remotely using a PC as the transmitter. The system has a transmitter section connected to the PC via RS232. It uses a microcontroller to convert serial data from the PC to a BCD code, which is then encoded and transmitted via a 434MHz RF module. The receiver section uses the same RF module to receive signals and control up to eight devices using relays. This allows remotely controlling devices like lights and appliances in homes, offices, industries and more through a PC-based interface.

Uploaded by

Arth Patel
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
238 views92 pages

Chap 1

This document provides an overview of a wireless device control system using a PC with an RS232 connection. The system allows controlling electric devices remotely using a PC as the transmitter. The system has a transmitter section connected to the PC via RS232. It uses a microcontroller to convert serial data from the PC to a BCD code, which is then encoded and transmitted via a 434MHz RF module. The receiver section uses the same RF module to receive signals and control up to eight devices using relays. This allows remotely controlling devices like lights and appliances in homes, offices, industries and more through a PC-based interface.

Uploaded by

Arth Patel
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 92

CHAPTER 1 PROJECT SYNOPSIS

1.1 Introduction
Controlling devices using switches are common. From a few decades controlling devices using remote control switches like infrared remote control switch, wireless remote control switches, light activated switches are becoming popular. But these technologies have their own limitations. Laser beams are harmful to mankind. And use of telephone is also having some limitation of goes at particular place to operate a lighting system by using it there some lengthy process. Some technologies like IR remote control are used for short distance applications. In such case if we have system which does not require any radiations or which is not harmful, long remote control switch! Yes here is the solution. Here we are introducing such a system which does not require any radiations, any laser beam which has no limitation of range using a Wireless Device Control using PC with RS 232. In this wireless generation operation through wireless devices is a very comfortable among all. Here we are using a PC as a media, which serves main part of this system, by using PC with RS 232 connection or extra controlling circuit as a transmitter. Wireless Device Control using PC with RS 232 system can be used for intelligent houses or offices or industries in large domain. With this implemented system, it is possible to safely control electricity operated domestic devices. As in recent days PCs are one of the fundamental requirement of human being at every sector to use PC is wisdom to save energy. Now a days PCs are used at home to large scale industries so it`s beneficial. This system is use at the either home/offices or at any industries to operate lighting system by using a wireless control.

1.1 Features We can control many devices. It may be any electric or electronic appliances or devices
with simple to heavy appliances. It makes accurate switching, any false switching of device are not done.

1.2 Technical Specification Working Voltage 12V AC/DC


Operating Current - 500ma Aprox Contact Rating 230V AC / 500W PC Serial Port (RS232) Interface Software for win95, 98, 2000, XP, 7

Using 434 / 315MHZ RF Frequency Using Amplitude-shift keying (ASK) Modulation Long range (>400 meters) Eight 12V relay For up to eight device to be connected

On board relay LED indicator


On board Power LED indicator

1.3 Application
Home automation system In Offices Wireless Devices Control Road light controlling In hospital Industrial control system Railway signal controlling.

What Is Modulation?
Modulation is the process where a Radio Frequency or Light Wave's amplitude, frequency, or phase is changed in order to transmit intelligence. The characteristics of the carrier wave are instantaneously varied by another "modulating" waveform. There are many ways to modulate a signal: Amplitude-shift keying (ASK) Frequency-Shift Keying (FSK) Amplitude Modulation (AM) Frequency Modulation (FM) Phase Modulation Pulse Modulation

Amplitude-shift keying (ASK): ASK is a form of modulation that represents digital data as variations in the amplitude of a carrier wave. The amplitude of an analog carrier signal varies in accordance with the bit stream (modulating signal), keeping frequency and phase constant. The level of amplitude can be used to represent binary logic 0s and 1s. We can think of a carrier signal as an ON or OFF switch. In the modulated signal, logic 0 is represented by the absence of a carrier, thus giving OFF/ON keying operation and hence the name given. Like AM, ASK is also linear and sensitive to atmospheric noise, distortions, propagation conditions on different routes in PSTN, etc. It requires excessive bandwidth and is therefore a waste of power. Both ASK modulation and demodulation processes are relatively inexpensive. The ASK technique is also commonly used to transmit digital data over RF Transmitter. RF transmitter data input, low level pulse represents binary 0, while high level pulse represents binary 1.

FSK.......??? AM........?? FM........??

How its Work?


This project uses the RF transmitter & receiver units to control eight relays. The transmitter unit has connected with PC using RS232 port and sending eight data byte by PC. In the receiver section, receive valid data code once turns on one relay. A second time its off. Red LED's indicate the state of the relay so it can be viewed from a distance. 12V relay contacts 220V/3A. With the rapid progress in computer technology many people now used dedicated controllers for a variety of uses: turning on/off lights or other devices around the home, office, laboratory or factories come to mind. All that is needed is the interface to connect it to the real world. In this project we have used both the hardware and the software to do this. The hardware transmitter PCB plugs in directly to the serial (RS232) port of your computer. The project is constructed on single-sided printed circuit.

Figure 1: Simple block diagram of system As shown in block diagram this system in divided in two subsystem section as following: 1) Transmitter section 2) Receiver section This both sections are illustrated in next chapters.

CHAPTER 2 Transmitter Section

2.1 Block Diagram of Transmitter Section


On the computer there is an application program. In that there are 8 buttons switch on or off different devices. When click anyone button the specific code is generated and this code will pass to the circuit using serial port. In the transmitter U1 Micro controller to use for convert the serial data into the BCD Code. This BCD code is passed to RF encoder IC i.e. HT12E. It sends the data wirelessly with the help of Radio frequency transmitter.

Figure 2.3 Block diagram of transmitter section As shown in block diagram transmitter section is operated through PC as input, Microcontroller as serial to BCD converter, RF encoder and 434 MHZ ASK Tx module for transmit data.

2.1.1 PC as input
As input for system PC is used. For requirement of pc any processor after P3 processor can be used like P4, Core 2 Duo, i3, i5, i7 etc. As operating system win 95, 98, 2000, XP, 7 can be used. There is an application on pc which has 8 switches for different device which we want to operate. When we select any switch then corresponding code is generated which will transmitted through serial port and RS 232 serial cable to microcontroller of transmitter kit for further process.

2.1.2 Micro Controller PIC16F628 (Tx)


The full transmitter section circuit of the projects is shown in schematic diagram of transmitter section the brain of the switcher is the Pre programmed micro controller use as serial to parallel converter. Its used to encode the PC data, and fed to the RF encoder Chip HT12E. The function of the micro controller is to receive commands (eight data) (through port RA3) from the PC via serial port (RS232). Send the BCD Code to the RF Encoder as per the commands. The 18 Pin micro controllers PIC16F628 Port RB0 RB3 is used for sending BCD data to the RF encoder Chip. Port A (RA2, RA3, and RA4) is pulled up via 10K resistor and used for manual key control. RA3 receives the commands from PC serial Port, via the current limit resistor.

2.1.2.1 Special Micro controller Features


Power-on Reset (POR) Its own on-chip RC oscillator for reliable operation Internal EEPROM Operating Speed at 10MHz Direct In-Circuit Programming for Easy Program Updates Multiplexed MCLR-pin Programmable weak pull-ups on PORTB Programmable code protection Low voltage programming Power saving SLEEP mode Selectable oscillator options Flash configuration bits for oscillator options - ER (External Resistor) oscillator Reduced part count Dual speed INTRC Lower current consumption 16 I/O pins with individual direction control High current sink/source for direct LED drive Direct In-Circuit Programming for Easy Program Updates

Up to 10 I/O points with easy to connect standard headers RS232 Connection with MAX232 LCD Connection with Contrast Adjustment One 16-bit Timer with Two 8-bit Timers Power and Programming LED Reset Button Ideal as an Interchangeable Controller for Real-Time Systems.

2.1.2.2 PIC16F628 Controller Technical Data

Microcontroller

Microcontroller : PIC16F628A-I/P Main Crystal : 10.000MHz Speed : 2.5MHz Processor Language : PIC

Memory Program Flash Memory (Internal) : 2kBytes RAM Memory (Internal) : 224 Bytes EEPROM Memory (Internal) : 128 Bytes

Input/output

A/D

I/O Points Available : 10 I/O Points Connection : IDCC Connector

A/D Comparators : 2

Timers Timers : One 16-bit Timer and Three 8-bit Timers Capture/Compare : 1 Module with PWM

Auxiliary Communication RS232 Communication Auxiliary Features In-Circuit Programming Power-On Led : Red Programming Led : Green Reset Button

Power Supply Power-Supply : 5 V dc Dimensions l x w x h : 82mm x 62mm x 25mm (Including mounting supports)

2.1.3 RF Encoder (HT12E)


The 12 bit encoders are a series of CMOS remote control system applications. They are capable of encoding information that consists of eight address bits and four data bits. Each address/data input can be set to one of the two logic states. The programmed addresses/data are transmitted together with the header bits via an RF transmission medium. Outputs of Microcontroller port B, RB1 to RB4, pin no 6 - 9 are connected to pin no 10 13. This received 4 bit data converted to serial data and encoded by this IC. This data is transfer to 434 MHZ ASK transmitter modules.

2.1.3.1 Pin Diagram

2.1.3.2 Block Diagram

2.1.3.3 Flow Chart

2.1.4 RF Transmitter Module


This is a low coast A.S.K. (Amplitude Shift Keying) SAW transmitter module. It makes RF remote techniques easily, just input the data code and output with a high stability RF signal. Received data from HT12E IC is modulated by ASK modulation technique at 433.92 MHZ frequency with 8 KBPS data rate to antenna. The ST-TX01-ASK is an ASK Hybrid transmitter module.ST-TX01-ASK is designed by the Saw Resonator, with an effective low cost, small size, and simple-to-use for designing.

2.1.4.1 Features

SAW chip on board technology Low power consumption Wide range of operation voltage: 1.5 ~ 15 Volts.
Output Power : 4~16dBm

Easy for application RF output -10 ~ +16dBm at 3V DC operation voltage Available frequency at follows: 315/433.92 MHz Frequency : 433.92 MHZ Modulation: ASK Circuit Shape: SAW Date Rate: 8K bps Supply Voltage: +5V Power Supply range for I/O pins: 0 to 5 V Non-Operating Case Temperature: -20 to +85 C Soldering Temperature ( 10 Seconds ) : 230 C

Pin1: ANT Pin2: GND Pin3: DATA Pin4: VCC

2.2 Schematic Diagram of Transmitter Section

Fig2.2 Schematic Diagram of Transmitter Section

CHAPTER 3

RECEIVER SECTION

3.1 Block Diagram of Receiver Section


Digital RF signal transmitted by Tx is received by receiver antenna. As shown in block diagram two supply voltages are required for circuit. A 12 V unregulated for relay driver and 5V regulated for Microcontroller and Decoder IC.

Fig 3.1 Block Diagram of Receiver Section

3.1.1 RF ASK Receiver Module


This is an ASK Hybrid receiver module. It is an effective low cost solution to receiving data at 433.92 MHZ. MO-RX3400-A is an ASK receiver module. The MO-RX3400-Ais based on a singleconversion, super-heterodyne receiver architecture and incorporates an entire Phase-Locked Loop (PLL) for precise local oscillator generation. It can use in OOK / HCS / PWM modulation signal and demodulate to digital signal. MO-RX3400-A had a high performance and easily to design your product. It can be used on wireless security system or specific remote-control function and others wireless system.

Features Low power consumption.

Easy for application. On-Chip VCO with integrated PLL using crystal oscillator reference. Integrated IF and data filters. Operation temperature range : 2085 Operation voltage: 5 Volts. Available frequency at : 315 /434 MHz

Super heterodyne receiver

3.1.2 RF Data Decoder (HT12D)


The signal modification after super heterodyne section of RF receiver module moved to pin no 14 of decoder IC HT12D from pin no 3 of Rx module. The 212 decoders are a series of CMOS LSIs for remote control system applications. They are paired with Holteks 212 series of encoders. For proper operation, a pair of encoder/decoder with the same number of addresses and data format should be chosen. The decoders receive serial addresses and data from programmed 12 Bit encoders that are transmitted by a carrier using an RF transmission medium. They compare the serial input data three times continuously with their local addresses. If no error or unmatched codes are found, the input data codes are decoded and then transferred to the output pins. The VT pin also goes high to indicate a valid transmission. The decoders are capable of decoding informations that consist of eight bits of address and four bits of data.

Output type of the 212 series of decoders, the HT12F has no data output pin but its VT pin can be used as a momentary data output. The HT12D, on the other hand, provides 4 latch type data pins whose data remain unchanged until new data are received.

3.1.2.1Features Operating voltage: 2.4V~12V Low power and high noise immunity CMOS technology

Low standby current Capable of decoding 12 bits of information Binary address setting Received codes are checked 3 times Address/Data number combination 8 address bits and 4 data bits Built-in oscillator needs only 5% resistor Valid transmission indicator Easy interface with an RF or an infrared transmission medium Minimal external components Pair with Holteks 212 series of encoders 18-pin DIP, 20-pin SOP package. 3.1.2.2 Block Diagram

3.1.2.3 Flow Chart

3.1.3 Micro controller Interface (BCD Decoder)

The full circuit of the receiver section is shown in schematic diagram of the receiver section is the brain of the receiver is the Pre programmed micro controller PIC 16F628 use as BCD Decoder. The function of the micro controller is to receive commands (four bit BCD data) (through port RA0 to RA3) from the RF decoder IC HT12D and control eight relays via relay driver IC ULN2803. RA0 to RA3 as BCD input, it connect with the RF encoder with 10K pullups resistor. A 4 MHZ Resonator Connect with OSC1 and OSC2 PIN (15 and 16). It generates the clock pulse, which fixes the operation speed. Putting the capacitors the crystal (or ceramic) oscillator outside does the oscillation operation. When having the oscillation with the high stability, it uses the crystal. Generally, the circuit becomes simple when using the resonator, which incorporated the ceramic and the capacitors into the one.

3.1.4 RELAY Driver (ULN2803)


A single pole dabble throw (SPDT) relay is connected to pin 6 to 13 (RB0 to RB7) of the micro controller through a driver IC ULN2803. The relay requires 12 volts at a current of around 50 mA, which cannot provide by the micro controller. So the driver IC OR transistor is added. The relay is used to operate the external electrical device. Normally the relay remains off. As soon as pin of the micro controller goes high, the relay operates. The connected LED

will glow to show that this relay is on. When the relay is switch on it is cut-off and signals are directly provided to the connected device through AC power supply.

The ULN2803 contain eight Darlington transistors with common emitters and integral suppression diodes for inductive loads. Each Darlington features a peak load current rating of 600mA (500mA continuous) and can withstand at least50V in the off state. Outputs may be paralleled for higher current capability. Five versions are available to simplify interfacing to standard logic families:

The ULN2801Ais designed for general purpose applications with a current limit resistor TheULN2802Ahas a 10.5kW input resistor and Zener for 14-25VPMOS TheULN2803Ahas a 2.7kW input resistor for 5V TTL and CMOS The ULN2804A has a 10.5kW input resistor for 6-15V CMOS and The ULN2805A is designed to sink a minimum of 350mA for standard and Schottky TTL where higher output current is required. All types are supplied in an 18-lead plastic DIP with a copper lead from and feature the convenient input opposite-output pin out to simplify board layout.

3.1.5 RELAY
A relay is an electrical switch that opens and closes under the control of another electrical circuit. In the original form, the switch is operated by an electromagnet to open or close one or many sets of contacts. It was invented by Joseph Henry in 1835. Because a relay is able to control an output circuit of higher power than the input circuit, it can be considered to be, in a broad sense, a form of an electrical amplifier.

Figure 3.3 sugar cube relay Despite the speed of technological developments, some products prove so popular that their key parameters and design features remain virtually unchanged for years. One such product is the sugar cube relay, shown in the figure above, which has proved useful to many designers who needed to switch up to 10A, whilst using relatively little PCB area.

3.1.5.1 The RELAY Switching Section


Relay is used to connect with a device which is to switch when it goes above decided condition. In this Project 12V Relay is used to drive the load.

Since relays are switches, the terminology applied to switches is also applied to relays. A relay will switch one or more poles, each of whose contacts can be thrown by energizing the coil in one of three ways: 1. Normally - open (NO) contacts connect the circuit when the relay is activate d; the circuit is disconnected when the relay is inactive. It is also called a FORM A contact or make contact. 2. Normally - closed (NC) contacts disconnect the circuit when the relay is activated; the circuit is connected when relay is inactive. It is also called FORM B contact or break contact 3. Change-over or double-throw contacts control two circuits; one contact. normally open contact and one normally closed contact with a common terminal. It is also called a Form C transfer

3.1.5.2 Types of RELAY


The following types of relays are commonly encountered:

"C" denotes the common terminal in SPDT and DPDT types Fig. 3.4 Different types of Relays

1) SPST - Single Pole Single Throw These have two terminals which can be connected or disconnected. Including two for the coil, such a relay has four terminals in total. It is ambiguous whether the pole is normally open or normally closed. The terminology "SPNO" and "SPNC" is sometimes used to resolve the ambiguity. 2) SPDT - Single Pole Double Throw

A common terminal connects to either of two others. Including two for the coil, such a relay has five terminals in total. 3) DPST - Double Pole Single Throw: These have two pairs of terminals. Equivalent to two SPST switches or relays actuated by a single coil. Including two for the coil, such a relay has six terminals in total. It is ambiguous whether the poles are normally open, normally closed, or one of each. 4) DPDT - Double Pole Double Throw These have two rows of change-over terminals. Equivalent to two SPDT switches or relays actuated by a single coil. Such a relay has eight terminals, including the coil. 5) QPDT - Quadruple Pole Double Throw Often referred as Quad Pole Double Throw or 4PDT. These have four rows of changeover terminals. Equivalent to four SPDT switches or relays actuated by a single coil or two DPDT relays. In total fourteen terminals including the coil.

3.1.6 POWER SUPPLY


Two supply voltages are required for circuit. A DC or AC 12 V mains adaptor is connected to bridge rectifier (D1 - 4) via CN5 connector. U1, U2 and U3 are supplied with a regulated 5 V from a 7805 (U4) fixed voltage Regulator. The unregulated voltage of approximately 12 V is required for relay driving circuit (U3) and eight-12V SPDT Relay.

3.2 Schematic Diagram of Receiver Section

Fig3.2 Schematic Diagram of Receiver Section

PC SERIAL PORT (RS232)


RS-232 is simple, universal, well understood and supported but it has some serious shortcomings as a data interface. The standards to 256kbps or less and line lengths of 15M (50 ft) or less but today we see high speed ports on our home PC running very high speeds and with high quality cable maxim distance has increased greatly. The rule of thumb for the length a data cable depends on speed of the data, quality of the cable. Electronic data communications between elements will generally fall into two broad categories: single-ended and differential. RS232 (single-ended) was introduced in 1962, and despite rumours for its early demise, has remained widely used through the industry. Independent channels are established for two-way (full-duplex) communications. The RS232 signals are represented by voltage levels with respect to a system common (power / logic ground). The "idle" state (MARK) has the signal level negative with respect to common, and the "active" state (SPACE) has the signal level positive with respect to common. RS232 has numerous handshaking lines (primarily used with modems), and also specifies a communications protocol. The RS-232 interface presupposes a common ground between the DTE and DCE. This is a reasonable assumption when a short cable connects the DTE to the DCE, but with longer lines and connections between devices that may be on different electrical busses with different grounds, this may not be true. RS232 data is bi-polar.... +3 TO +12 volts indicate an "ON or 0-state (SPACE) condition" while A -3 to -12 volts indicates an "OFF" 1-state (MARK) condition.... Modern computer equipment ignores the negative level and accepts a zero voltage level as the "OFF" state. In fact, the "ON" state may be achieved with lesser positive potential. This means circuits powered by 5 VDC are capable of driving RS232 circuits directly; however, the overall range that the RS232 signal may be transmitted /received may be dramatically reduced. The output signal level usually swings between +12V and -12V. The "dead area" between +3v and -3v is designed to absorb line noise. In the various RS-232-like definitions this dead area may vary. For instance, the definition for V.10 has a dead area from +0.3v to 0.3v. Many receivers designed for RS-232 are sensitive to differentials of 1v or less. RS232 is a voltage loop interface for two-way (full-duplex) communication represented by voltage levels with respect to system ground (common). A common ground between the PC and the associated device is necessary. Maximum serial cable length is 8 defined: 75 feet at

9,600 bps, but today cables up to 1,000 feet are used successfully. The interface is single ended (connecting only two devices with each other), the data rate is less than 20 kbps.

CHAPTER 3 Component list and Explanations

3.1 Component List


Table 1 : Bill Of Material

TRANSMITTER (PCB 1)
U1 - 434 / 315 MHZ ASK RF TRANSMITTER MODULE U2 - PIC16F628 PRE PROGRAMMED MICRO CONTROLLER (TX) U3 - HT12E RF ENCODER U4 - LM7805 5V VOLTAGE REGULATOR CN1 - 9 PIN D CONNECTOR 18 PIN IC SOCKET [2 NOS.] Y1 - 4MHZ RESONATOR RESISTORS R1, R2, R4, R6 - 1K R3 - 22K R5 - 680K CAPACITORS C1, C3 - 100nF C2 - 100 F / 16V DIODE D1 - 1N4007 LED L1 - 5mm OR 3mm RED LED L1 - 5mm OR 3mm GREEN LED RS232 DATA CABLE

RECEIVER (PCB 2)
U1 - 434 / 315 MHZ ASK RF RECEIVER MODULE U2 - PIC16F628 PRE PROGRAMMED MICRO CONTROLLER (RX) U3 - HT12E RF DECODER U4 - LM7805 5V VOLTAGE REGULATOR 18 PIN IC SOCKET [2 NOS.] Y1 - 4MHZ RESONATOR RESISTORS R1, R2, R3, R4, R5 - 10K R6 - 47K R7 - 1K CAPACITORS C1, C3, C4 - 100nF C2 - 1000 F / 16V DIODE D1, D2, D3, D4 - 1N4007 LED L1 - 5mm OR 3mm GREEN LED

RELAY DRIVER (PCB 3)


U1 - ULN2803 RELAY DRIVER 18 PIN IC SOCKET RL1 RL8 - 12V SPDT RELAY (PCB MOUNT) RESISTORS R1, R2, R3, R4, R5, R6, R7, R8 - 1K LED L1, L2, L3, L4, L5, L6, L7, L8 - 5mm OR 3mm LED

3.2 Components details


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

Resistors are common elements of electrical networks and electronic circuits and are appearing in most electronic equipment. Practical resistors can be made of various compounds and films, as well as resistance wire (wire made of a high-resistivity alloy, such as nickelchrome). Electronic symbol

or

[Fig 3.1: Symbol of Resistors]

The ohm (symbol: ) is the SI unit of electrical resistance, named after Georg Simon Ohm. An ohm is equivalent to a volt per ampere. Since resistors are specified and manufactured over a very large range of values, the derived units of milliohm (1 m = 103 ), kilo ohm (1 k = 103 ), and mega ohm (1 M = 106 ) are also in common usage.

Color Coding: The electronic color code is used to indicate the values or ratings of electronic components, very commonly for resistors. The electronic color code was developed in the early 1920s by the Radio Manufacturers Association (now part of Electronic Industries Alliance (EIA)), and was published as EIA-RS-279. Color bands were commonly used (especially on resistors) because they were easily printed on tiny components, decreasing construction costs. However, there were drawbacks, especially for color blind people. Overheating of a component, or dirt accumulation, may make it impossible to distinguish brown from red from orange. Advances in printing technology have made printed numbers practical for small components, which are often found in modern electronics. The standard color code per EN 60062:2005 is as follows: Table 2: color codes for resistor Color Significant figures 0 1 2 3 4 5 6 7 8 9 Multiplier Tolerance Temp. Coefficient (ppm/K) 250 U F G D C B 100 50 15 25 20 10 5 1 J K S R P Q Z Z M K

Black Brown Red Orange Yellow Green Blue Violet Gray White Gold Silver None

100 10 10 10 10 10 10 10 10 10
1 2 3

1% 2% (5%) 0.5% 0.25% 0.1% 5% 10% 20%

104
5 6

107
8 9 -1 -2

0.05% (10%) A

For Example: To distinguish left from right there is a gap between the C and D bands.

band A is first significant figure of component value (left side) band B is the second significant figure

band C is the decimal multiplier band D if present, indicates tolerance of value in percent (no color means 20%)

For example, a resistor with bands of yellow, violet, red, and gold will have first digit 4 (yellow in table below), second digit 7 (violet), followed by 2 (red) zeros: 4,700 ohms. Gold signifies that the tolerance is 5%, so the real resistance could lie anywhere between 4,465 and 4,935 ohms.

3.2.2 Capacitors
A capacitor (formerly known as condenser) is a passive two-terminal electrical component used to store energy in an electric field. The forms of practical capacitors vary widely, but all contain at least two electrical conductors separated by a dielectric (insulator). Capacitors are used as parts of electrical systems, for example, consist of metal foils separated by a layer of insulating film. Electronic symbol

A typical electrolytic capacitor When there is a potential difference (voltage) across the conductors, a static electric field develops across the dielectric, causing positive charge to collect on one plate and negative charge on the other plate. Energy is stored in the electrostatic field. An ideal capacitor is 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. Capacitors are widely used in electronic circuits for blocking direct current while allowing alternating current to pass, in filter networks, for smoothing the output of power

supplies, in the resonant circuits that tune radios to particular frequencies and for many other purposes.

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

A capacitor consists of two conductors separated by a non-conductive region. The nonconductive region is called the dielectric. In simpler terms, the dielectric is just an electrical insulator. Examples of dielectric mediums 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, 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. 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:

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

3.2.3 Relay
A relay is an electrically operated switch. Many relays use an electromagnet to operate a switching mechanism mechanically, but other operating principles are also used. Relays are

used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in long distance telegraph circuits, repeating the signal coming in from one circuit and re-transmitting it to another. Relays were used extensively in telephone exchanges and early computers to perform logical operations. A type of relay that can handle the high power required to directly control an electric motor is called a contactor. Solid-state relays control power circuits with no moving parts, instead using a semiconductor device to perform switching. Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults; in modern electric power systems these functions are performed by digital instruments still called "protective relays". Basic design and operation

Simple electromechanical relay A simple electromagnetic relay consists of a coil of wire surrounding a soft iron core, an iron yoke which provides a low reluctance path for magnetic flux, a movable iron armature, and one or more sets of contacts (there are two in the relay pictured). The armature is hinged to the yoke and mechanically linked to one or more sets of moving contacts. It is held in place by a spring so that when the relay is de-energized there is an air gap in the magnetic circuit. In this condition, one of the two sets of contacts in the relay pictured is closed, and the other set is open. Other relays may have more or fewer sets of contacts depending on their function. The relay in the picture also has a wire connecting the armature to the yoke. This ensures continuity of the circuit between the moving contacts on the armature, and the circuit track on the printed circuit board (PCB) via the yoke, which is soldered to the PCB. When an electric current is passed through the coil it generates a magnetic field that attracts the armature and the consequent movement of the movable contact either makes or breaks (depending upon construction) a connection with a fixed contact. If the set of contacts was closed when the relay was de-energized, then the movement opens the contacts and breaks the connection, and vice versa if the contacts were open. When the current to the coil is switched off, the armature is returned by a force, approximately half as strong as the magnetic force, to its relaxed position. Usually this force is provided by a spring, but gravity is also used commonly in industrial motor starters. Most relays are manufactured to operate quickly. In a

low-voltage application this reduces noise; in a high voltage or current application it reduces arcing. When the coil is energized with direct current, a diode is often placed across the coil to dissipate the energy from the collapsing magnetic field at deactivation, which would otherwise generate a voltage spike dangerous to semiconductor circuit components. Some automotive relays include a diode inside the relay case. Alternatively, a contact protection network consisting of a capacitor and resistor in series (snubber circuit) may absorb the surge. If the coil is designed to be energized with alternating current (AC), a small copper "shading ring" can be crimped to the end of the solenoid, creating a small out-of-phase current which increases the minimum pull on the armature during the AC cycle.

3.2.4 Diodes
In electronics, a diode is a type of two-terminal electronic component with a nonlinear currentvoltage characteristic. The most common function of a diode is to allow an electric current to pass in one direction (called the diode's forward direction), while blocking current in the opposite direction (the reverse direction). Thus, the diode can be thought of as an electronic version of a check valve. This unidirectional behaviour is called rectification, and is used to convert alternating current to direct current, and to extract modulation from radio signals in radio receivers. However, diodes can have more complicated behaviour than this simple onoff action. Semiconductor diodes do not begin conducting electricity until a certain threshold voltage is present in the forward direction (a state in which the diode is said to be forward biased). The voltage drop across a forward biased diode varies only a little with the current, and is a function of temperature; this effect can be used as a temperature sensor or voltage reference. Semiconductor diodes have nonlinear electrical characteristics, which can be tailored by varying the construction of their PN junction. These are exploited in special purpose diodes that perform many different functions. For example, diodes are used to regulate voltage (Zener diodes), to protect circuits from high voltage surges (Avalanche diodes), to electronically tune radio and TV receivers (varactor diodes), to generate radio frequency oscillations (tunnel diodes, Gunn diodes, IMPATT diodes), and to produce light (light emitting diodes). Tunnel diodes exhibit negative resistance, which makes them useful in some types of circuits. Semiconductor diodes

Typical diode packages in same alignment as diode symbol. Thin bar depicts the cathode.

Currentvoltage characteristic

3.2.5 LEDs
A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator lamps in many devices and are increasingly used for other lighting. Introduced as a practical electronic component in 1962, early LEDs emitted low-intensity red light, but modern versions are available across the visible, ultraviolet and infrared wavelengths, with very high brightness. Passive, optoelectronic Type Electroluminescence Working principle Nick Holonyak Jr. (1962) Invented Electronic symbol

Pin configuration

anode and cathode

Parts of an LED, Although not directly labelled, the flat bottom surfaces of the anvil and post embedded inside the epoxy act as anchors, to prevent the conductors from being forcefully pulled out from mechanical strain or vibration.

When a light-emitting diode is forward biased (switched on), electrons are able to recombine with electron holes within the device, releasing energy in the form of photons. This effect is called electroluminescence and the color of the light (corresponding to the energy of the photon) is determined by the energy gap of the semiconductor. LEDs are often small in area (less than 1 mm2), and integrated optical components may be used to shape its radiation pattern. LEDs present many advantages over incandescent light sources including lower energy consumption, longer lifetime, improved robustness, smaller size, faster switching, and greater durability and reliability. LEDs powerful enough for room lighting are relatively expensive and require more precise current and heat management than compact fluorescent lamp sources of comparable output. Light-emitting diodes are used in applications as diverse as replacements for aviation lighting, automotive lighting (particularly brake lamps, turn signals and indicators) as well as in traffic signals. The advantages of LEDs mentioned above have allowed new text and video displays and sensors to be developed, while their high switching rates are also useful in advanced communications technology. Infrared LEDs are also used in the remote control units of many commercial products including televisions, DVD players, and other domestic appliances.

3.2.6 Transformer

A transformer is a device that transfers electrical energy from one circuit to another through inductively coupled conductors the transformer's coils. A varying current in the first or primary winding creates a varying magnetic flux in the transformer's core and thus a varying magnetic field through the secondary winding. This varying magnetic field induces a varying electromotive force (EMF), or "voltage", in the secondary winding. This effect is called mutual induction. If a load is connected to the secondary, an electric current will flow in the secondary winding and electrical energy will be transferred from the primary circuit through the transformer to the load. In an ideal transformer, the induced voltage in the secondary winding (Vs) is in proportion to the primary voltage (Vp) and is given by the ratio of the number of turns in the secondary (Ns) to the number of turns in the primary (Np) as follows:

By appropriate selection of the ratio of turns, a transformer thus allows an alternating current (AC) voltage to be "stepped up" by making Ns greater than Np, or "stepped down" by making Ns less than Np. Ideal power equation

The ideal transformer as a circuit element If the secondary coil is attached to a load that allows current to flow, electrical power is transmitted from the primary circuit to the secondary circuit. Ideally, the transformer is perfectly efficient; all the incoming energy is transformed from the primary circuit to the magnetic field and into the secondary circuit. If this condition is met, the incoming electric power must equal the outgoing power:

Giving the ideal transformer equation

Transformers range in size from a thumbnail-sized coupling transformer hidden inside a stage microphone to huge units weighing hundreds of tons used to interconnect portions of power grids. All operate with the same basic principles, although the range of designs is wide. While new technologies have eliminated the need for transformers in some electronic circuits, transformers are still found in nearly all electronic devices designed for household ("mains") voltage. Transformers are essential for high-voltage electric power transmission, which makes long-distance transmission economically practical.
Basic principles

The transformer is based on two principles: first, that an electric current can produce a magnetic field (electromagnetism), and, second that a changing magnetic field within a coil of wire induces a voltage across the ends of the coil (electromagnetic induction). Changing the current in the primary coil changes the magnetic flux that is developed. The changing magnetic flux induces a voltage in the secondary coil.

An ideal transformer, the secondary current arises from the action of the secondary EMF on the (not shown) load impedance. An ideal transformer is shown in the adjacent figure. Current passing through the primary coil creates a magnetic field. The primary and secondary coils are wrapped around a core of very high magnetic permeability, such as iron, so that most of the magnetic flux passes through both the primary and secondary coils. If a load is connected to the secondary winding, the load current and voltage will be in the directions indicated, given the primary current and voltage in the directions indicated (each will be alternating current in practice).

3.2.7 Transistor
A transistor is a semiconductor device used to amplify and switch electronic signals and power. It is composed of a semiconductor material with at least three terminals for connection to an external circuit. A voltage or current applied to one pair of the transistor's terminals changes the current flowing through another pair of terminals. Because the controlled (output) power can be much more than the controlling (input) power, a transistor can amplify a signal. Today, some transistors are packaged individually, but many more are found embedded in integrated circuits. The transistor is the fundamental building block of modern electronic devices, and is ubiquitous in modern electronic systems. Following its release in the early 1950s the transistor revolutionized the field of electronics, and paved the way for smaller and cheaper radios, calculators, and computers, among other things. A Transistor having many applications a few of them are as shown as below: Versatile three lead semiconductor devices whose applications include electronic switching and modulation (amplification) Transistors are miniature electronic switches. Configuration of circuit determines whether the transistor will serve a switch and amplifier Building blocks of the microprocessor, which is the brain of the computer. Have two operating positions- on and off. Binary functionality of transistors enables the processing of information in a computer.

Simple circuit to show the labels of a bipolar transistor


Types of transistor

PNP

NPN

BJT About BJTs Three Layers in a BJT Collector Base (very thin) Emitter Two Types of BJTs PNP (figure on left) (Operates with outgoing base current) NPN (figure on right) (Operates with incoming base current)

[Fig3.2: BJTs schematic representation]

BJT operation characteristics

BJT operation regions


Table 3 :BJT operation region

Operation Region Cutoff

IB or VCE Char.

BC and Junctions

BE Mode

IB = Very small

Reverse & Reverse

Open Switch

Saturation VCE = Small

Forward & Forward

Closed Switch Linear Amplifier Overload

Active Linear Breakdown

VCE = Moderate

Reverse & Forward

VCE = Large

Beyond Limits

3.2.8 ICs
An integrated circuit or monolithic integrated circuit (also referred to as IC, chip, or microchip) is an electronic circuit manufactured by the patterned diffusion of trace elements

into the surface of a thin substrate of semiconductor material. Additional materials are deposited and patterned to form interconnections between semiconductor devices.

Integrated circuits are used in virtually all electronic equipment today and have revolutionized the world of electronics. Computers, mobile phones, and other digital appliances are now inextricable parts of the structure of modern societies, made possible by the low cost of production of integrated circuits. Integrated circuits were made possible by experimental discoveries showing that semiconductor devices could perform the functions of vacuum tubes and by mid-20th-century technology advancements in semiconductor device fabrication. The integration of large numbers of tiny transistors into a small chip was an enormous improvement over the manual assembly of circuits using discrete electronic components. The integrated circuits mass production capability, reliability, and building-block approach to circuit design ensured the rapid adoption of standardized ICs in place of designs using discrete transistors. There are two main advantages of ICs over discrete circuits: cost and performance. Cost is low because the chips, with all their components, are printed as a unit by photolithography rather than being constructed one transistor at a time. Furthermore, much less material is used to construct a packaged IC die than to construct a discrete circuit. Performance is high because the components switch quickly and consume little power (compared to their discrete counterparts) as a result of the small size and close proximity of the components. As of 2006, typical chip areas range from a few square millimetres to around 350 mm2, with up to 1 million transistors per mm2. Integrated circuit originally referred to a miniaturized electronic circuit consisting of semiconductor devices, as well as passive components bonded to a substrate or circuit board. This configuration is now commonly referred to as a hybrid integrated circuit. Integrated circuit has since come to refer to the single-piece circuit construction originally known as a monolithic integrated circuit.

3.2.8.1 IC Socket

3.2.9 IC 7805
The LM7805 is three terminal positive 5V regulators are available in the TO-220/DPAK package and with several fixed output voltages, making them useful in a wide range of applications. Each type employs internal current limiting, thermal shut down and safe operating area protection, making it essentially indestructible. If adequate heat sinking is provided, they can deliver over 1A output current. Although designed primarily as fixed voltage regulators, hence devices can be used with external components to obtain adjustable voltages and currents.

Features Output Current up to 1A Output Voltages of IC 5V Thermal Overload Protection Short Circuit Protection Output Transistor Safe Operating Area Protection

3.2.9.1 Internal Block Diagram

3.2.10 4 MHZ Resonators

CHAPTER 4

1.

Flowchart and code of the Program


1.1 Flowchart 1.2 Program 1.3 PIC16F690 Instruction set

CHAPTER 5

1.

Hardware and Software


1.1 Assembly instruction and PCB layout 1.2 Software for Programmable security door lock 1.3 Hardware for Programmable security door lock

CHAPTER 6

Conclusion and Future Scope

EXPECTED OUTCOME
A wireless Control for Electrical Appliance At Home, offices or industries, like the one implemented here, is suitable for residential and/or industrial applications. Such a system would typically provide a control of operating the electric system. Thus a system such as this can be deployed easily with little connection between electric appliance and external source to operate electrical Appliance. Hence, after interacting with industry and knowing about that process of working in industry (as well as home too) in small scale (in single office/ room) and limitation of recent technology like to operate their circuit with external source as well as circuitry is more complicated and system is very costly etc. After interacting with industry we have made one simplest model based on Low frequency by PC through RS 232 which is economical, simplest circuitry etc. This way we have make them and home users to in knowledge and interacted with recent technology and modern demand to the market as engineer work for them.

FUTURE SCOPE
Here we explain the system which is use to operate an electric system at home and at industries is simple sample model with any application either lamp or fan or any other application. By some changes it also use for the multi application. By the use of microcontroller and some changes this system is ready for the use of multi application. Here we use a PC to operate the model system. Hence a system so many scope for the future expansion.

Appendix A Programming Code

A.1 Programming Code for Transmitter Controller PIC 16F628

include P16F628.lib

GOTO Label_1 Label_3 CLRWDT CALL Label_2 BTFSC STATUS , C GOTO Label_3 CALL Label_4 CLRF 0x28 MOVLW 0x08 MOVWF 0x23 Label_6 CALL Label_5 CALL Label_2 BTFSC STATUS , C INCF 0x28 BTFSS 0x2B CLRF 0x28 RRF 0x22 ,f ,f ,f , 05

DECFSZ 0x23 GOTO Label_6 BTFSC 0x2B BCF 0x22

, 05 , 07

CALL Label_5 MOVF 0x22 RETURN ,W

Label_2

MOVF 0x36 MOVWF FSR

,W

MOVF 0x34 BSF FSR

,W , 07 ,f , 07 ,W , 06 ,W

IORWF INDF BCF FSR

ANDWF INDF BTFSC 0x2B XORWF 0x34 ADDLW 0xFF RETURN

Label_22 CLRF 0x24 CLRF 0x25 BCF Label_8 0x33 , 05

CALL Label_7 ADDLW 0xD3 BTFSC STATUS , Z BSF 0x33 , 05

ADDLW 0x2D GOTO Label_8 ADDLW 0x0A BTFSS STATUS , C GOTO Label_8 Label_A MOVWF 0x22 BCF RLF STATUS , C 0x24 ,W

MOVWF 0x20 RLF 0x25 ,W

MOVWF 0x21 RLF RLF 0x20 0x21 ,W ,f ,f

ADDWF 0x24

BTFSC STATUS , C

INCF 0x21 MOVF 0x21 ADDWF 0x25 RLF RLF 0x24 0x25

,f ,W ,f ,f ,f ,W

MOVF 0x22

BTFSC STATUS , Z GOTO Label_9 CALL Label_7 ADDLW 0xC6 BTFSC STATUS , C GOTO Label_9 ADDLW 0x0A BTFSC STATUS , C GOTO Label_A Label_9 BTFSS 0x33 , 05

GOTO Label_B COMF 0x24 COMF 0x25 INCF 0x24 ,f ,f ,f

BTFSC STATUS , Z INCF 0x25 Label_B MOVF 0x24 GOTO Label_C Label_2C MOVWF 0x26 MOVF 0x36 MOVWF FSR MOVLW 0x80 ANDWF 0x33 MOVLW 0x08 MOVWF 0x27 BCF STATUS , C ,f ,W ,f ,W

Label_E BTFSC STATUS , C INCF 0x33 ,f

CALL Label_D RRF 0x26 ,f ,f

DECFSZ 0x27 GOTO Label_E NOP BTFSC 0x2B RRF 0x33

, 05 ,W

CALL Label_D CALL Label_F BSF STATUS , C

CALL Label_D MOVF 0x2F MOVWF 0x23 MOVF 0x2E ,W ,W

GOTO Label_10 Label_D BCF FSR , 07 , 07

BTFSS 0x2B

GOTO Label_11 MOVF INDF IORWF 0x34 BTFSS 0x2B XORWF 0x34 MOVWF INDF BSF FSR , 07 ,W ,W ,W ,W , 06 ,W

MOVF INDF IORWF 0x34

BTFSS STATUS , C XORWF 0x34 MOVWF INDF GOTO Label_5 ,W

Label_11 MOVF INDF IORWF 0x34

,W ,W

BTFSS STATUS , C XORWF 0x34 BTFSC 0x2B XORWF 0x34 MOVWF INDF BSF FSR , 07 ,W ,f ,W , 06 ,W

COMF 0x34 ANDWF INDF GOTO Label_5 Label_4 BSF 0x33

, 06 ,W

Label_5 MOVF 0x2B ANDLW 0x1F ADDLW 0xFF MOVWF 0x21 MOVF 0x2A ADDLW 0xF5

,W

BTFSC STATUS , C INCF 0x21 BTFSS 0x33 ,f , 06

GOTO Label_12 BCF 0x33 , 06

MOVWF 0x20 MOVLW 0x02 CALL Label_13 GOTO Label_12 Label_1C BSF STATUS , RP0

MOVWF EEADR BSF EECON1 , 00

MOVF EEDATA , W GOTO Label_C

Label_20 BSF

STATUS , RP0

MOVWF EEDATA BSF EECON1 , 02

MOVLW 0x55 MOVWF EECON2 MOVLW 0xAA MOVWF EECON2 BSF EECON1 , 01

Label_14 BTFSC EECON1 , 01 GOTO Label_14 BCF EECON1 , 02

GOTO Label_C Label_1B CLRF 0x23 Label_10 MOVWF 0x22 Label_15 MOVLW 0xFF ADDWF 0x22 ,f

BTFSS STATUS , C ADDWF 0x23 ,f

BTFSS STATUS , C GOTO Label_C MOVLW 0x03 MOVWF 0x21 MOVLW 0xDF CALL Label_12 GOTO Label_15 CLRF 0x21 Label_12 ADDLW 0xE8 MOVWF 0x20 COMF 0x21 MOVLW 0xFC BTFSS STATUS , C GOTO Label_16 ,f

Label_17 ADDWF 0x20

,f

BTFSC STATUS , C GOTO Label_17 Label_16 ADDWF 0x20 CLRWDT INCFSZ 0x21 ,f ,f

GOTO Label_17 BTFSC 0x20 , 00

GOTO Label_18 Label_18 BTFSS 0x20 , 01

GOTO Label_19 NOP GOTO Label_19 Label_19 RETURN

Label_1A BCF RRF RRF

STATUS , C 0x21 0x20 ,f ,f

Label_13 ADDLW 0xFF BTFSC STATUS , C GOTO Label_1A MOVF 0x20 GOTO Label_C Label_7 MOVWF FSR MOVF 0x31 ,W ,W

MOVWF PCLATH MOVF 0x30 MOVWF PCL Label_C BCF BCF BCF STATUS , IRP STATUS , RP1 STATUS , RP0 ,W

Label_F CLRWDT

RETURN

Label_1 MOVLW 0x07 MOVWF CMCON BSF STATUS , RP0

CLRF VRCON BSF OPTION_REG, NOT_RBPU

MOVLW 0xFE MOVWF TRISA CLRF TRISB MOVLW 0x64 BCF STATUS , RP0

CALL Label_1B MOVLW 0x00 CALL Label_1C MOVWF 0x38 CLRWDT MOVLW 0xFA SUBWF 0x38 ,W

BTFSS STATUS , C GOTO Label_1D GOTO Label_1E GOTO Label_1F Label_1D INCF 0x38 BSF ,f

STATUS , RP0

CLRF EEADR BCF STATUS , RP0 ,W

MOVF 0x38 CALL Label_20 BSF BSF BCF PORTB

, 04

STATUS , RP0 TRISB , 04

BCF BSF BSF BCF BCF BSF BSF BCF BCF BSF BSF BCF BCF BSF BSF BCF BCF Label_2D BCF BSF BCF BCF BSF BSF BCF

STATUS , RP0 PORTB , 00

STATUS , RP0 TRISB , 00

STATUS , RP0 PORTB , 01

STATUS , RP0 TRISB , 01

STATUS , RP0 PORTB , 02

STATUS , RP0 TRISB , 02

STATUS , RP0 PORTB , 03

STATUS , RP0 TRISB , 03

STATUS , RP0 PORTB , 07

STATUS , RP0 TRISB , 07

STATUS , RP0 PORTB , 04

STATUS , RP0 TRISB , 04

MOVLW 0x05 BCF STATUS , RP0

MOVWF 0x36 MOVLW 0x02 MOVWF 0x34 MOVLW 0x54 MOVWF 0x2A MOVLW 0x40

MOVWF 0x2B Label_21 CALL Label_3 SUBLW 0x44 BTFSS STATUS , Z GOTO Label_21 CALL Label_3 SUBLW 0x41 BTFSS STATUS , Z GOTO Label_21 CALL Label_3 SUBLW 0x54 BTFSS STATUS , Z GOTO Label_21 CALL Label_3 SUBLW 0x41 BTFSS STATUS , Z GOTO Label_21 CLRF 0x29 MOVLW 0x01 MOVWF 0x30 CLRF 0x31 CALL Label_22 MOVWF 0x39 BSF BSF BCF PORTB , 07

STATUS , RP0 TRISB , 07

CLRWDT BCF STATUS , RP0 ,W

MOVF 0x39 SUBLW 0x01

BTFSS STATUS , Z GOTO Label_23

MOVLW 0x01 MOVWF 0x39 GOTO Label_24 Label_23 CLRWDT MOVF 0X39 SUBLW 0x02 BTFSS STATUS , Z GOTO Label_25 MOVLW 0x02 MOVWF 0x39 GOTO Label_24 Label_25 CLRWDT MOVF 0x39 SUBLW 0x03 BTFSS STATUS , Z GOTO Label_26 MOVLW 0x03 MOVWF 0x39 GOTO Label_24 Label_26 CLRWDT MOVF 0x39 SUBLW 0x04 BTFSS STATUS , Z GOTO Label_27 MOVLW 0x04 MOVWF 0x39 GOTO Label_24 Label_27 CLRWDT MOVF 0x39 SUBLW 0x05 BTFSS STATUS , Z GOTO Label_28 ,W ,W ,W ,W

MOVLW 0x05 MOVWF 0x39 GOTO Label_24 Label_28 CLRWDT MOVF 0x39 SUBLW 0x06 BTFSS STATUS , Z GOTO Label_0029 MOVLW 0x06 MOVWF 0x39 GOTO Label_24 Label_29 CLRWDT MOVF 0x39 SUBLW 0x07 BTFSS STATUS , Z GOTO Label_2A MOVLW 0x07 MOVWF 0x39 GOTO Label_24 Label_2A CLRWDT MOVF 0x39 SUBLW 0x08 BTFSS STATUS , Z GOTO Label_2B MOVLW 0x08 MOVWF 0x39 GOTO Label_24 Label_2B MOVLW 0x05 MOVWF 0x36 MOVLW 0x01 MOVWF 0x34 MOVLW 0x54 ,W ,W ,W

MOVWF 0x2A MOVLW 0x40 MOVWF 0x2B CLRF 0x2E CLRF 0x2F MOVLW 0x45 CALL Label_2C MOVLW 0x52 CALL Label_2C MOVLW 0x52 CALL Label_2C MOVLW 0x4F CALL Label_2C MOVLW 0x52 CALL Label_2C MOVLW 0x2E CALL Label_2C MOVLW 0x2E CALL Label_2C MOVLW 0x2E CALL Label_2C MOVLW 0x2E CALL Label_2C MOVLW 0x0D CALL Label_2C MOVLW 0x0A CALL Label_2C MOVLW 0x32 CALL Label_1B GOTO Label_2D Label_24 BTFSC 0x39 BSF PORTB , 00 , 00

BTFSS 0x39 BCF PORTB

, 00 , 00 , 01 , 01 , 01 , 01 , 02 , 02 , 02 , 02 , 03 , 03 , 03 , 03 , 04

BTFSC 0x39 BSF PORTB

BTFSS 0x39 BCF PORTB

BTFSC 0x39 BSF PORTB

BTFSS 0x39 BCF PORTB

BTFSC 0x39 BSF PORTB

BTFSS 0x39 BCF BCF BSF BCF PORTB PORTB

STATUS , RP0 TRISB , 04

MOVLW 0x64 BCF STATUS , RP0

CALL Label_001B BSF BSF BCF BCF PORTB , 04

STATUS , RP0 TRISB , 04

STATUS , RP0

GOTO Label_2D Label_1E BSF BSF BCF BCF PORTB , 07

STATUS , RP0 TRISB , 07

STATUS , RP0

Label_1F GOTO Label_1E

END

A.2 Programming Code for Receiver Controller PIC 16F628


include P16F628.lib

GOTO Label_1 Label_D BSF STATUS , RP0

MOVWF EEADR BSF EECON1 , 00

MOVF EEDATA , W GOTO Label_2 Label_12 BSF STATUS , RP0

MOVWF EEDATA BSF EECON1 , 02

MOVLW 0x55 MOVWF EECON2 MOVLW 0xAA MOVWF EECON2 BSF EECON1 , 01

Label_3 BTFSC EECON1 , 01 GOTO Label_3 BCF EECON1 , 02

GOTO Label_2 Label_C CLRF 0x23 Label_13 MOVWF 0x22 Label_5 MOVLW 0xFF ADDWF 0x22 ,f

BTFSS STATUS , C ADDWF 0x23 ,f

BTFSS STATUS , C MOVLW 0x03 MOVWF 0x21

MOVLW 0xDF CALL Label_4 GOTO Label_5 CLRF 0x21 Label_4 ADDLW 0xE8 MOVWF 0x20 COMF 0x21 MOVLW 0xFC BTFSS STATUS , C GOTO Label_6 Label_7 ADDWF 0x20 ,f ,f

BTFSC STATUS , C GOTO Label_7 Label_6 ADDWF 0x20 CLRWDT INCFSZ 0x21 ,f ,f

GOTO Label_7 BTFSC 0x20 , 00

GOTO Label_8 Label_8 BTFSS 0x20 , 01

GOTO Label_9 NOP GOTO Label_9 Label_9 RETURN Label_E MOVWF 0x22 MOVLW 0x04 GOTO Label_A Label_A MOVWF 0x28 MOVF 0x23 SUBWF 0x21 ,W ,W

BTFSS STATUS , Z GOTO Label_B

MOVF 0x22 SUBWF 0x20 Label_B MOVLW 0x04

,W ,W

BTFSC STATUS , C MOVLW 0x01 BTFSC STATUS , Z BTFSS STATUS , Z MOVLW 0xFF GOTO Label_2 Label_2 BCF BCF BCF STATUS , IRP STATUS , RP1 STATUS , RP0

CLRWDT RETURN Label_1 MOVLW 0x07 MOVWF CMCON BSF STATUS , RP0

CLRF VRCON BSF OPTION_REG, NOT_RBPU

MOVLW 0xFF MOVWF TRISA CLRF TRISB MOVLW 0x64 BCF STATUS , RP0

CALL Label_C MOVLW 0x00 MOVF 0x39 MOVWF 0x21 MOVLW 0x0F MOVWF 0x23 MOVLW 0xA0 CALL Label_E ,W

BTFSS STATUS , Z GOTO Label_F GOTO Label_10 GOTO Label_11 Label_F INCF 0x38 ,f

BTFSC STATUS , Z INCF 0x39 BSF ,f

STATUS , RP0

CLRF EEADR BCF STATUS , RP0 ,W

MOVF 0x38 CALL Label_12 MOVLW 0x01 MOVWF 0x23 MOVLW 0xF4 CALL Label_13 BCF PORTA

, 04

Label_16 CLRWDT BTFSS PORTA GOTO Label_14 GOTO Label_15 Label_14 GOTO Label_16 Label_15 BTFSC PORTA BSF 0x3A , 00 , 04

, 00 , 00 , 00 , 01

BTFSS PORTA BCF 0x3A

BTFSC PORTA BSF 0x3A

, 01 , 01 , 01 , 02

BTFSS PORTA BCF 0x3A

BTFSC PORTA BSF 0x3A

, 02

BTFSS PORTA BCF 0x3A

, 02 , 02 , 03

BTFSC PORTA BSF 0x3A

, 03 , 03 , 03

BTFSS PORTA BCF 0x3A

MOVLW 0x64 CALL Label_C CLRWDT MOVF 0x3A SUBLW 0xF1 BTFSS STATUS , Z GOTO Label_17 CLRWDT BTFSC PORTB GOTO Label_18 BSF BSF BCF BCF PORTB , 00 , 00 ,W

STATUS , RP0 TRISB , 00

STATUS , RP0

GOTO Label_19 Label_18 BCF BSF BCF BCF PORTB , 00

STATUS , RP0 TRISB , 00

STATUS , RP0

Label_19 MOVLW 0x14 CALL Label_C GOTO Label_1A Label_17 CLRWDT MOVF 0x3A SUBLW 0xF2 BTFSS STATUS , Z ,W

GOTO Label_1B CLRWDT BTFSC PORTB GOTO Label_1C BSF BSF BCF BCF PORTB , 01 , 01

STATUS , RP0 TRISB , 01

STATUS , RP0

GOTO Label_1D Label_1C BCF BSF BCF BCF PORTB , 01

STATUS , RP0 TRISB , 01

STATUS , RP0

Label_1D MOVLW 0x14 CALL Label_C GOTO Label_1A Label_1B CLRWDT MOVF 0x3A SUBLW 0xF3 BTFSS STATUS , Z GOTO Label_1E CLRWDT BTFSC PORTB GOTO Label_1F BSF BSF BCF BCF PORTB , 02 , 02 ,W

STATUS , RP0 TRISB , 02

STATUS , RP0

GOTO Label_20 Label_1F BCF BSF BCF PORTB , 02

STATUS , RP0 TRISB , 02

BCF

STATUS , RP0

Label_20 MOVLW 0x14 CALL Label_C GOTO Label_1A Label_1E CLRWDT MOVF 0x3A SUBLW 0xF4 BTFSS STATUS , Z GOTO Label_21 CLRWDT BTFSC PORTB GOTO Label_22 BSF BSF BCF BCF PORTB , 03 , 03 ,W

STATUS , RP0 TRISB , 03

STATUS , RP0

GOTO Label_23 Label_22 BCF BSF BCF BCF PORTB , 03

STATUS , RP0 TRISB , 03

STATUS , RP0

Label_23 MOVLW 0x14 CALL Label_C GOTO Label_1A Label_21 CLRWDT MOVF 0x3A SUBLW 0xF5 BTFSS STATUS , Z GOTO Label_24 CLRWDT BTFSC PORTB GOTO Label_25 , 04 ,W

BSF BSF BCF BCF

PORTB

, 04

STATUS , RP0 TRISB , 04

STATUS , RP0

GOTO Label_26 Label_25 BCF BSF BCF BCF PORTB , 04

STATUS , RP0 TRISB , 04

STATUS , RP0

Label_26 MOVLW 0x14 CALL Label_C GOTO Label_1A Label_24 CLRWDT MOVF 0x3A SUBLW 0xF6 BTFSS STATUS , Z GOTO Label_27 CLRWDT BTFSC PORTB GOTO Label_28 BSF BSF BCF BCF PORTB , 05 , 05 ,W

STATUS , RP0 TRISB , 05

STATUS , RP0

GOTO Label_29 Label_28 BCF BSF BCF BCF PORTB , 05

STATUS , RP0 TRISB , 05

STATUS , RP0

Label_29 MOVLW 0x14 CALL Label_C GOTO Label_1A

Label_27 CLRWDT MOVF 0x3A SUBLW 0xF7 BTFSS STATUS , Z GOTO Label_2A CLRWDT BTFSC PORTB , 06 ,W

GOTO Label_2B BSF BSF BCF BCF PORTB , 06

STATUS , RP0 TRISB , 06

STATUS , RP0

GOTO Label_2C Label_2B BCF BSF BCF BCF PORTB , 06

STATUS , RP0 TRISB , 06

STATUS , RP0

Label_2C MOVLW 0x14 CALL Label_C GOTO Label_1A Label_2A CLRWDT MOVF 0x3A SUBLW 0xF8 BTFSS STATUS , Z GOTO Label_2D CLRWDT BTFSC PORTB GOTO Label_2E BSF BSF BCF BCF PORTB , 07 , 07 ,W

STATUS , RP0 TRISB , 07

STATUS , RP0

GOTO Label_2F Label_2E BCF BSF BCF BCF PORTB , 07

STATUS , RP0 TRISB , 07

STATUS , RP0

Label_2F MOVLW 0x14 CALL Label_C GOTO Label_A Label_2D GOTO Label_16 Label_1A MOVLW 0x01 MOVWF 0x23 MOVLW 0xF4 CALL Label_13 GOTO Label_16 Label_10 MOVLW 0xFF MOVWF PORTB Label_11 GOTO Label_10 Label_30 SLEEP GOTO Label_30

ORG

0x2100

DATA 0x01

END

A.3 Programming Code for PC Software

Private Sub Command1_Click () Led1.Visible = True MSComm1.Output = Chr (1) Else Led1.Visible = False MSComm1.Output = Chr (1) End Sub

Private Sub Command2_Click () Led2.Visible = True MSComm1.Output = Chr (2) Else Led2.Visible = False MSComm1.Output = Chr (2) End Sub

Private Sub Command3_Click () Led3.Visible = True MSComm1.Output = Chr (3) Else Led3.Visible = False MSComm1.Output = Chr (3) End Sub

Private Sub Command4_Click () Led4.Visible = True MSComm1.Output = Chr (4) Else

Led4.Visible = False MSComm1.Output = Chr (4) End Sub

Private Sub Command5_Click () Led5.Visible = True MSComm1.Output = Chr (5) Else Led5.Visible = False MSComm1.Output = Chr (5) End Sub

Private Sub Command6_Click () Led6.Visible = True MSComm1.Output = Chr (6) Else Led6.Visible = False MSComm1.Output = Chr (6) End Sub

Private Sub Command7_Click () Led7.Visible = True MSComm1.Output = Chr (7) Else Led7.Visible = False MSComm1.Output = Chr (7) End Sub

Private Sub Command8_Click () Led8.Visible = True MSComm1.Output = Chr (8) Else

Led8.Visible = False MSComm1.Output = Chr (8) End Sub

Private Sub Form_ Load () PWR.Status = False PWR.blink = False Option1.Value = True

Led1.Visible = False Led2.Visible = False Led3.Visible = False Led4.Visible = False Led5.Visible = False Led6.Visible = False Led7.Visible = False Led8.Visible = False End Sub

Private Sub MSComm1_OnComm ()

End Sub

Private Sub QUIT_ CMD_ Click () If MSComm1.PortOpen = True Then MSComm1.PortOpen = False PWR.blink = False End If End End Sub

Private Sub START_ CMD_ Click ()

If MSComm1.PortOpen = False Then If Option1.Value = True Then MSComm1.CommPort = 1 PWR.Status = True PWR.blink = True End If

If Option2.Value = True Then MSComm1.CommPort = 2 PWR.Status = True PWR.blink = True End If End If End Sub

Appendix B PCB Layouts & Screen Shots

B.1 PCB Layouts


B.1.1 PCB Layout for Transmitter Section (PCB 1)

B.1.2 PCB Layout for Receiver Section (PCB 2)

B.1.3 PCB Layout for Relay Driver (PCB 3)

B.2 Screen Shots


B.2.1 Screen Shot Of PC Software

Appendix C: Datasheet

2.3.1.1 PIC16F628 Controller


PIC16F628 Controller is ideal, this miniature controller, comes complete with the new Microchip PIC16F628A microcontroller and a host of useful peripherals. Ideal for those situations, when a full 40 pin controller is not necessary and a smaller compact controller will fit the job nicely. This board comes complete with LCD Connection, RS232 Communication, direct in-circuit program download and much more. The PIC16F628 Microcontroller includes 2kb of internal flash Program Memory, together with an internal EEPROM for storage of permanent values. Also included within the microcontroller are 2 analog comparators, 1 USART, 3 timers and a capture-compare module. Port connections are brought out to easy to connect standard IDCC connectors, for each connection and disconnection. A MAX232 is included for transferring data to and from a serial port connection, such as a computer or modem. All the necessary support components are included on the board, together with a Power and Programming LED for easy status indication. Plus reset switch for program execution. Programs can be updated and downloaded directly to the board, through the download connection on-board. A parallel port connection is required for program downloads. The new PIC16F628 Controller is the ideal mini-controller, where a low-cost, easy to use controller is required for the less intensive applications. This board is delivered ready-torun and can easily fit into an existing system or as the main controller for a variety of systems, including burglar alarms, remote sensors and much more.

Pin Description HT12D:

Table 5.2 Pin Description of Decoder

Decoder Timing:

Fig. 5.8 Decoder Timing

You might also like