Professional Documents
Culture Documents
RESISTOR:
A resistor is a device which opposes the flow of current.
The first band gives the first digit The second band gives the second digit The third band indicates the number of zeroes.
Number 0
1
2 3
Yellow
Green Blue Violet Grey White
Tuesday, July 10, 2012
4
5 6
7
8 9
DIODE:
A Diode is a two terminal electronic component that conducts electric current only in one direction. Based on applications diodes are divided into two types -> PN junction -> ZENER diode
PN junction diode:
The most common function of a diode is to allow an electric current in one direction (called the forward direction) while blocking current in the opposite direction (the reverse direction).
ZENER DIODE:
A Zener diode is a type of diode that permits current in the forward direction like a normal diode, but also in the reverse direction if the voltage is larger than the breakdown voltage known as "Zener knee voltage" or "Zener voltage".
CAPACITOR:
INDUCTOR:
An inductor or a reactor can store energy in a
magnetic field created by the electric current passing through it. It is denoted in Henry.
TRANSISTORS:
A transistor is a semi conductor device commonly used to amplify or switch electronic signals. 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, the transistor provides amplification of a signal.
Transformer:
VOLTAGE REGULATOR:
A voltage regulator is an electrical regulator designed
to automatically maintain a constant voltage level. It may use an electromechanical mechanism, or passive or active electronic components. Depending on the design, it may be used to regulate one or more AC or DC voltages.
The voltage regulators are classified into two types. positive series(7805) negative series(7905)
7805
7905
7805
SERIES Output voltage
O/P
I/P GND
O/P
GND
I/P
RELAY:
A Relay is an electrically controllable switch widely used in industrial controls, automobiles, etc
inductor
OPERATION OF RELAY:
The relay's switch connections are usually labeled COM,
NC and NO: COM = Common, always connect to this, it is the moving part of the switch. NC = Normally Closed, COM is connected to this when the relay coil is off. NO = Normally Open, COM is connected to this when the relay coil is on. Connect to COM and NO if you want the switched circuit to be on when the relay coil is on. Connect to COM and NC if you want the switched circuit to be on when the relay coil is off.
Tuesday, July 10, 2012
Diagrammatic explanation:
N/C
IRON ARM
AC 230V
INDUCTOR
COM ON
N/O
BULB
OFF
WINE YARD
Tuesday, July 10, 2012
TECHNOLOGIES
R1
C1
C2 C
R2
7805
5V
Tuesday, July 10, 2012
RECTIFIER:
The primary application of rectifiers is to derive usable
DC power from an AC supply. Virtually all electronics except simple motor circuits such as fans require a DC supply but mains power is AC so rectifiers find uses inside the power supplies of virtually all electronic equipment.
FILTERS:
Electronic filters are electronic circuits which
perform signal processing functions, specifically to remove unwanted frequency components from the signal, to enhance wanted ones, or both.
AC+DC
DC
AC
RECTIFIER OUTPUT
FILTER
PURE DC
What is a switch?
In electronics, a switch is an electrical component that can break an electrical circuit, interrupting the current or diverting it from one conductor to another.
Transistor as a switch:
Transistor can be used as an electronic switch, in
grounded-emitter configuration. Transistors are commonly used as electronic switches, for both high power applications including switched mode power supply and low power applications such as logic gates.
Transistor as a switch
example
Vcc
N/C
330 COM
100K PRESET
LED
LOAD
T-OFF
LIGHT
NO LIGHT
N/O
VB<0.7V
LDR
VB>0.7V T-ON
relay
"embedded".
Tuesday, July 10, 2012
Embedded system
An embedded system is a special purpose computer
system designed to perform one or a few dedicated functions, often with real time computing constraints. It is usually embedded as part of a complete device including hardware and mechanical parts. Since the embedded system is dedicated to specific tasks, design engineers can optimize it, reducing the size and cost of the product, or increasing the reliability and performance. Embedded systems span all aspects of modern life.
Characteristics:
Embedded systems are designed to do some specific task, rather than be a general-purpose computer for multiple tasks. Embedded systems are not always standalone devices. Many embedded systems consist of small, computerized parts within a larger device that serves a more general purpose. The program instructions written for embedded systems are referred to as firmware, and are stored in read-only memory or Flash memory chips.
Applications:
Telecommunications Consumer electronics like PDAs, mp3 players,
mobile phones, digital cameras, DVD's, ovens, washing machine, to control lights, to provide security, climate, etc..
User Interface
Embedded systems range from no user interface
at all dedicated only to one task to complex graphical user interfaces that resemble modern computer desktop operating systems.
Peripherals
Serial Communication Interfaces (SCI): RS-232,
RS-422, RS-485 etc
Universal Serial Bus (USB) Multi Media Cards (SD Cards, Compact Flash etc)
Peripherals
Networks: Ethernet, Controller Area Network,
LanWorks, etc
Timers:
Capture/Compare
and
Time
Contents
Introduction Block Diagram and Pin Description of the 8051 I/O Port Description Led Interfacing Switch Interfacing Led And switch Interfacing LCD Interfacing Serial communication Relay Interfacing
Aspects of a microprocessor/controller
Hardware :
Interface to the real world. Ex- LCD, LED, printers, keyboard etc.
Software :
order how to deal with inputs. By using software we can control the hardware to obtain the desired outputs.
CPU: Central Processing Unit I/O: Input /Output Bus: Address bus & Data bus Memory: RAM & ROM Timer Interrupt Serial Port Parallel Port
Microprocessors:
General-purpose microprocessor:
CPU for Computers. No RAM, ROM, I/O on CPU chip itself. Example: Intel's x86, Motorolas 680x0.
CPU GeneralPurpose Microprocessor
Data Bus
RAM
ROM
I/O Port
Timer
Address Bus
Microcontroller:
A smaller computer. On-chip RAM, ROM, I/O ports... Example: Motorolas 6811, Intels 8051, Zilogs Z8 and
PIC 16X.
CPU
RAM ROM
A single chip
I/O Port
Serial Timer COM Port
Microcontroller
Microprocessor vs Microcontroller
general-purpose
Tuesday, July 10, 2012
Block Diagram:
External interrupts Interrupt Control On-chip ROM for program code
Timer/Counter
On-chip RAM
Timer 1 Timer 0
Counter Inputs
CPU
Serial Port
OSC
Bus Control
4 I/O Ports
P0 P1 P2 P3
TxD RxD
Address/Data
Tuesday, July 10, 2012
ROM (program space in bytes) RAM (bytes) Timers I/O pins Serial port Interrupt sources
4K 128 2 32 1 6
8K 256 3 32 1 8
0K 128 2 32 1 6
Features of 8051:
4K Bytes On Chip ROM 128 bytes On Chip RAM
6 Interrupts
32 I/O channels
Bit Addressability
2 Timers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
8051
40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21
Vcc P0.0(AD0) P0.1(AD1) P0.2(AD2) P0.3(AD3) P0.4(AD4) P0.5(AD5) P0.6(AD6) P0.7(AD7) EA/VPP ALE/PROG
PSEN P2.7(A15) P2.6(A14) P2.5(A13) P2.4(A12) P2.3(A11) P2.2(A10) P2.1(A9) P2.0(A8)
8051 Description:
Vcc, gnd and xtal:
Vcc pin 40
Vcc provides supply voltage to the chip. The voltage source is +5V. GND: pin 20 ground XTAL1 and XTAL2 pins 19,18
8051 Description:
Reset: pin 9 reset
It is an input pin and is active high normally low . The high pulse must be high at least 2 machine cycles. It is a power-on reset. Upon applying a high pulse to RST, the microcontroller will reset and all values in registers will be lost. Reset values of some 8051 registers
19
Pins of 8051:
EA: pin 31 external access
There is no on-chip ROM in 8031 and 8032 . The EA pin is connected to GND to indicate the code is stored externally. PSEN ALE are used for external ROM. For 8051, EA pin is connected to Vcc.
Pins of 8051:
ALE: pin 30 address latch enable
It is an output pin and is active high. 8051 port 0 provides both address and data. The ALE pin is used for de-multiplexing the address and data by connecting to the G pin of the 74LS373 latch. I/O port pins The four ports P0, P1, P2, and P3. Each port uses 8 pins. All I/O pins are bi-directional.
Other Pins:
P1, P2, and P3 have internal pull-up resisters.
P1, P2, and P3 are not open drain. P0 has no internal pull-up resistors and does not connects to Vcc inside the 8051. P0 is open drain. However, for a programmer, it is the same to program P0, P1, P2 and P3. All the ports upon RESET are configured as output.
Pull-up resistors may also be used at the interface between two different types of logic devices, possibly operating at different power supply voltages.
Vcc 10 K
P0.0 DS5000 P0.1 P0.2 8751 P0.3 8951 P0.4 P0.5 P0.6 P0.7
Port
Function
RxD TxD INT0 INT1 T0 T1 WR RD
Pin
10 11 12 13 14 15 16 17
ADDRESSING MODES:
There are five addressing modes available in the 8051: Register Direct Indirect Immediate Indexed
REGISTER ADDRESSING:
8051 has access to eight working registers (R0
to R7) Some instructions are specific to a certain register, such as the accumulator etc. Example: ADD A,R7 Example: MUL AB
Direct Addressing:
Direct addressing is so-named because the
value to be stored in memory is obtained by directly retrieving it from another memory location. Example: MOV A,30h
Indirect Addressing:
In 8051 assembly language, indirect addressing is
represented by an @ before R0 or R1. Example: MOV A, @R0 Moves a byte of data from internal RAM at location whose address is in R0 to the accumulator.
Immediate Addressing:
In assembly language, immediate operands are
preceded by #. Operand my be a numeric constant, a symbolic variable or an arithmetic expression using constants, symbols and operators. Example: MOV A,#12
Indexed Addressing:
Indexed addressing uses a base register (either the
program counter or data pointer) and an offset (the accumulator) in forming the effective address for a JMP or MOVC instruction. Example: MOVC A, @A+DPTR
Symbol of LED:
ORG 0000H
MOV P1,#OFFH MOV P1,#OOH END
CASE 2:
ORG 0000H
SWITCH INTERFACING
An electrical switch is any device used to interrupt the flow of electrons in a circuit. Switches are essentially binary devices: they are either completely on ("closed") or completely off ("open").
Vcc R GND
P2.1
8 0 5 1
Vcc R
P2.1 P1.0
Vcc
GND
8 0 5 1
Among its major features are its lightweight construction, its portability, and its ability to be produced in much larger screen sizes than are practical for the construction of cathode ray tube (CRT) display technology.
Liquid Crystal Display (LCD )is finding wide spread use replacing LEDs (seven segment LEDs or other multi segment LEDs) because of the following reasons: The declining prices of LCDs. The ability to display numbers, characters ,graphics and limited to numbers and a few characters Ease of programming for characters and graphics.
RS (register select): The register select pin is used for the selection of the required register either data or command register If RS=0 ; command register is selected If RS=1 ; data register is selected R/W (read or write): This pin is for the selection of read or write mode If R/W=0 ; write mode is selected If R/W=1 ; read mode is selected EN (enable): Enable pin is a active high to low pin used for writing the data to the LCD.
Tuesday, July 10, 2012
Vee
8 0 5 1
Vss
GND
COMMAND :
CLR RS CLR R/W SETB EN CLR EN RET SETB RS CLR R/W SETB EN CLR EN RET END
DATA:
Types:
There are many types of relays which are as follows: SPDT DPDT Symbol Of Relay:
Advantages of relays:
Disadvantages Of Relay:
DPDT (Double Pole Double Throw): Can be used to isolate float switches from spiking voltage or excessive current. Avoids risk that spiking pump voltage will hurt float switches. Specifications: Coil voltage: 12VDC Coil resistance: 160 Ohms
AT 89S52
P1.0
1 2 3 4 5 6 7 8
U L N 2 8 0 3
16 15 14 13 12 11 10 9
RELAY
LOAD
Ground
Vcc
This ULN2003 driver can drive seven relays at a time. The pins 8 and 9 provide ground and Vcc respectively.
Tuesday, July 10, 2012
Applications:
To control a high-voltage circuit with a low
voltage signal To control a high-current circuit with a lowcurrent signal, To detect and isolate faults on transmission and distribution lines by opening and closing circuit breakers.
What is communication?
Communication is nothing but sharing of data or
transferring the data from one system to another.
system1
system2
Types of communication:
In Serial communications means information is transmitted from source to destination over a single pathway. In Parallel Communication, often 8 or more lines are used to transfer data to a device that is only a few feet.
Serial Transfer
D0 Sender Receiver
Parallel Transfer
D0-D7 Sender Receiver
Transmitter
Receiver
Transmitter Receiver
Receiver
Transmitter
Receiver
Receiver
Transmitter
SBUF (Serial data buffer) SCON (Serial control register) TMOD (Timer mode register)
SBUF
This is an 8-bit register used for serial
communication in 8051.For a byte of data to be transferred it must be placed in sbuf register and in similar way sbuf holds the data when it is received.
SM0 , SM1: These two bits determine the framing of data by specifying the number of bits per character, and the start and stop bits.
SM0 SM1 0 0 Serial Mode 0 0 1 Serial Mode 1, 8-bit data, 1 stop bit, 1 start bit 1 0 Serial Mode 2 1 1 Serial Mode 3
RECEIVE - Data receive through the RXD pin starts upon the two following conditions are met: bit REN=1 and RI=0 (both of them are stored in the SCON register). When all 8 bits have been received, the RI bit of the SCON register is automatically set indicating that one byte receive is complete.
TRANSMIT - Data transmit is initiated by writing data to the SBUF register. In fact, this process starts after any instruction being performed upon this register. When all 8 bits have been sent, the TI bit of the SCON register is automatically set.
Tuesday, July 10, 2012
TMOD
TMOD is an 8 bit register in which the lower 4 bits
are set aside for Timer0 and the upper 4 bits for Timer1.
GATE C/T M0 M1 GATE C/T M1 M0
TMOD -Timers
Bit Number 7 Type GATE1 Working Timer Type Gating Control when 1 set
C/T1
M1
4
3
M0
GATE0
1
0
C/T0
1 0
Tuesday, July 10, 2012
M1 M0
0 0
M1
M0
Description Timer Mode of Mode 0 1 2 13-bit Timer. 16-bit Timer 8-bit autoreload Split timer mode
0 0 1
0 1 0
RS232
To ensure fast and reliable data transmission between two devices In RS232 it consists of 9 pins but we generally use only three pins 2,3 and 5 namely TXD RXD GND respectively.
MAX232
To convert TTL or CMOS voltages to RS232 voltages, and vice versa
11.0592 MHz
XTAL oscillator
Tuesday, July 10, 2012
12
32
28800 Hz
By UART To timer 1
To set the Baud rate
Timer 1
M A
13
D B 9
GND
8 0 5 1
X
2 3
ADC0804:
The ADC chip that is used in this project is
ADC0804. The ADC0804 IC is an 8-bit parallel ADC in the family of the ADC0800 series from National Semiconductor. It works with +5 volts and has a resolution of 8 bits. In the ADC0804, the conversion time varies depending on the clocking signals applied to the CLK IN pin, but it cannot be faster than 110s.
CLK IN & CLK R: CLK IN is connected to external clock when external clock is used and if internal clock is used both clocks are connected to capacitor and a resistor. INTR (INTERRUPT): It is an active low output pin using for stop the conversion. Vin(+) & Vin(-): Vin(+) is used for the conversion of analog to digital by connecting Vin(-) to the ground.
Tuesday, July 10, 2012
Vcc: It is the +5v power supply to the chip. Vref/2: Pin 9 is used for the reference voltage. If we need the input range 0-4V, Vref/2 is connected to 2V. D0-D7: These are the digital data output pins. D7 is the MSB. Analog ground & Digital ground: Analog ground is connected to ground of analog Vin while taking the inputs in the same way digital ground is also used for the digital outputs.
A D C 0 8 0 4
KEYPAD INTERFACING
Keypads are a part of HMI or Human Machine Interface and play really important role in a small embedded system where human interaction or human input is needed. Matrix keypads are well known for their simple architecture and ease of interfacing with any microcontroller. Interfacing the Keyboard to the 8051 At the lowest level, keypads are organized in a matrix of rows and columns. The CPU accesses both rows and column through ports; therefore, an 4*4 matrix of keys can be connected to a microprocessor. When a key pressed, a row and column make a connect; otherwise, there is no connection between row and column.
Tuesday, July 10, 2012
Consider an example
Row4-row1 = 1110 Col4-col1 = 1011 That means the row 1 and the col 3 intersected i.e. sw3 is pressed.