Sei sulla pagina 1di 19

1) Power Supply :The basic step in the designing of any system is to design the power supply required for

that system. The steps involved in the designing of the power supply are as follows, 1) Determine the total current that the system sinks from the supply. 2) Determine the voltage rating required for the different components.

1 N 1 8 D 2

0 7

7 8 0 5
2 0 0 7 U C 1 0 0 2 0 C u f0 . 1 1 u f 1 C 3 2 2 0 u I N O U 3 T

V C C

T R

S
4

F M
5

E R

1 D

N 3

C 4 f 0 . 1 u

N D

4 4

0 0

0 0

F i g . P o w e r

S u p p l y

VO=VR +VL VR =5V VL = IL *RL RL=10, VL=5V VO=10V VIN =10 +2 VIN =12V In our system most of the components used require 5 V as operating voltage such as micro controller, MAX 232, ADC 0809,LCD etc. The total current, which our circuit

sinks from the power supply, is not more than 200 mA. We have used Regulator IC 7805 that gives output voltage of 5V.The minimum input voltage required for the 7805 is near about 7 v. But the devices such as relays or stepper motors require 12 V. Therefore we have used the transformer with the voltage rating 230v-12v and current rating 500 mA. The output of the transformer is 12 V AC. This Ac voltage is converted into 12 V DC by Bridge rectifier circuit. The reasons for choosing the bridge rectifier are a) The TUF is increased to 0.812 as compared the full wave rectifier. b) The PIV across each diode is the peak voltage across the load =Vm, not 2Vm as in the two diode rectifier Output of the bridge rectifier is not pure DC and contains some AC some AC ripples in it. To remove these ripples we have used capacitive filter, which smoothens the rippled out put that we apply to 7805 regulators IC that gives 5V DC. We preferred to choose capacitor filters since it is cost effective, readily available and not too bulky. The value of the capacitor filter can be found by following formula, IL * t1 C = Vr

Reset Circuit and Oscillator Circuit: Power-ON Reset Circuit: The 8051 uses an active high reset pin. The reset input must go high for two machine cycles when power is first applied and then sink low. The simple RC circuit used here will supply system voltage (VCC) to the reset pin until the capacitor begins to charge. At threshold of about 2.5V, the reset input reaches a low level and the system begins to run. The reset circuit is shown in following figure.

Push-to-ON reset: The additional button enables the user to reset the system without having to turn power OFF and ON.

Clock Circuit: The clock circuit is used to generate clock pulses by which all internal operations are synchronized. In Micro controller AT 89C51 pins XTAL1 and XTAL2 (pin no. 18 &19) are provided for connecting a resonant network to form an oscillator

P I N

1 8 ( X T A L 1 )

P I N 1 2 M H z

1 9

X T A L 2 )

C C 1 2 2

R p F

Y C

S 2

T A

L 2 2 p F

F i g . O s c i l l a t o r

C i r c u i t

Generally quartz crystal and ceramic capacitors are used for the purpose. The crystal frequency is the basic internal frequency of micro controller. The requirement of crystal frequency ranges from 1 MHZ to 16 MHZ. Minimum frequencies imply that some internal memories are dynamic and must always operate above a minimum frequency or data will be lost. Serial data communication needs often dictate the frequency of the oscillator, because of the requirement that internal counters must divide the basic clock rate to yield standard communications bit per seconds rates.(i.e. baud rates).If the basic clock frequency is not divisible without remainder, then the resulting communication frequency is not standard. The oscillator formed by the crystal capacitors and an on-chip inverter generates a pulse train at the frequency of the crystal. It is shown in above figure. When we use quartz crystal with value 11.0592 MHZ, we get cycle frequency as 921.6 KHZ, which is divisible by the standard communication baud rates of 19200, 9600,4800,2400,1200 and 300HZ.

16*2 LCD Interfacing with Micro controller: Advantages of LCD over LED display: 1) It can display numbers, characters and graphics, whereas LED displays are limited to numbers and few characters. 2) LCD has its own processor, so there is no need for refreshing it through micro controller. 3) Ease of programming for characters and graphics 4) It is cost effective. Pin Description:

Pin1- GND: For digital ground Pin2- VCC: VCC (5v) supply is given to this pin Pin3-(-VEE): We can control the contrast of LCD by connecting appropriate value POT to this pin. The connection is as shown in below fig. Pin 4- RS- Register Select: The display contains two internal 8-bit registers. One is for commands and another is for data (characters) to be displayed. When RS=0 Command Register is selected RS=1 Data register is selected Pin5- Read/Write: This pin is used to select read/write operation of LCD When R/W=1 Read Operation is Selected R/W=0 Write Operation is Selected Read operation is performed during status checking of busy flag. The MSB of data lines i.e. D7 bit acts as busy flag.

Pin6-Enable: A high to low pulse is given to this pin to enable the operation of LCD Pin 7-14: Pin 7to14 are data lines (i.e. D0 to D7) of LCD. These pins can be connected to port pins of Micro Controller. Any data transfer will take place through these pins. Pin15- VCC Pin 16-GND Pin no 15 and 16 are used for backlight control of LCD Interfacing with Micro Controller:

Programming LCD: Before displaying any characters on LCD, we need to initialize the LCD. There are various codes to perform various functions such as 01H is code to clear display. We can send these commands to LCD processor, to perform these tasks. These different functions can be shift

cursor right, return home, shift cursor to new line etc. Data lines D0 to D7 are used to send these commands to LCD, while sending these commands, the RS pin of LCD must be 0, so that command register will be selected. After sending commands we can send the actual data to be displayed. At this time RS pin will be 1.During both these operations, R/W pin of LCD should be 0. Significance of Busy Flag: LCD processor is slow compared to the Micro Controller. Due to this we need to check the status of LCD processor (busy or ready) before sending any command or data, otherwise data may lose. For this purpose the MSB of data lines (i.e. D7 bit) is used as busy flag. If this bit is 1 then Micro Controller interprets that LCD processor is busy.

4*1 Keypad interfacing with micro controller Keypad is used for entering various numbers, to do some setting, push to on keys are used in keypad, push to on key structure is show in fig blow

In above fig, two vertical pairs of contact points are internally short .Interfacing of 4*1 keypad is shown in below fig. The keypad consist of 4 columns & 1 row ,i.e. 4 keys arranged as 4 columns and one row.

In above fig, four contact points of keys are made common & connected to the ground. The other four contact points are connected to the port pins of micro-controller .when key is pressed the low signal (zero) is detected by port pin .In software, keypad routing will use polling.

4*4 matrix keypad-(16 keys) In 4*4 keypad,16 keys are arranged in matrix fashion (i.e. 4 rows & 4 columns) To interface this keypad total 8 port pins are required By making all rows as output, we can check the column input to the micro-controller port pins or vice verse e.g. If rows are used as output, then by making one row zero we can check all columns, the column at which we get low signal, corresponding key to that column is pressed

Max 232 & its interfacing with micro-controller The various devices such as PC, GSM handset operates with RS232 standard. Microcontroller operates with TTL voltage levels .To interfacing these devices with Micro-controller, we need to use s line driver (voltage converter) to convert the RS232s Signal to TTL voltage levels that will be acceptable to the 8051s T*XD & RXD pins For this purpose MAX232 level converter is used. Pin out / Functional diagram of MAX 232

The MAX 232 has tow sets of line drivers for transferring & receiving data The line drivers used for TXD are called T1& T2 the line drivers for RXD are called R1&R2 T1&T2 Are used together for TXD & RXD of the microcontroller & 2nd set is left unused.HereT1IN is TTL side& is connected to TXD of microcontroller while T1 out is the ES232 side which is connected to the RXD pin of RS232 DB connecters, and R1 out is the TTL side which is connected to the RXD pin of the microcontroller. internal D.C. to D.C. converters If we will use MAX 233 instead of Max 232 the external capacitors are not required. But cost of the MAX 2333 is 10 times greater than Max 232. MAX232 requires four capacitors ranging from 1 to 22 micro-fared .These capacitors are connected to

Interfacing of microcontroller with RS485-(SN75176) RS485 is differential bus transceiver .It is designed for multipoint transmission on long bus lines in noisy environment Pin out of IC SN75176

Drivers has active high enable & receiver has active low enable .These two pins RE& DE (i.e. pin 2 & 3) can be connected together and used as direction control, i.e. If logic high is given to it , the transmission mode will be selected . The driver i/p (pin no 4) is connected TXD (pin 11) of microcontroller & the receiver o/p is connected to RXD (pin 10) of microcontroller .The pins A&B (NO 7&7)are connected to pins A&B(NO 6&7) of other RS485.

Interfacing of serial memory (AT24104) Memory AT 24104 The AT 24104 provides 4096 bits of serially electrically erasable and programmable read only memory (EEPROM) organized as 512 bytes of 8 bit each. It is accessed via a wire serial interface. Feature 1) Write protect pin for Hardware data protection.. 2) Low voltage & standard voltage operation. 3) 2-wire serial interface. 4) Bidirectional data transfer protocol. 5) Partial page writes are allowed. 6) High reliability Endurance is 1 million write cycle. Data retention 100 year. Pin description-

Serial clock (SCL):The SCL input is used to positive edge clock data in to each EEPROM device and negative edge clock data out of each device. Serial data (SDA). The SDA pin is bidirectional for serial data transfer. The pin is open drain driven and may be wired with any number o other open drain or open collector device. Device / page Addresses (A2,A1,A0) The A2,A1,and A0 pins are device address input . For AT24104 pins A2&A1 will be used . We can connect eight device with 2K capacity .

Write protect (WP) This pin provides Hardware data protection . The write pin allows normal read / write operations when connected to ground . When the write protect pin is connected to V cc the write protect features is enable. Memory organization The4 K bites memory is internally organized of memory with 256 pages of 2-bytes each. Interfacing Micro-controller & woking of memory. Interfacing:-

Fig . shows interfacing of serial memory 24104 with 8 bit micro-controller 89C51 .Pin No 5&6 (SDA&SCL) are connected to I/O pins (port pins) of microcontroller .These pins are normally pulled high with an internal device. The memory uses I2C (Inter-IC) protocol .This protocol is as follows, 1) Start condition. 2) Device code. 3) Address. 4) Data. 5) Stop condition.

Device operation The SDA pin is normally pulled high with an internal device. Data on the SDA pin may changes only during SCL low time period. Data changes during SCL high periods will indicated a start or stop conditions. Start condition A high to low transition of SDA with SCL high is a start condition. Before sending any information (i.e. device code, address data), the start condition is generated, Stop condition A low to high transition of SDA with SCL high is a stop condition. After a read sequence, the stop command will place the EEPROM in a stand by power mode, Device addressing AT 24104 uses , two pins A2&A1 for device addressing. The format for device addressing is as follows,

Where Po bit is used for page write,

Serial read time clock (RTC 1307) and Interfacing with Micro controller Pin out of DS1307

X1 & X2 :These pins are used to connect external crystal with value . 32.768 KHZ. VBAT:- +3V battery input is given at this pin. GND:Digital ground . SDA:- Serial data pin SCL:-Serial clock pin SQW/OUT:-Square wave output driver VCC:-Supply voltage.5V The DS-1307 serial Real Time Clock is a low power, full binary coded decimal (BDC) clock calendar plus 56 bytes of NV ROM. Address & data are transferred serially via a 2 =wire bi-directional bus. The clock /calendar provide seconds, minutes, hour, day, date, month and year information. The clock operates in either the 24 hour or 12 hour format with AM/PM indicator. The DS1307 has a built in power sense circuit that detects power failures & automatically switches to the battery supply.

Device operation & Interfacing with Micro controller.

DS1307 operates as a slave device on the serial bus . Access is obtained by implementing a START condition & providing a device identification code followed by a resister address, subsequent resister can be accessed sequentially until a stop condition is executed.

RAM address MAP:-

2 -Wire serial data bus


The DS1307 supports a bidirectional, 2 wire bus and data transmission protocol. A device that sends data onto the bus is defined as a transmitter and a device receiving data as a receiver. The device that controls the massage is caller a master. The device that Are controlled by a master are referred to as slaves. The bus must be controlled by a master device that generate the serial clock (SCL), controls the bus access, and generates the START & STOP condition. The DS1307 operates as a slave on the 2-wire bus configuration

:- Data transfer may be initiated only when the bus is not busy. :-Both data & clock lines high indicates bus not busy. :-During data transfer, the data line must remain stable wherever, the clock line is HIGH. Changes in the data line while the clock line is high will be interpreted as control signal.

Start condition:-A change in the start of data line from HIGH to LOW, while the clock is HIGH. Stop condition:-. A change in the state of data line from LOW to HIGH, while the clock is HIGH. The operating current is the current required to. Pull armature over the p\open gap. The release current is the current needed to restore the spring to its original position. Relays are manufactures with variety of contacts which vary from a single pair to number of pairs to control number of independent circuits. The basic contacts are single pole single throw, single pole double throw, double pole single throw and double pole double throw.

Relay driver circuit:= We are using single pole double throw (SPDT) relay. To perform switching of relay transistor BC 547 is used. Following fig. show relay driver circuit

Advantage of relays :=(over transistor) 1) Relay can switch AC & DC, where as transistor can only switch DC. 2) Relays can switch high voltage, transistor can not. 3) Relays are a better choice for switching large currents (i.e.>5A). 4) Relays can switch many contacts at once.

Potrebbero piacerti anche