office automation full report
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
project report tiger
Active In SP
**

Posts: 1,062
Joined: Feb 2010
#1
04-03-2010, 11:35 AM



.doc   OFFICE AUTOMATION.doc (Size: 346 KB / Downloads: 97)

OFFICE AUTOMATION
A PROJECT REPORT

OFFICE AUTOMATION
The embedded system is a combination of hardware, software and additional mechanical parts designed to perform a specific function. A good example is the ROAD TRAFFIC SYSTEM. Here the traffic signal changes periodically according to a predetermined program that is fed into the IC. So an embedded system is designed to do a specific task with in a given time repeatedly, endlessly and with or without human intervention.
The project and implimentation 'OFFICE AUTOMATION' is based on embedded technology that uses MICROCHIP'S PIC MICROCONTROLLER, PIC16F877 This has very much influence in industrial application. The chip is programmed according to the requirement of the user. Program coding is done using assembly language. Microchip's Integrated Development Environment MPLAB is used to simulate and assemble the written code.
New millennium gives importance to various advanced automation technologies in various phases of human life. The OFFICE AUTOMATION SYSTEM is a unique venture, which gives a complete automation and security for an office building. It not only automates various utilities but also saves a good amount of conventional electrical energy by switching off the electrical appliances, which is not effectively utilized. The equipment allows automation for doors, fan and lighting devices. So the main concern of this project and implimentation is conservation of the conventional electrical energy and its efficient usage and provides security of the office.
It monitors an authorized entry to the office with real time surveillance system. Active IR sensors sense the entering or leaving of persons to the office or from the office. An intelligent display gives the current count of the persons inside the office. Unwanted use of electrical equipments are monitored and controlled by sensors. Once the system is installed there is no need of any human interface except for the password entry. This reduces the chance of unauthorized entry and theft.
By using the micro controller the hardware expense is reduced. It is very simple to install and easy to maintain. This system is highly reliable, cost effective and compact in size. All these have been enhanced by the use of micro controller.

Submitted By:
AJITH K A MUHAMMED YOONAS SAJAD M A

CONTENTS
I. ABSTRACT
2. INTRODUCTION
3. BLOCK DIAGRAM
4. FLOW CHART
5. ABOUT PIC-THE BRAIN OF THE SYSTEM
6. WHY PIC IS USED
7. ABOUT PIC 16F87X
8. SYSTEM FEATURES
9. PROGRAM
10. CIRCUIT DIAGRAM
II. DATASHEET
12. CONCLUSION
13. BIBLIOGRAPHY
ABSTRACT
New millennium gives importance to various advanced automation technologies in various phases of human life. The automatic office management system is a unique venture, which gives a complete automation and security for any office building. It not only automates various utilities but also saves a good amount of power by switching off electrical appliances, which is not effectively utilized. The equipment allows automation for doors, fan and lighting devices.
It monitors unauthorized entry to the office with real time surveillance entry to the office with real-time arbitration process, allows precision and error free sensing of instructions. An intelligent display gives the current count of the people inside the office. Unwanted use of electrical equipments are monitored and controlled by built in light.
INTRODUCTION
The new millennium gives top priority for energy management and effective utilization of generated electrical power. It is studied that more than 40% of the total electrical power generated is wasted due to improper monitoring or consumption. As we see in most of the offices most of the electrical appliances like fan, lights will be left ON from day break to evening even if the personnel's are not in the infra red seta. It becomes difficult for them to switch it ON or OFF all the appliances before they leave or enter the office. As a result a huge amount of energy is wasted. Moreover the need ensuring security is receiving a vital importance in our day-to-day life. It is essential to ensure security in factories, banks, and confidential areas of research centers, power plants etc But now in these areas the task of maintaining security has become an enormous technological challenge. This project and implimentation provides efficient security and avoids the chance of unauthorized entry.
The office management system is a Novell network, which considers the above concepts and monitors inefficient use of electrical energy using embedded systems. Embedded system is one of the fast emerging trends in our day-to-day life, which has been given more importance and popularity since the past decade or two. It has taken into various fields of life. It ranges from small toys to sophisticated control and functioning of machines. Embedded system is basically a combination of hardware and software systems. Depending on the input received we can control or operate different output devices with the help of software written on to the system depending on our needs. These programs can then be upgraded for more functioning which will be needed later.
. With the help of an embedded system here a design for an office management is being developed. The main concern of the project and implimentation
is conservation of the conventional electrical energy and its efficient usage and provides security of the office. The core of the system is a flash memory programmed micro controller. The system
employs a variety of sensors, which are used to measure the different parameters inside the office, and they provide the information to the micro controller. The system provides a variety of sensors, which are used to measure the different parameters inside the office and they the information to the micro controller through their corresponding hardware. Main steps of the sensors used are for sensing the luminance, temperature, presence of occupants etc, depending on the status obtained from the sensors the micro controller decides to switch OFF . the electrical equipments like fans, lights, when they are not needed as they are pre-programmed on the micro controller. It also guards one office complex against unattached entries and causalities like fire.
All the sensors are suitably calibrated and give signals to the micro controller, which uses intelligence to control different devices. The entry is password protected. The programmed password is stored in EEPROM (non-volatile memory), which preserves the data when the system is un-powered. Once the system is installed there is no need of any human interface except for the password entry. This reduces the chance of unauthorized entry. This reduces the chance of unauthorized entry and theft.
7 SEGMENT DISPLAY
KEYBOARD
LDR
” DRIVER
FAN
” DRIVER
LIGHT
IR SENSOR 2
THERMISTOR
BLOCK DIAGRAM
FEATURES
> The system conserves conventional electrical energy.
> Provides security for the office.
> This system reduces the chance of unauthorized entry to the office and theft.
> Active IR sensors allow precision and error free sensing.
> An intelligent display gives the current count of the persons inside the office.
> Unwanted use of electrical equipments are monitored and controlled by sensors.
> System offers password protection.
> A 4x4 keyboard is used for entering password.
> It is simple to install and easy to maintain.
> This system is highly reliable and cost effective.
STUDY OF PIC MICROCONTROLLER
PIC micro devices are grouped by the size of their instruction word. The three current PIC micro families are:
Base-Line : 12-bit instruction word length Mid-Range : 14-bit instruction word length High-End : 16-bit instruction word length
DEVICE STRUCTURE
Each part of a device can placed into one of three groups:
1. Core
2. Peripherals
3. Special Features
THE CORE
The core pertains to the basic features that are required to make the device operate. These includes
1. Device Oscillator
2. Reset Logic
3. CPU(Central Processing Unit)
4. ALU(Arithmetic Logic Unit)
5. Device memory map organization
6. Interrupt Operation
7. Instruction set revision
PERIPHERALS
Peripherals are the features that add a differentiation from a microprocessor. These ease in interfacing to the external world (such as general purpose I/O, LCD drivers, A/D inputs, and PWM outputs),and internal tasks such as keeping different time bases(such as timers).The peripherals are:
1. TIMERO
2. TIMER 1
3. TIMER2
4. ADC
5. I/O PORTS
6. USART
7. CCP
SPECIAL FEATURES
Special features are the unique features that help to decrease system cost or increase system reliability or increase system flexibility. The PIC microcontrollers offer several features that help to achieve these goals. The special features discussed are:
1. Device configuration bits
2. On-chip Power-On Reset(POR)
3. Brown-Out Reset(BOR) LOGIC
4. Watchdog timer
5. Low power mode (sleep mode)
VDD
MCLR " INTERNAL PGR
PWR
PWRT TIME-O¬UT
OST
TIME-OUT
INTERNAL RESET
OSCILLATOR
The internal oscillator circuit is used to generate the device clock. The device clock is required for the device to execute instructions and for the peripherals to function. Four device clock periods generate one internal clock cycle. There are up to eight different modes which the oscillator may have. There are two modes which allows the selection of the internal RC oscillator clock out (CLK OUT) to be driven on an I/O pin, or allow that I/O pin to be used for a general purpose function. The oscillator mode is selected by the device configuration bits. The device configuration bits are nonvolatile memory locations and the operating mode is determined by the value written during device programming. The oscillator modes are:
1 LP Low frequency (Power) Crystal
2 XT Crystal / Resonator
3 HS High Speed Crystal / Resonator
4 RC External Resistor / Capacitor (same as EXTRC with CLKOUT)
5 EXTRC External Resistor / Capacitor
6 EXTRC External Resistor / Capacitor with CLKOUT
7 INTRC Internal 4MHz Resistor / Capacitor
8 INTRC Internal 4MHz Resistor / Capacitor with CLKOUT
STATUS REGISTER
Bit 7
addressing)
IRP: Register Bank Select Bit (used for indirect
l=Bank 2, 3 (lOOh-lFFh) 0=Bank 0, 1 (lOOh-FFh)
For devices with only Bank 0 and Bank 1 the IRP bit is reserved, always maintains this clear
Bit 6: 5 addressing)
RP1: RPO: Register Bank Select Bits (used for direct
1 1 = Bank 3 (180h-lFFh) 1 0 = Bank2(100h-17Fh) 0 1 = Bank 1 (80h-FFh) 0 0 = Bank 0 (00h-7Fh)
Each bank is 128 bytes. For devices with only Bank 0 and Bank 1 the IRP bits is reserved, always maintain this bit clear.
Bit 4
instruction
TO: Time-Out bit
1 = after power up, CLRWDT instruction or sleep 0 = A WDT time out occurred.
Bit 3
PD: Poer-Down bit
1 = after power up or by the CLRWDT instruction.
-9-
0 = by execution of the SLEEP instruction.
Bit 2 zero. Z: Zero bit
1 = the result of an arithmetic or logic operation is zero. 0 - the result of an arithmetic or logic operation is not
Bit 1 DC: Digit carry / Borrow bit
(ADDWF, ADDLW, SUBWF, SUBLW instructions) (for borrow the polarity is reserved)
1 = A carry out from the 4th low order bit of the occurred. 0 = No carry out from the 4th low order bit of the result.
BitO C: Carry / Borrow bit (ADDWF, ADDLW, SUBWF, SUBLW instructions)
1 = A carry out from the most significant bit of the result occurred.
0 = No carry out from the most significant bit of the result occurred (means the result is negative)

ARCHITECTURE
The high performance of the PIC micro devices can be attributed to a number of architectural features commonly found in RISC microprocessors.
1 Hardware architecture
2 Long word instructions
3 Single word instructions
4 Single cycle instruction
5 Instruction pipelining
6 Reduced instruction set
7 Register file architecture
8 Orthogonal (symmetric) instructions




OPTION REG REGISTER
The OPTION_REG register is a readable and writable register which contains various control bits to configure the TMRO / WDT prescalar ,the external INT interrupt ,TMR0 ,and the weak pull-ups on PORT B.
R/W-l R/W-l
R/W-
R/W-
R/W-
R/W-l
R/W-
R/W-
Bit 7
RBPU: PORT B Pull-Up Enable bit 1 = PORT B pull ups are disabled
0 = PORT B pull ups are enabled by individual port latch
values
Bit 6
INTEDG: Interrupt Edge Select bit 1 = Interrupt on rising edge of INT pin
0 = Interrupt on falling edge of INT pin
Bit 5 TOCS: TMRO clock Source Select bit
1 = Transition on TOCK1 pin
0 = Internal instruction cycle clock (CLKOUT)
Bit 4 TOSE: TMRO Source Edge Select bit
1 = Increment on high-to4ow transition on TOCK1 pin
0 = Increment on low-to-high transition on TOCK1 pin
Bit 3 PSA: Prescalar Assignment bit
1 = Prescalar is assigned to the WDT
0 = Prescalar is assigned to the Timer 0 module
Bit 2-0 PS2-PS0: Prescalar rate select bits
PS2 PS 1. TMRO Rate WDT Rate
PSO
0 0 0 1:2 1:1
0 0 1 1:4 1:2
0 1 0 1:8 1:4
0 1 1 1:16 1:8
1 0 0 1:32 1:16
1 0 1 1:64 1:32
1 1 0 1:128 1:64
1 1 1 1:256 1:128
PRIGRAM MEMORY ORGANIZATION
Mid-range MCU devices have 13-bit program counter capable of addressing an 8K * 14 program memory space. The width of the program memory bus (instruction word) is 14-bits.Since all the instructions are a single word, a device with an 8K * 14 program memory has space for 8K of instructions. This makes it much easier to determine if a device has sufficient memory for desired application. This program memory space is divided into four pages of 2K words each (0h-7FFh,800h-FFFh,1000h-17FFh,and 1800h-lFFh).Figure shows the program memory map as well as the 8 level deep hardware stack. To jump between the program pages, the high bits of the Program Counter (PC) must be modified. This is done by writing the desired value into a special function register called PCLATH (Program Counter Latch High).If sequential instructions are executed, the PC will cross the page boundaries without any user intervention.
DATA MEMORY ORGANIZATION
Data memory is made up of the Special Function Registers (SFR) area, and the General Purpose Registers (GPR) area. The SFRs controls the operation of the device, GPRs are the general area for data storage and scratch pad operations. The data memory is banked for both SFRs and GPR areas. GPR area is banked to allow greater than 96 bytes of general purpose RAM to be addressed. FRS is for the registers that control the peripheral and core functions. Banking requires the use of control bits for bank selection. These control bits are located in the STATUS register (STATUS <7:5>).The entire data memory can be accessed either directly or indirectly. Direct addressing may require the use of the RP1:RP0 bits. Indirect addressing uses the Indirect Register Pointer (IRP) bit of the STATUS register for accesses in the Bank O/Bank 1 or the Bank 2/Bank 3 areas of data memory.
BANKING
The data memory is partitioned into four banks. Each bank contains GPRs and SFRs. Switching between these banks requires the RPO and RP1 bits in the STATUS register to be configured for each bank extends up to 7Fh (128 bytes).The lower locations of each bank are reserved for the
SFRs. Above the Special Function Registers are the General Purpose Registers. All data memory is implemented as static RAM. Some high use SFRs from Bank 0 are mirrored in the other banks for core reduction and quicker access.
PORTS
General purpose I/O pins can be considered the simplest of peripherals. They allow the PIC to monitor and control other devices. To add flexibility and functionality to a device, some pins are multiplexed with an alternate function(s).In general when a peripheral is functioning, that pin may not be used as a general purpose I/O pin. For most ports ,the I/O pin's direction (input or output) is controlled by the data direction register ,called TRIS register .TRIS <x> controls the direction of PORT<x> .A '1' in the TRIS bit corresponds to that pin being an input .while a '0' corresponds to that pin being an output. The PORT registers are the latch for the data to be output. When the PORT is read, the device reads the levels present on the I/O pins.
PORT A and TRISA REGISTER
The RA4 pin is a Schmitt Trigger input and an open drain output. All other RA port pins have TTL input levels and full CMOS output drivers. All pins have data direction bits (TRIS register) which can configures these pins as output or input. Setting a TRISA register bit puts the corresponding output driver in a high impedance mode. Clearing bit in the TRISA register puts the contents of the output latch on the selected pin(s).
PORT B and the TRISB REGISTER
PORTB is an 8-bit wide bidirectional port. The corresponding data direction register is TRISB. Setting a bit in the TRISB register puts the corresponding output driver in a high impedance input mode. Clearing a bit in the TRISB register puts the contents of the output latch on the selected pin(s).
PORTC and the TRISC REGISTER
PORTC is an 8-bit bidirectional port. Each pin is individually configurable as an input or output through the TRISC register. PORTC pins have Schmitt Trigger input buffers. When enabling peripheral functions, care should be taken in defining TRIS bits for each PORTC pins. Some peripherals override the TRIS bit to make a pin an input.
PORTD and the TRISD REGISTER
PORTD is an 8-bit bidirectional port. Each pin is individually configurable as an input or output through the TRISD register.
PORTE and the TRISE REGISTER
PORTD is an 8-bit bidirectional port. Each pin is individually configurable as an input or output through the TRISE register.
PROGRAMMABLE INTERFACE CONTROLLER [PIC1
WHY PIC IS USED SPEED:
When operated at its maximum clock rate, a PIC executes most of its instructions in .2 micro seconds or 5 instructions per microseconds.
HIGH PERFORMANCE RISC CPU
INSTRUCTION SET SIMPLICITY
The instruction set consists of just 35 instructions.
INTEGRATION OF OPERATIONAL FEATURES
Power on reset and brown out protection ensure that the chip operates only when the supply voltage is within specification; a watchdog timer resets the PIC if the chip ever malfunctions and deviates from its normal operation. Any one of four clock options can be supported, including a low cost RC oscillator and a high accuracy crystal oscillator.
PROGRAMMABLE TIMER OPTIONS:
Three versatile timers can be characterized inputs, control outputs and provide internal timing for program executions.
INTERRUPT CONTROL:
Uptol2 independent interrupt sources, which can provide useful interrupting as when needed.
EPROM /OTP /ROM OPTIONS:
Ultraviolet erasable, programmable parts support development. Both small and lower cost one time programmable parts supports large production runs.
INBULT MODULES:
The PIC microcontroller has a number of inbuilt modules such as ADC, USART that increases versatility of micro controller.
LOW POER CONSUMPTION:
WIDE OPERATING VOLTAGE RANGE: 2.5 TO 6.0 V
PROGRAMMABLE CODE PROTECTION MODE: POWER SAVING SLEEP MODE:
PIC16F87X

1. High Performance CPU
2. Only 35 Instructions
3. All single cycle instructions expect program branches operating speed : DC20 MHz ,clock input: DC200ns instruction cycle
4. Up to 8K * 14 words of flash program memory Up to 368 * 8 bytes of data memory (RAM) Up to 256 * 8 bytes of EEPROM data memory
5. Pin out compatible to the PIC 16C73B/74B/76/77
6. Interrupt compatibility (up to 14 sources)
7. Power-on reset (POR)
8. Power-up timer (PWRT) and oscillator startup timer (OST)
9. Watch dog timer (WDT) with its own on-chip oscillator for reliable operation.
10.Programmable code protection power saving sleep mode 11.Low-power ,High speed CMOS Flash-EEPROM technology 12.In circuit serial programming (ICSP) VIA two pins 13.Single 5V in circuit serial programming capability 14.1n-circuits debugging VIA two pins 15.Processor read/write access to program memory 16. Wide operating voltage range 17.High sink or source current 18.Low power consumption
PIN OUT OF PIC16F877A
PDIP
<NOT>MCLR/Vpp/THV RAO/AN 0
RA1/AN1
RA2/AN2/Vref-
RA3/AtJ3Mef+
RA4/T0CKI
RA5/AN4/<N0T>SS
RE0/<NOT>RD/AN5
RE1/<N0T>WR/ANG
RE2/<NOT>CS/AN7
Vdd
Vss
0SC1/CLKIN
0SC2/CLK0UT
RCM10S0/T1CKI ¦
RC1/T10SI-/CCP2
RC2/CCP1
RC3/SCK./SCL
RDO/PSPO
RD1/PSP1
PIC16F877
SYSTEM FEATURES
1 PASSWORD PROTECTION
2 SENSORS
3 RELAYS
4 KEYBOARD
5 DISPLAY
6 VISUAL INDICATION
PASSWORD PROTECTION
The system is fully password protected. A four digit password is used for the system. The password of the authorized persons is previously stored in the EEPROM. Only by the entry of the valid password the access into the room is accepted otherwise it will set out an alarm. On the entry of the password we get a single beep which indicates that the password entered is correct and the relay connected to the door latch is made to open immediately, which makes the door open. There is a provision of three trials for entering the password beyond which an alarm is setout which indicate that an attempt for entry by an unauthorized person.
SENSORS
As explained earlier, the system's main consideration is effective power management.
For this it has to monitor and measure different parameters within the office so as to give the corresponding intelligence to the microcontroller which makes different decisions which in turn controls the different electrical appliances inside the office .For this we use different sensors for measuring different parameters. The different types of sensors used are infrared diodes, temperature and light dependant resistors. All the above sensors used here are highly sensitive and have correctness in the infrared outputs, which is very reliable. Each of them is calibrated according to our needs.
INFRARED DIODES
Infrared diodes are similar to the normal diodes. Infra red diodes emit infrared rays instead of light in the case of LEDs. In this system they are used for finding count of the persons entering or leaving the room. Here two infrared diodes are used named infrared A and infrared B. They are placed immediately after the door. The sensor near to the door is taken as sensor A and that placed far from the door is taken as sensor B. the sensor A and B are placed at a distance of about lm. The infrared diodes acts as a transmitter circuit and the photo detectors are placed at the other end of the infrared diodes, which acts as the receiver circuit. The rays from the infrared diodes are focused on to the photo diodes. Whenever the ray cuts between infrared diode and photo diode, a signal is given to the microcontroller. An entry is detected when the sensor A cuts first and then sensor B. Otherwise an exit is detected if sensor B cuts first and then sensor A.
LIGHT DEPENDING RESISTOR
Another sensor used in this system is LDR, which detects the illumination in a particular area. In presence of light the resistance of the sensor goes into a range of mega ohms. In the absence of light the resistance of the sensor falls to a few ohms thereby changing the conductivity of current. The LDR is suitably calibrated such a way that if the luminance inside the room is below a specified value it gives out a signal to the microcontroller, which takes the decision 'put ON the light'.
RELAYS
Relays are used here as driver for the different electrical appliances so as to make the device ON or OFF. The help of relays can provide sufficient amount of isolation for the system from the line voltage. Since the microcontroller cannot directly provide sufficient drive to the relays 12v supplies are used for driving he relays.
KEYBOARD
This is the only human machine interface of the system. The keyboard is normally a 3*4 matrix type. Normally a telephone keypad is used. The keypad has an electronic circuitry to determine which key is pressed. Then a standard 8-bit code is generated and sends to the PIC. Detecting which key is pressed and generating the corresponding code is known as encoding. Here it is used for the password entry and it's editing.
DISPLAY
This system uses three segment dynamic displays for displaying the number of persons inside the room in the run mode. Whenever the infrared rays are cut which detect an entry or exit it gives the signal the signal to the microcontroller, which in turn decrements a register. This count is converted to decimal format by the subroutine and is displayed on to the displays.
INDICATIONS
VISUAL INDICATIONS
There are five different LEDs.
1. Keyboard check
2. Right password
3. Wrong password
4. Light
5. Fan
KEY BOARD
Key board is the only human interface to the system. Here we are using a numeric key pad .An employee enters his password through this key board .Key board is interfaced to the system through PORTB.RB0-RB3 are configured as output. Remaining pins are configured as input.
fig: keyboard connection
Pressing a key causes a change in the amount of current flowing in the circuit associated with that key. By detecting the increase and decrease in current the microcontroller that is constantly scanning the keyboard can detect when a key is pressed and when it has been released. Here we initially place zero to one of the row and one to all columns. Then we read the columns. When any one of the key is pressed the corresponding column value goes low and the key press is detected. The value given to the row is rotated and the above process continues until a key press is detected.
7 SEGMENT DISPLAY
Avery common requirement in modern electronics is that of displaying alphanumeric characters. Digital watches, calculators, digital multimeters are examples of devices that make use of such displays. The best known type of alphanumeric display is the seven segment display that consists of seven independently accessible photoelectric segments such as LEDs or LCDs arranged in the form shown in the figure.
fig: seven segment display
The segments are named from a to g in the manner shown in figure and it is possible to display any number from 0 to 9 or alphabetic character from A to F by activating the signals to various combinations to produce a one, segments b and c are energized; to produce a 2 ,segments a, b, g, e, and d are use d; and so on
One common type of seven segment display consists of LEDs .Each segment is an LED that emits light when current flows through it. There are two types of displays available - common anode arrangement and common anode arrangement. Common anode arrangement requires a driving circuit to provide a LOW level voltage in order to activate a given segment. When a LOW is applied to a segment input, the LED is forward biased and current flows through it.
The common cathode arrangement requires a driving circuit to provide a high level voltage in order to activate a given segment. When a HIGH is applied to a segment input , the LED is forward biased and current flows through it.
fig: common cathode internal wiring
A
DIODE PLACEMENT IN A SEVEN SEGMENT DISPLAY, NO DECIMAL
There are two types of displays available, common anode and common cathode. The wiring for a common anode is shown below.
1
COMMON ANODE INTERNAL WIRING
The truth table shown below is used to confirm that the digital signal sent to the display lights up the correct segment.
TRUTH TABIF
Inputs Outputs
LE BI LT D c B A a b c d a f 9 Display
X X 0 X X X X 1 1 1 1 1 1 1 8
X C X X x X 0 0 c 0 0 c 0 Blank
0 1 1 0 0 0 0 1 1 1 1 1 1 0 0
0 1 1 0 0 0 1 0 1 1 0 0 0 0 1
0 1 1 0 0 1 1 1 1 1 1 0 0 1 2
0 1 1 0 0 1 1 1 1 1 1 0 0 1 3
0 1 1 0 1 0 0 0 1 1 0 0 1 1 4
0 1 1 0 1 0 1 1 0 1 1 0 1 1 5
0 1 1
i 0 1 1 0 0 0 1 1 1 1 1 6
0 1 A 0 1 1 1 1 1 1 0 0 0 0 7
0 1 1 1 0 0 0 t 1 ! 1 1 1 1 8
0 1 1 1 D 0 1 1 1 1 0 IJ 1 1 y
0 1 1 0 1 0 0 0 0 0 0 0 0 Blank
0 1 % 1 0 1 1 0 0 6 0 0 0 0 Blank
0 1 I 1 1 0 0 0 0 0 0 0 0 0 Blank
0 1 1 1 1 0 1 0 0 0 0 0 0 ft Blank
0 1 1 1 1 1 0 0 0 0 0 0 0 0 Blank
0 1 1 1 1 1 1 0 0 0 0 0 G 0 Blank
1 1 1 X X X X * +
X - Doi^'t Care
'Depencs upon the BCD code previously applied when IE = 0
INTERNAL CIRCUITRY AND LOGIC GATES FOR 7 SEG DISPLAY
TRUTH TABLE FOR THE SEVEN-SEGMENT DISPLAY The internal circuitry and logic gates for the display is shown below.
The wiring for the common cathode is shown below.
X
COMMON CATHODE INTERNAL WIRING
To convert the binary numbers to signals that can drive the L.E.D.s in the display you need a display driver. In the lab we use an MC14511 chip. The pinouts are shown below.
16_ 15
D-

-a
-a
14
13
12
”fc
[> -
11
-n
-s'
10
9 a
U17
B Vcc
C f
LT g
Bl a
LE b
D
c
A d
GND e
MC14511
PINOUTS FOR THE MC14511 SEVEN-SEGMENT DISPLAY DRIVER
A, B, C, and, D are the binary inputs.
a, b, c, d, e, f, and g are the driver signals to the display elements. LT is the Light Test control, turns all segments on, active low. BL blanks all the segments when activated, active low. LE is the latch enable control.
The specific seven-segment display used in lab is an LN513RK. The schematic below is similar to the one you will use in lab.
vcc
o-
16
13 12 1 1 10
LT
Bl
14
GND
MCI 46114s

b

c d
t ¢ AM
la I o CAT2
g
LDP l.« 11
RDI-'
SEVSEG
SEVEN SEGMENT DISPLAY WITH DISPLAY DRIVER
To have the driver convert the binary input to signals ready for the display, tie pin 3, LT, and pin 4, Bl, to VCC. Connect pin 5, LE, to ground. In this configuration what ever the binary inputs at A-D are will be converted and the display will show the decimal equivalent.
COUNTING 0-9
CL
C.L.K CO
LD
TE
PL
P4 Q1
P3 Q2
P Q3
P1 Q4
1Y 1A
1B
1C
ID
2A
2Y 2B
2C
20
a
b

c
d
e f CAT4
CAT3 CAT2 CAT1

LDP RDP
0-9 COUNTING CIRCUIT
The start of this circuit is the MC14161 binary counter. The function generator is connected to the clock input to start the counting cycle. The MC14012 NAND gate monitors the output of the binary counter. When the count equals 9 the output of the NAND gate sends a signal to the load control, LD, on the counter to load the values on P1-P4, in this case the number zero. As the counter is incrementing from 0-9 the driver signal is constantly updating the display and turning on and off the appropriate segments.
If need be you could use a 555 timer circuit in place of the function generator.
I
SET R 1=0 R2=0 R3=0 R4=0 R5=0 .LED ON
INCREMENT COUNT DECREMENT COUNT
1 1 r
CONVERT COUNT FROM HEX TO DECIMAL.
DISPLAY
COUNT
£ J.
Y
FAN ON
H LIGHT OFF
r «
PROGRAM
;.Program for office automation
LIST P=PIC16F877
11 #INCLUDE"P16F877.INC"
II II II
CBLOCK 0X20 XI X2 X3 X4 Yl Y2 Y3 Y4
Rl ;declaring registers
I R2
R4 R5 CI R6 REG SI S2 Tl S10 Sll ENDC
ORG 0 ; starting of the program
NOP NOP NOP
GOTO BEGIN LOOK ADDWF PCL,1
RETLW B'01111110'
RETLW B'01100000'
RETLW B'10110110'
I RETLW B'10011110'
RETLW B'l 1001100'
RETLW B'l 1011010' ;lookup table for seven-segment display RETLW B'l 1111010'
RETLWB'00001110' RETLW B'l 1111110'
» li
I II ll II ll i|
I
I I
I
I
RETLW B'l 1011110' BEGIN CLRF PORTB CLRF PORTA CLRF PORTC CLRF PORTD CLRF PORTE CLRF SI CLRF R4 CLRF R5 CLRF R6 CLRF Tl CLRF R4 CLRF R5 CLRF R6 MOVLW D'09' MOVWF XI MOVLW D'05' MOVWF X2 MOVLW D'OF MOVWF X3 MOVLW D'03' MOVWF X4 BCF STATUS,6 BSF STATUS,5 MOVLW B'l 1110000' MOVWF TRISB BCF OPTION REG,7 BCF TRISA,5 MOVLW 0X07 MOVWF ADCON1 BCF STATUS,6 < BCF STATUS,5 MOVLW B'00001111' MOVWF PORTB CLRF PORTA CLRF PORTB CLRF PORTC
clearing PORTS
;storing user password
Configuring PORT B as half input and half o/p
CLPvF PORTD CLRF PORTE
BSF PORTA,5 MOVLW B'l 1110111* MOVWF PORTB BTFSS PORTB,4 GOTO ONE BTFSS PORTB,5 GOTO TWO BTFSS PORTB,6 GOTO THREE
MOVLW B'l 111 1011' MOVWF PORTB BTFSS PORTB,4 GOTO FOUR BTFSS PORTB,5 GOTO FIVE BTFSS PORTB,6 GOTO SIX MOVLW B'l 1111101' MOVWF PORTB BTFSS PORTB,4 GOTO SEVEN BTFSS PORTB,5 GOTO EIGHT BTFSS PORTB,6 GOTO NINE MOVLW B'l 1111110' MOVWF PORTB BTFSS PORTB,5 GOTO ZERO BTFSS PORTB,7 GOTO ENTER GOTO START BTFSS PORTB,4 GOTO ONE MOVLW D'01' MOVWF Rl
;checking for pressing one ;checking for pressing two ;checking for pressing three
;checking for pressing four ;checking for pressing five ;checking for pressing six
;checking for pressing seven ;checking for pressing eight ;checking for pressing nine
;checking for pressing zero ;checking for pressing enter
;storing the number,blinking LED,exchang
CALL BLINK CALL EXCHANGE GOTO START BTFSS PORTB,5 GOTO TWO MOVLW D'02' MOVWF Rl CALL BLINK CALL EXCHANGE GOTO START
BTFSS PORTB,6 GOTO THREE MOVLW D'03' MOVWF Rl CALL BLINK CALL EXCHANGE GOTO START
BTFSS PORTB,4 GOTO FOUR MOVLW D'04' MOVWF Rl CALL BLINK CALL EXCHANGE GOTO START
BTFSS PORTB,5 GOTO FIVE MOVLW D'05' MOVWF Rl CALL BLINK CALL EXCHANGE GOTO START BTFSS PORTB,6 GOTO SIX MOVLW D'06' MOVWF Rl CALL BLINK
;storing the number,blinking LED,exchanging
;storing the number,blinking LED,exchanging
;storing the number,blinking LED,exchanging
;storing the number,blinking LED,exchanging
;storing the number,blinklng LED,exchanging
CALL EXCHANGE GOTO START
BTFSS PORTB,4 GOTO SEVEN MOVLW D'07'
MOVWF Rl ;storing the number,blinking LED,exchanging
CALL BLINK CALL EXCHANGE GOTO START
BTFSS PORTB,5 GOTO EIGHT MOVLW D'08'
MOVWF Rl ;storing the number,blinking LED,exchanging
CALL BLINK CALL EXCHANGE GOTO START
BTFSS PORTB,6 GOTO NINE MOVLW D'09'
MOVWF Rl ;storing the number,blinking LED,exchanging
CALL BLINK CALL EXCHANGE GOTO START
BTFSS PORTB,5 GOTO ZERO MOVLW D'OO'
MOVWF Rl ;storing the number,blinking LED,exchanging
CALL BLINK
CALL EXCHANGE
GOTO START
BTFSS PORTB,7
GOTO ENTER
CALL BLINK
MOVFX1,0
SUBWF Y1,0
BTFSS STATUS,2 GOTO START MOVF X2,0 SUBWF Y2,0 BTFSS STATUS,2 GOTO START MOVF X3,0 SUBWF Y3,0 BTFSS STATUS,2 GOTO START MOVF X4,0 SUBWF Y4,0 BTFSS STATUS,2 GOTO START GOTO OPEN
;checking the entered password
;wrong password,reentering password ;opening the door
BLINK BCF STATUS,6 BSF STATUS,5 BCF TRISA,5 BCF STATUS,6 BCF STATUS,5 BSF PORTA,5 BCF STATUS,6
BSF STATUS,5 ;blinking LED for a keypress
MOVLW B'00000111' MOVWF OPTIONREG BCF STATUS,6 BCF STATUS,5
MOVLW D'01' ;delay for LED
" MOVWF TMRO
XX MOVF TMR0,0
BTFSS STATUS,2
GOTO XX
BCF PORTA,5
RETURN EXCHANGE MOVF Y2,0
MOVWF Yl
MOVF Y3,0
MOVWF Y2 MOVF Y4,0
MOVWF Y3 exchanging the entered password
MOVF R 1,0 MOVWF Y4 RETURN
BCF STATUS,6 BSF STATUS,5
BCF TR.I SA, 1 ;opening the door
BCF STATUS,6 BCF STATUS,5 BSF PORTA, 1
; SENSING SECTION BCF STATUS,6 BSF STATUS,5 BCF TRISC,2 BSF TRISD,0 BSF TRISC.4 BCF STATUS,6 BCF STATUS,5 BSF PORTC,2 BCF STATUS,6 BSF STATUS,5 MOVLW B'OOOOOlll' MOVWF OPTION REG BCF TRISE,2 BCF STATUS,6 BCF STATUS,5 MOVLW D'15' MOVWF REG MOVLW DT' MOVWF TMRO MOVF TMR0,0 BTFSS STATUS,2 GOTO BD DECFSZ REG,1 GOTO LAS
BSF PORTE,2 CALL DISPLAY BCF STATUS,6 BSF STATUS,5 BSF TRISD,0 BSF TRISC,4 BCF STATUS,6 BCF STATUS,5 CALL DISPLAY BTFSC PORTD,0 GOTO ZZ CALL DELAY 1 BTFSS PORTD,0 GOTO AA GOTO ZZ CALL DISPLAY BTFSC PORTC,4 GOTO AA CALL DELAY 1 BTFSC PORTC,4 GOTO AA INCF Sl,l CALL DELAY5 CALL DISPLAY GOTO ZZ CALL DISPLAY BTFSC PORTC,4 GOTO YY CALL DELAY 1 BTFSS PORTC,4 GOTO BB GOTO YY CALL DISPLAY BTFSC PORTD,0 GOTO BB CALL DELAY 1 BTFSC PORTD,0 GOTO BB MOVF S1,0
displaying count ; checking for entry
;checking for entry
;checking for entry
; checking for entry incrementing sensing register
;checking for exit ;checking for exit
;checking for exit ;checking for exit
BTFSC STATUS,2 GOTO CLOSE MOVWF SI
DECF S1,1 ;decrementing sensing registor
CALL DELAY5 CALL DISPLAY GOTO YY DELAY 1 BCF STATUS,6 BSF STATUS,5 MOVLW BT 0000111' MOVWF OPTION REG BCF STATUS,6 BCF STATUS,5
MOVLW D'254' ;20 micro second delay
MOVWF TMRO
CC MOVF TMR0,0
BTFSS STATUS,2
GOTO CC
RETURN DISPLAY CLRFR4
CLRF R5
CLRF R6
BCF STATUS,6
BSF STATUS,5
MOVLW B'00000001'
MOVWF TRISD
MOVLW B'00011011' ;hex to decimal conversion
MOVWF TRISC
BCF STATUS,6
BCF STATUS,5
MOVLW DT 00'
MOVWF S2
CLRF R4
MOVF S1,0
MOVWF Sll
DD MOVF S2,0
SUBWF SI 1,1 INCF R4,l BTFSC STATUS,0
II II
II
EE
SS
GOTO DD DECF R4,l MOVLW 0X64 ADDWF SI 1,1 MOVLW 0X0A MOVWF S2 CLRF R5 SUBWF SI 1,1 INCF R5,l BTFSC STATUS,0 GOTO EE DECF R5,l ADDWF SI 1,0 MOVWF R6 MOVLW D'5' MOVWF S10 BCF STATUS,6 BSF STATUS,5 BCF TR1SC,5 BCF TRISC,6 BCF TRISC,7 BCF STATUS,6 BCF STATUS,5 BSF PORTC,5 BCF PORTC,6 BCF PORTC,7 MOVF R4,0 CALL LOOK MOVWF PORTD CALL DELAY2 BCF PORTC,5 BCF PORTC,7 BSF PORTC,6 MOVF R5,0 CALL LOOK MOVWF PORTD CALL DELAY2 BCF PORTC,6 BCF PORTC,5
;displaying 5 times
displaying count on 7 segment
II II II
BSF PORTC,7 MOVF R6,0 CALL LOOK MOVWF PORTD CALL DELAY2 BCF PORTCJ BCF PORTC,6 BCF PORTC,5 DECFSZ SI0,1 GOTO SS NOP
l| I
BCF PORTE,0
BCF PORTE, 1
MOVF S1,0
BTFSC STATUS,2
II RETURN
BCF STATUS,6
BSF STATUS,5
BCF TRISE,0
BCF TRISE, 1
BSF TRISA,0
MOVLW 0X07
MOVWF ADC ON 1 ;ADC for temperature sensing
BSF TRISA,4
BSF TR1SA,0
BCF STATUS,6
BCF STATUS,5
MOVLW B'l0000001'
MOVWF ADCON0
I BCF STATUS,6
BSF STATUS,5 MOVLW B'00000111' MOVWF ADCON1 MOVLW B'l0000111' MOVWF OPTION REG BCF STATUS,6 BCF STATUS,5
MOVLW D'255' ;30 micro second delay
MOVWF TMR0
MOVF TMR0,0 BTFSS STATUS,2 GOTO FF BSF ADCON0,2 BTFSC ADCON0,2 GOTO $-1 MOVF ADRESH,0 MOVWF Tl MOVLW D'30'
SUBWFT1,0
BTFSC STATUS,0 ;temperature checking
GOTO ON GOTO OFF
BSF PORTE,0 GOTO LIGHT
BCF PORTE,0 GOTO LIGHT
;powering on fan
;powering off fan
BTFSS PORTA,4 ;checking light
GOTO ONL GOTO OFFL
BSF PORTE, 1 ;powering on the light
GOTO RED
BCF PORTE, 1 ;powering off the light
GOTO RED
NOP
RETURN
BCF STATUS,6 BSF STATUS,5 MOVLW B* 10000111' MOVWF OPTION REG BCF STATUS,6
BCF STATUS,5 MOVLW D'250' MOVWF TMRO
; 1 millisecond delay
RR MOVF TMR0,0
BTFSS STATUS,2 GOTORR NOP RETURN
CLOSE BCF STATUS,6 BSF STATUS,5 BCF TRISA,1 BCF TRISE,0
BCF TRISE,10 ;closing door,fan and light
BCF STATUS,6
BCF STATUS,5
BCF PORTA, 1
BCF PORTE,0
BCF PORTE, 1
GOTO YY
DELAY5: BCF STATUS,5 ;500M SEC DELAY
MOVLW D'6'
MOVWF CI AGAIN2: MOVLW DT
MOVWF TMRO
BSF STATUS,5
MOVLW B'00000111'
MOVWF OPTIONREG
BCF STATUS,5
MOVF TMR0,0
BTFSS STATUS,2
GOTO $-2
DECFSZCU
GOTO AGAIN2
RETURN
NOP
END
CONCLUSION AND FUTURE SCOPE
When live in a dynamic world of fast changing technical frontiers, the conventional systems are being replaced by sophisticated and advanced technologies. Keeping the latest and trends I mind, the designed product is an innovative one to facilitates the automation requirements of an office.
/
The drawbacks of the existing manual system in our offices, which involves wastage of electricity due to in efficient operation of fans and lights, can be solved.
The salient features of the system are
¢ Entry and Exit check
¢ Switching ON and OFF of lights and fans as required
¢ It can be easily developed and programmed to fit the requirements of different offices
The scope of future lies in the fact that we have not considered that the centralized light and fan system can be made decentralized on the basis of the number of chairs occupied in the office.
The system is expected to be widely accepted due to technical efficiency and adaptable nature.
REFERENCES
1."Design with PIC Microcontrollers" John B. Peatmann, 5th Indian reprint
2."Assembly language programming with PIC" B. J. Haris and Wolf, Penram
|l International Publications
|| 3. picbook.com
4.atnel.com
v 5. microchip.com
|| 6.microcontroller.com
, 7.electronicsforyou.com
li II II
I! i
II II
l|
I i
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page

Quick Reply
Message
Type your reply to this message here.


Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  PHS BASED ONLINE VEHICLE TRACKING SYSTEM full report project topics 6 8,528 07-01-2016, 11:33 AM
Last Post: Guest
  FINGER PRINT BASED ELECTRONIC VOTING MACHINE full report project topics 48 42,498 09-10-2015, 10:18 PM
Last Post: Guest
  RF Based SPY robot full report seminar topics 4 11,789 09-03-2015, 11:25 PM
Last Post: rsnnzxrkv
  DIGITAL SPEEDOMETER full report seminar surveyer 8 11,640 30-10-2014, 07:50 PM
Last Post: akhil4718
  MICROCONTROLLER BASED DAM GATE CONTROL SYSTEM full report seminar class 13 10,280 13-07-2014, 11:33 PM
Last Post: Guest
  DOOR LOCKING SECURITY SYSTEM UING GSM FULL REPORT seminar class 11 10,791 14-06-2014, 08:07 PM
Last Post: lagua2012
  PLC BASED TRAFFIC CONTROL SYSTEM full report seminar class 5 10,678 10-01-2014, 03:08 PM
Last Post: seminar project topic
  HOME AUTOMATION USING MOBILE COMMUNICATION projectsofme 15 16,379 10-01-2014, 02:20 PM
Last Post: seminar project topic
  Microcontroller Based Anesthesia Injector full report project topics 4 8,969 19-10-2013, 09:02 AM
Last Post: Guest
  MICROCONTROLLER BASED AUTOMATIC RAILWAY GATE CONTROL full report project topics 55 75,852 07-10-2013, 08:54 AM
Last Post: Guest