Introduction Of General Microcontroller

In a modern world, all companies have restricted access areas or places where there must be strict control on the mobilization of material to prevent its disappearance (e.g. libraries, stockrooms, etc.). A solution for easy access by authorized personnel and access to material that saves time that would otherwise be wasted by searching store keys and/or waiting for the security to arrive should be welcome. Such a solution would also improve ease of returns or requests of equipment. Furthermore, it allows a thorough inventory on all the material; thus, avoiding mysterious disappearances.

The goal of this project was to develop a Security system, based on a wireless technology, to control access to restricted areas. The system should also allow the indication of people and objects. RF ID is a wireless solution for the security application. This is the Wireless door access system using micro controller and RF reader. In this system one receiver connected with the door. It read the ID of valid user. If any valid user comes near the door with the RF ID tag, door will be open automatically for few seconds and display the user ID on LCD Display. Radio-frequency identification (RFID) based access-control system allows only authorized persons to enter a particular area of an establishment. The authorized persons are provided with unique tags, using which they can access that area. The Project is based on microcontroller PIC16Fxxx and comprises RFID module, LCD module, for displaying the status and a relay for opening the door.

1.1 Introduction of General Microcontroller

As microcontrollers are the core of today's digital circuit design in industry due to its decision making power imparted to it by the program loaded inside and the ease with which the decisions can be changed without changing the hardware only by changing the code inside. This system uses it for the centralized operation and digital processing.
A microcontroller is a computer on a single chip; it contains a CPU (usually called the core) and a variety of peripherals which assist your application. Many microcontrollers can operate with no external components except an oscillator (a crystal or ceramic resonator) - some do not even require this, having an oscillator built in.
All microcontrollers offer digital I/O ports, which you can use as digital input or output. An I/O port is generally a group of up to 8 I/O lines which are addressed together as a byte. Usually any line can be configured as an input or output port.

Every Microcontroller (also MCU) consists of several major units:
' Input / Output Ports
' Control Pins: reset, power, clock
' Processor (CPU)
' Memory (RAM, ROM, EEPROM)
' Serial and parallel ports
' Timers
' Analog-to-digital (A/D) and digital-to-analog (D/A) converters

8-bit microcontrollers range in size from very small (only 8 pins) to very large (over 200 pins), with some large chips providing and expandability comparable to that of modern CPUs. Since applications for very large micros are specialized and expensive to pursue, we will concentrate on micros offering through-hole rather than surface-mount parts, which effectively limits us to 84-pin and smaller devices.
Microcontrollers have become the basic block in making of safety Project. The advantage of microcontroller are: easy system design, wide variety to choose from, very low cost etc.

1.2 Introduction of PIC Controller

PIC Controller is IC which is developed to control the peripheral devices. A PIC microcontroller is a processor with built in memory and RAM and we can use it to control build projects around it. So it saves you building a circuit that has separate external RAM, ROM and peripheral chips. One of the most useful features of a PIC microcontroller is that it can re-program them as they use flash memory. We can either program a PIC microcontroller using assembler or a high level language or recommend using a high level language such as C as it is much easier to use.
The PIC16 family is the most common used family from the PIC families. Compared to PIC 17/18 families, the PIC16 family are easy to study and can be used to create 'smart' applications. The great advantage of this PIC is a Flash memory, allowing to burn to the memory unlimited number of times. You can write the program and burn it to the memory inside the microcontroller.

The PIC microcontrollers are widely used in industry and education fields (projects, labs). In fact, almost any systems where there is a need to control certain processes, to obtain information from external sources, and interpret collected information, the microcontrollers is used.

A PIC Microcontroller can control outputs and react to inputs e.g. you could drive a relay or read input buttons. With the larger devices it's possible to drive LCDs or seven segment displays with very few control lines as all the work is done inside the PIC Microcontrollers. Microcontroller uses RISC (Reduced Instruction Set Computing) which simply means that it has a few instructions.


Figure 2. 1 Block Diagram of Project

Figure 2.1 Shows the Block Diagram of RFID Door Access System .RFID Reader is connected to the door. Receiver receives signal through RF receiver module and demodulates the data. Demodulated data is given to the Microcontroller PIC16F873.When The Valid User Come Near to the door the RFID reader scan the user code is Valid or not. If it is valid user than Display the code and door will be open. +5V Power Supply Is Provided to Microcontroller, LCD Display and +12V Power Supply is provided to Buzzer, Relay.


Figure 3. 1 Circuit Diagram of Project

3.1 Circuit diagram description
' In this circuit diagram three ICs are used and motor, 16x2 LCD, RFID reader are used. Let's study about them one by one.
' First component is RFID, RFID requires +5V to Operate. In this one receiver connected with the door. It read the ID of valid user. If any valid user comes near the door with the RF ID tag, door will 1be open automatically for few seconds.
' Here code in tag is detected by reader and after detecting it we can verify the Person. After verify the code, RFID sends a signal to PIC16F872.
' After getting the signal at PIC16F872, it commands 16x2 LCD to display the Information.
' 4MHz Crystal is used to provide a stable clock signal for digital integrated circuits, and to stabilize frequencies for radio transmitters/receivers.
' 16x2 LCD has 16 pins and operates on +5V. From which pin no.1, 5 and 16 is connected to ground and pin no.2 and 15 is connected to +5v supply. Here pin no. 3,4,5,6 is control pins. The pins from 7 to 14 is used displaying the data comes after command.
' Buzzer is two terminal device one is +12v and other is ground. Which is used (tuned on) to indicate that there is valid user comes near the door.

' Resistor
Resistor- 1K (3 NOS)
Resistor - 22E (1 NOS)
Resistor - 4K7 (2 NOS)
Resistor- 10K (4 NOS)
Variable Resistor - 20K (1 NOS)
' Capacitor
Capacitor - 1000UF (1 NOS)
Capacitor - 47UF (1 NOS)
Capacitor - 0.1UF DISC (100nf) (3 NOS)
Capacitor - 33PF DISC (2 NOS)
' Crystal
Crystal - 4MHZ (1 NOS)
' Diode
Diode - 1N4148 (2 NOS)
Diode - 1N4007 (4 NOS)
' LED ' 3mm (2 NOS)
' Transistor - BC547 / BC548 (2 NOS)
' 16 x 2 LCD Modules
' LM7805 ' +5V 3 Terminal Voltage Regulator IC
' PIC16F873 Micro controller
' 125KHZ RFID Reader Module
' pin Tact Switch
' Pin Burg Strip with Jumper
' 12V DC Buzzer
' 12V SPDT Relay ' PCB Mount
' 14 Pin IC Socket
' 8 Pin IC Socket
' 16 Pin LCD Connector
' RFID Card or Tag

CHAPTERS 5 RFID (Radio Frequency Identification)

5.1 Introduction of RFID
Radio-frequency identification (RFID) is the wireless non-contact use of radio-frequency electromagnetic fields to transfer data, for the purposes of automatically identifying and tracking tags attached to objects. The tags contain electronically stored information.
RFID is a dedicated short range communication (DSRC) technology. The term RFID is used to describe various technologies that use radio waves automatically identify people or objects. RFID technology is similar to the bar code identification systems we see in retail stores every day; however one big difference between RFID and bar code technology is that RFID does not rely on the line-of sight reading that bar code scanning requires to work. RFID is also called dedicated short range communication (DSRC).

5.2 History of RFID

1940: RFID was first used during World War II to identify aero planes (IFF: Identify Friendly Foe). The objective was to use the aero plane's radar signal to read an identification number in order to identify whether they were allies or enemies.

1970: During the 1960-70s, RFID systems were still considered a secret technology used by the army to control access into sensitive areas (nuclear plants etc.).

1980: Technological developments lead to the creation of passive tags.
This technology meant we no longer needed the energy to be embedded into the tag. Therefore the price of the tag and its maintenance could be significantly reduced.

1990: Standardization for the interoperability of RFID equipment began.

1999: The Massachusetts Institute of Technology (MIT) created the Auto-ID centre - a research centre specialized in automatic identification (including RFID).

2004: The MIT Auto-ID centre became the global EPC, an organism in charge of promoting the EPC (Electronic Product Code) standard.

From2005: RFID technologies are now widely used in almost all industrial sectors (aerospace, automotive, logistics, transport, health, life, etc.).ISO (International Standard Organization) took part in establishing technical and applicative standards that let to have a high degree of interoperability or interchangeability.

5.3 Difference Between RFID and Barcode

One of the key differences between RFID and bar code technology is RFID eliminates the need for line-of-sight reading that bar coding depends on. Also, RFID scanning can be done at greater distances than bar code scanning. High frequency RFID systems (850 MHz to 950 MHz and 2.4 GHz to 2.5 GHz) offer transmission ranges of more than 90 feet, although wavelengths in the 2.4 GHz range are absorbed by water (the human body) and therefore has limitations.

Table 1 Advantages of RFID over Barcode

Radio-frequency identification (RFID) is the use of a wireless non-contact system that uses radio frequency electromagnetic fields to transfer data from a tag attached to an object, for the purposes of automatic identification and tracking. Some tags require no battery and are powered by the electromagnetic fields used to read them. Others use a local power source and emit radio waves (electromagnetic radiation at radio frequencies). The tag contains electronically stored information which can be read from up to several meters (yards) away. Unlike a bar code, the tag does not need to be within line of sight of the reader and may be embedded in the tracked object.

5.4 How RFID works?

An RFID system consists of three components: an antenna or coil, a transceiver (with decoder) and a transponder (RF tag) electronically programmed with unique information. Fig.5.1 shows a typical RFID system. In every RFID system, the transponder tags contain unique identifying information. This information can be as little as a single binary bit or a large array of bits representing such things as an identity code, personal medical information or literally any type of information that can be stored in digital binary format.

Figure 5. 1 Typical RFID system

The RFID transceiver communicates with a passive tag. Passive tags have no power source of their own and instead derive power from the incident electromagnetic field. Commonly, at the heart of each tag is a microchip. When the tag enters the generated RF field, it is able to draw enough power from the field to access its internal memory and transmit its stored information. When the transponder tag draws power in this way, the resultant interaction of the RF fields causes the voltage at the transceiver antenna to drop in Value. This effect is utilized by the tag to communicate its information to the reader. The tag is able to control the amount of power drawn from the field and by doing so it can modulate the voltage sensed at the transceiver according to the bit pattern it wishes to transmit.

5.5 RFID reader
RFID reader's function is to interrogate RFID tags. The means of interrogation is wireless and because the distance is relatively short; line of sight between the reader and tags is not necessary. A reader contains an RF module, which acts as both a transmitter and receiver of radio frequency signals. The transmitter consists of an oscillator to create the carrier frequency; a modulator to impinge data commands upon this carrier signal and an amplifier to boost the signal enough to awaken the tag. The receiver has a demodulator to extract the returned data and also contains an amplifier to strengthen the signal for processing. A microprocessor forms the control unit, which employs an operating system and memory to filter and store the data. The data is now ready to be sent to the network.
When powered on the RFID reader will activate a RF field waiting for a tag to come into its range. Once tag is detected, its unique ID number is read and data is sent via serial interface. The valid tag detecting is indicated by LED blink and Buzzer beep.
The tags available with us have a read distance of approximately 2 inches. Actual distance may vary slightly depending on the size of the transponder tag and environmental conditions of the application. Fig. 5.2 shows the 125 KHz RFID reader.

Figure 5. 2 RFID Reader

Radio Frequency Identification (RFID) Card Readers provide a low-cost solution to read passive RFID transponder tags up to 10 cm away. This RFID Card Reader can be used in a wide variety of hobbyist and commercial applications, including access control, automatic identification, robotics navigation, inventory tracking, payment systems, and car immobilization. The RFID card reader read the RFID tag in range and outputs unique identification code of the tag at baud rate of 9600. The data from RFID reader can be interfaced to be read by microcontroller or PC.

5.5.1 Features of RFID Reader
' Low-cost method for reading passive RFID transponder tags.
' 9600 bps serial interface at 5V TTL level for direct interface to microcontrollers.
' LED indicates valid RFID Tag detection.
' Range up to 10 cm for 125 KHz RFID Cards or Key chains.

5.6 RFID Advantages
' The major advantage of all kinds of RFID system is that they work contactless and require no line of sight.
' More reliable technology than barcode.
' Easy to use.
' Transponders can be read through a whole number of substances, e.g. snow, fog, ice, paint, dirt, and in difficult constructional scenarios where barcodes or other optical reading technologies would be not used.
' In difficult external conditions RFID has the advantage of being able to communicate contactless and without direct line-of-sight contact with the data medium. Where the transponder is doesn't matter either -- it can be read through substances like dust, paint or ice.
' No line of sight requires.
' Active and passive systems working at HF and UHF frequencies detect a number of transponders in the field. This property is called bulk capability. In practical terms it means that every data medium needn't be scanned singly, but is automatically detected during a read operation.

5.7 Applications for RFID

Applications fall into two principal categories: firstly, short range applications where the reader and tag must be in close proximity (such as in access control) and secondly, medium to long application, where the distance may be greater (such as reading across a distribution center dock door). A sample of applications is shown below:
' Access control for people ; there are many areas where RFID tags are carried by people to allow them to gain access to facilities or services:
o Secure access to work place
o Safety access to dangerous/secure equipment
o Access to a computer or vehicle
o Access to travel on trains/buses
' Access control for vehicles:
o Secure access on site
o Road tolling
' Manufacturing automation:
o Control of flexible manufacturing processes by recognizing items being built on a production line (mass customization enabler)
' Logistics and distribution:
o Tracking parcels from shipment to end customer
o Tracking goods from manufacture through to retail
' Retail:
o Supply chain management
o Reverse logistics
o Product availability
' Maintenance:
o Plant & Equipment
o Patients
' Product security:
o Product authentication

CHAPTERS 6 RFID TAG (transponders)

6.1 RFID TAG (transponders)

An RFID tag is a tiny radio device that is also referred to as a transponder, smart tag, smart label or radio barcode. A radio-frequency identification system uses tags, or labels attached to the objects to be identified. The tag comprises of a simple silicon microchip (typically less than half a millimeter in size) attached to a small flat aerial and mounted on a substrate. The whole device can then be encapsulated in different materials (such as plastic) dependent upon its intended usage. The finished tag can be attached to an object, typically an item, box or pallet and read remotely to ascertain its identity, position.
Fig.7.1 shows the internal structure of a typical RFID tag. An RFID tag comprises a microchip containing identifying information and an antenna that transmits this data wirelessly to the reader. At its most basic, the chip will contain a serialized identifier, or license plate number, that uniquely identifies that item, similar to the way many barcodes are used today. Tags can be attached to almost anything; ' Items, cases or pallets of products, high value goods, vehicles, assets, livestock or personnel.

Figure 6. 1 Internal structure of a typical RFID tag
6.2 Types of Tag (Transponder)

There are three types of tags: active, passive and semi passive.

1) Passive Tag: Passive tags have no internal power source or do not contain a battery. These draw their power from the electromagnetic field generated by the RFID reader and then the microchip can send back information on the same wave. The reading range is limited when using passive tags. They have smaller memory capacity and lower Cost.

Figure 6. 2 Passive Tag

2) Active Tag: Active transponders have their own transmitters and power source, usually in the form of a small battery. These remain in a low-power 'idle' state until they detect the presence of the RF field being sent by the reader. When the tag leaves the area of the reader, it again powers down to its idle state to conserve its battery. As a result, active tags can be detected at a greater range than passive tags. Cost is more than passive tag.

Figure 6. 3 Active Tag
3) Semi-Passive Tag: Semi-passive tags have their own power source that powers only the microchip. These have no transmitter. They rely on altering the RF field from the transceiver to transmit their data.

Figure 6. 4 Semi-Passive Tag

There are three ways for data encoding into tags:

1. Read-only tags contain data, which is pre-written onto them by the tag manufacturer or distributor.
2. Write-once tags enable a user to write data to the tag one time in production or distribution Processes.
3. Full read-write tags allow new data to be written to the tag as needed and later other data can be rewritten over the original data.


7.1 Pin diagram of PIC16F873 Controller

Figure 7. 1 Pin Diagram of PIC16f873

7.2 Description of PIC16F873 Microcontroller

Programmable interface controllers (PICs) are a family of low cost, Reduced Instruction Set Computer (RISC) micro-controllers that are powerful and easy to use. PIC (Peripheral interface controller) is the IC while was developed to control the peripheral device, dispersing the function of the main CPU. PIC has the calculation function and the memory like the CPU and is controlled by the software. However the throughput, the memory capacity isn't big. It depends on kind of PIC but the maximum operation clock frequency is about 20MHZ and the memory capacity to write the program is about 1K to 4K words. The clock frequency is related with the speed to read the program and to execute the instruction. Only at the clock frequency, the throughput cannot be judged. It changes with the architecture in the processing parts for same architecture; the one with the higher clock frequency is higher about the throughput.
A PIC16f873 has 35 bit instructions set. The instruction set includes instructions to perform a variety of operations on registers directly, the accumulator and a literal constant or the accumulator and a register, as well as for conditional execution, and program branching.
The point, which the PIC convenient for is that the calculation part, the memory, the input/output part and so on, are incorporated into one piece of the IC. PIC16f873 is a 28 pin IC. We Understood Pin Of controller One By One.
1. VSS- Ground reference for logic and I/O pins.
2. VDD- Positive supply for logic and I/O pins.
3. OSC1/CLKIN- Oscillator crystal input/external clock source input.
4. OSC2/CLKOUT- Oscillator crystal output.
5. MCLR/VPP- Master Clear (Reset) input or programming voltage input.
6. PORTA- PORTA is a bi-directional I/O port.RA0/AN0-It can also be analog input0.RA1/AN1-It can also be analog input1.RA2/AN2/VREF- It can also be analog input2 or negative analog reference voltage.RA3/AN3/VREF+ It can also be analog input3 or positive analog reference voltage.RA4/T0CKI-It can also be the clock input to the Timer0 module.RA5/SS/AN4-It can also be analog input4 or the slave select for the synchronous serial port.
7. PORTB- is a bi-directional I/O port. PORTB can be software programmed for internal weak pull-up on all inputs.RB0/INT-It can also be the external interrupt pin.RB1-RB3-It can also be the low voltage programming input.RB4-RB5 Interrupt-on-change pin.RB6-Interrupt-on-change pin or In-Circuit Debugger pin. Serial programming clock.RB7-Interrupt-on-change pin or In-Circuit Debugger pin. Serial programming data.
8. PORTC is a bi-directional I/O port.RC0/T1OSO/T1CKI-It can also be the Timer1 oscillator output or Timer1 clock input.RC1/T1OSI/CCP2-It can also be the Timer1 oscillator input or Capture2 input/Compare2 output/PWM2 output.RC2/CCP1-It can also be the Capture1 input/Compare1 output/PWM1 output.RC3/SCK/SCL-It can also be the synchronous serial clock input/output for both SPI and I2C modes.RC4/SDI/SDA-It can also be the SPI Data In (SPI mode) or data I/O (I2C mode).RC5/SDO-It can also be the SPI Data Out (SPI mode).RC6/TX/CK-It can also be the USART Asynchronous Transmit or Synchronous Clock.RC7/RX/DT-It can also be the USART Asynchronous Receive or Synchronous Data.
7.3 Features of PIC16F873 microcontroller
' High performance RISC CPU
' Operating speed: DC - 20 MHz
' 2 ~ 4K FLASH Program Memory
' 128 bytes of Data Memory (RAM)
' Power-on Reset (POR)
' Power-up Timer (PWRT) and Oscillator Start-up Timer (OST)
' Programmable code protection
' Power saving SLEEP mode
' Selectable oscillator options
' Low power, high speed CMOS FLASH / EEPROM technology
' Single 5V In-Circuit Serial Programming capability
' Wide operating voltage range: 2.0V to 5.5V
' High Sink/Source Current: 25 mA
' Commercial, Industrial and Extended temperature ranges
' Low-power consumption

7.4 Advantages of PIC Controller
' Small instruction set to learn
' RISC architecture
' Built in oscillator with selectable speeds
' Inexpensive microcontrollers
' Wide range of interfaces including I??C, SPI, USB, USART, A/D, programmable comparators, PWM, LIN, CAN, PSP, and Ethernet
' Availability of processors in DIL package makes them easy to handle for hobby use.


8.1 LCD 16X2 pin description

Figure 8. 1 16X2 LCD

' 16X2 LCD is requiring for displaying the User Information.
' HD44780 based LCD displays are very popular because they are cheap and they can display characters
' All HD44780 based character LCD displays are connected through 14 pins: 8 data pins (D0-D7), 3 control pins (RS, E, R/W), and three power lines (Vdd, Vss, Vee). Two additional connections (LED+ and LED-), making altogether 16 pin.
' Pin 1 and Pin 16 are connected to ground and pin2 and pin 15 is connected to Vcc.
' There are four control pins 3,4,5,6 from which pin 3 is contrast set pin controlled by adjusting preset of 5k and pin 4,5,6 are RS,R/W,EN pins respectively controlled by port0.
' The Vdd pin should be connected to the positive power supply and Vss to ground. Pin 3 is Vee, which is used to adjust the contrast of the display. In most of the cases, this pin is connected to a voltage between 0 and 2V by using a preset potentiometer.
' Remaining all the pins (7 to14) which are the data pins connected to port C. Pins 7 to 14 are data lines (D0-D7). Data transfer to and from the display can be achieved either in 8-bit or 4-bit mode. The 8-bit mode uses all eight data lines to transfer a byte, whereas, in a 4-bit mode, a byte is transferred as two 4-bit nibbles. In the later case, only the upper 4 data lines (D4-D7) are used. This technique is beneficial as this saves 4 input/output pins of microcontroller. We will use the 4-bit mode.

Table 2 16X2 LCD Pin Description

LCD 16x2 A Module provides versatile display functions. In this module, two display lines, each with 16 characters on each line can be displayed. By using the cursor control command, the position of the character to be displayed on the screen can be arbitrarily changed.
In this module, the backlight function can be used to change the backlight to allow the message to be read easily. In addition, it can be configured to display user defined characters to display any specially required characters.

8.2 Features

' It can be used to display corresponding characters in ASCII code.
' 255 steps backlight control.
' For continuous inputs, the module will carriage returns automatically Cursor position assignment and Tab function with configurable Tab steps and HOME function.
' Destructive backspace, clear to end of line or end of screen from the cursor position.
' Set the user defined characters to display various creative characters.


9.1 Introduction of Flash EEPROM (AT24C04)
The AT24C04 are 4K bit electrically erasable programmable memories (EEPROM), organized as 2 blocks of 256 x 8 bits. They are manufactured in SGS-THOMSON's Hi-Endurance Advanced CMOS technology, which guarantees an endurance of one million erase/write cycles with data retention of 40 years. The memories operate with a power supply value as low as 1.8V for the ST24C04R Both Plastic Dual-in-Line and Plastic Small Outline packages are available. The memories are compatible with the I2C standard, two wire serial interfaces which uses a bi-directional data bus and serial clock.
The memories carry a built-in 4 bit, unique device identification code (1010) corresponding to the I2C bus definition. This issued together with 2 chip enable inputs (E2, E1) so that up to 4 x 4K devices may be attached to the I2C bus and selected individually. The memories behave as a slave device in the I2C protocol with all memory operations synchronized by the serial clock. Read and write operations are initiated by a START condition generated by the bus master.
The START condition is followed by a stream of 7 bits (identification code 1010), plus one read/write bit and terminated by an acknowledge bit. When writing data to the memory it responds to the 8 bits received by asserting an acknowledge bit during the 9th bit time. When data is read by the bus master, it acknowledges the receipt of the data bytes in the same way. Data transfers are terminated with a STOP condition.
In order to prevent data corruption and inadvertent write operations during power up, a Power on Reset (POR) circuit is implemented. Until the VCC voltage has reached the POR threshold value, the internal reset is active, all operations are disabled and the device will not respond to any command. In the same way, when VCC drops down from the operating voltage to below the POR threshold value, all operations are disabled and the device will not respond to any command. A stable VCC must be applied before applying any logic signal.

Figure 9. 1 Pin Diagram of AT24c04 Flash EEPROM

9.2 Pin Description

Serial Clock (SCL). The SCL input pin is used to synchronize all data in and out of the memory. A resistor can be connected from the SCL line to VCC to act as a pull up.
Serial Data (SDA). The SDA pin is bi-directional and is used to transfer data in or out of the memory. It is an open drain output that may be wire-OR'ed with other open drain or open collector signals on the bus. A resistor must be connected from the SDA bus line to VCC to act as pull up.
Chip Enable (E1 - E2). These chip enable inputs are used to set the 2 least significant bits (b2, b3) of the 7 bit device select code. These inputs may be driven dynamically or tied to VCC or VSS to establish the device select code.
Protect Enable (PRE). The PRE input pin, in addition to the status of the Block Address Pointer bit sets the PRE write protection active.
Mode (MODE). The MODE input is available on pin 7 and may be driven dynamically. It must be at VIL or VIH for the Byte Write mode, VIH for Multi byte Write mode or VIL for Page Write mode. When unconnected, the MODE input is internally read as VIH.
Write Control (WC). Hardware Write Control feature is offered only for ST24W04 and ST25W04 versions on pin 7. This feature is use full to protect the contents of the memory from any erroneous erase/write cycle. The Write Control signal is used to enable or disable the internal write protection. When unconnected, the WC input is internally read as VIL and the memory area is not write protected.

9.3 External EEPROM interface

MCU port Pins RB6 and RB7 are used as serial data (SDA) and serial clock (SCL) lines for the I2C bus for communicating with the External EEPROM. These two lines are connected to pull-up resistors (R4, R5), which are required for I2C bus devices. An external EEPROM used to save valid user ID and information. EEPROM is an I2C bus compatible 4k-bit EEPROM organized as 256x8-bit that can retain data for more than ten years. Microcontroller can read and write data for all the parameters.


10.1 Introduction of Relay
A Relay is an electrically operated switch. It closes the voltage less point of contact while the circuits control works to control the equipment outside. The relay takes advantage of the fact that when electricity flows through a coil, it becomes an electromagnet. The electromagnetic coil attracts a steel plate, which is attached to a switch. So the switch's motion (ON and OFF) is controlled by the current flowing to the coil, or not, respectively. A very useful feature of a relay is that it can be used to electrically isolate different parts of a circuit. It will allow a low voltage circuit (5VDC) to switch the power in a high voltage circuit (230 VAC or more). The Relay operates mechanically, so it cannot operate at high speed.

There are many kind of relays. You can select one according to your needs. The various things to consider when selecting a relay are its size, voltage and current capacity of the contact points, drive voltage, impedance, number of contacts, resistance of the contacts, etc. Fig.10.1 shows the SPDT Relay having maximum 230V ratings.

Figure 10. 1 Relay


10.2 Relay Interface

A single pole double throw (SPDT) relay is connected to port RC6 (pin 17) of the micro controller through a driver transistor (Q2). The relay requires 12 volts at a current of around 100 mA, which cannot provide by the micro controller. So the driver transistor is added. The relay is used to operate external electronic lock, or any other electrical device ETC. Normally the relay remains off. As soon as pin of the micro controller goes high, the relay operates. When the relay operates and releases. Diode D6 is the standard diode on a mechanical relay to prevent back EMF from damaging Q2 when the relay releases. LED L2 indicates relay is operated. LED has a current limiting resistor in series. The LED / resistor combination is simply in parallel with the relay.

10.3 How to Connect Load with Relay?
The output of the projects is controlled by a relay, allowing any load until 230V AC as maximum consumption. The relay has 3 output terminals the normally open at quiescent (NO), the normally closed at quiescent (NC) and the common. The operating of this mechanism is the same as a switch with two terminals NO and common, if you wish that the output will be activated during the timer, or between the NC and the common to obtain the reverse operating. In the drawing, you could appreciate the typical connection for a devices operating at 12 VDC and to operate at 230 VAC.

Figure 10. 2 Connection between load and relay

11.1 Circuit diagram of Power supply

Figure 11. 1 Circuit Diagram of Power supply

' Power is deliver initially from standard 12V AC/DC adapter or 12V_1000ma Transformer. This is fed to bridge rectifier (Diode D2 ~ 4) the output of which is then filtered using 1000uf electrolytic capacitor (C1) and fed to U2 (voltage regulator). U2 +5V output powers the micro controller and other logic circuitry. LED L1 and its associate 1K current limiting resistors provide power indication. The unregulated voltage of approximately 12V is required for relay, and buzzer driving circuit.
' Here +5V power supply is needed which is necessary for PIC16F872, 16*2 LCD, RFID, Buzzer.
' +5V power supply is produced using step down transformer(12-0) which is then applied to rectifier which produced its appropriate pulsed dc output voltage.
' This output voltage is then filtered by filter capacitor (1000uf/35v) so +12v is reduced to +8v using filter capacitor then voltage signal is given to the voltage regulator IC LM7805.
' Which is 3 pin ic 1 is input,2 is gnd,3 is output which generates output voltage of +5v and one noise suppression capacitor (0.1uf) protection against jerk and spark capacitor(100uf).

11.2 IC7805

Figure 11. 2 Pin Diagram of IC7805

The LM7805 is a 3 terminal IC as shown in fig.11.2.The LM7805 of three terminal positive regulators are available in the TO-220 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.

' The 7805 family is commonly used in electronic circuits requiring a regulated power supply due to their ease-of-use and low cost.
' For ICs within the family, the xx is replaced with two digits, indicating the output voltage (for example, the 7805 has a 5 volt output, while the 7805 produces 12 volts).
' The 7805 line is positive voltage regulators: they produce a voltage that is positive relative to a common ground.
' Here is a related line of 7905 devices which are complementary negative voltage regulators.
' 7805 and 7905 ICs can be used in combination to provide positive and negative supply voltages in the same circuit.
11.2.1 Features

' Output Current up to 1A.
' Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V.
' Thermal Overload Protection.
' Short Circuit Protection.
' Output Transistor Safe Operating Area Protection.

Source: Essay UK -

About this resource

This Information Technology essay was submitted to us by a student in order to help you with your studies.

Search our content:

  • Download this page
  • Print this page
  • Search again

  • Word count:

    This page has approximately words.



    If you use part of this page in your own work, you need to provide a citation, as follows:

    Essay UK, Introduction Of General Microcontroller. Available from: <> [26-05-20].

    More information:

    If you are the original author of this content and no longer wish to have it published on our website then please click on the link below to request removal: