You are on page 1of 19

REALIZATION OF I2C PROTOCOL USING RTC TECHNIQUE

BATCH 24

VENUGOPAL.P SATHISH .A JANARDHAN.P VENKATRAMAN.M


INTERNAL GUIDE MR.S.SIDDIK.BE

PROJECT CO-ORDINATOR MR. K.SENTHAMILSELVAN, ME, p.hd.,

ABSTRACT
Our project is REALIZATION OF I2C PROTOCOL USING REAL TIME CLOCK TECHNIQUE in this project realizing the I2C protocol and implementation of I2C Protocol with Atmel 89c51 and REAL TIME CLOCK IC (DS1307).Using I2C protocol external peripherals can connect with microcontroller but in our project RTC IC interface with microcontroller and controlling a devices by setting year ,month ,day ,hours ,minutes ,and seconds in the RTC IC.We hope this development will lead a new role in industry in future.

AIM OF THE PROJECT:


THE AIM OF THE PROJECT IS TO CONTROL THE HIGH CURRENT DEVICE BY USING I2C PROTOCOL USING RTC TECHNIQUE.

REAL TIME CLOCK CHIP


The DS1307 serial real-time clock (RTC)CHIP is a lowpower,full binary-coded decimal (BCD) clock/calendarplus 56 bytes of NV SRAM.
Address and data are transferred serially through an I2C, bidirectional bus. The clock/calendar provides seconds, minutes, hours,day, date, month, and year information.

The end of the month date is automatically adjusted for months with fewer than 31 days, including corrections for leap hour format with AM/PM indicator. The DS1307 has abuilt-in power-sense circuit that detects power failures and automatically switches to the backup supply. Timekeeping operation continues while the part operates from the backup supply.

FEATURES OF RTC :
Real-Time Clock (RTC) Counts Seconds, Minutes, Hours, Date of the Month, Month, Day of the week, and Year with Leap-Year Compensation Valid Up to 2100 . 56-Byte, Battery-Backed, General-Purpose RAM with Unlimited Writes. I2C Serial Interface

Programmable Square-Wave Output Signal

Automatic Power-Fail Detect and Switch Circuitry Consumes Less than 500nA in Battery-Backup Mode with Oscillator Running Optional Industrial Temperature Range: -40C to +85C

Available in 8-Pin Plastic DIP or SO


Underwriters Laboratories (UL) Recognized

What is I2C
The name stands for Inter - Integrated Circuit Bus A Small Area Network connecting ICs and other electronic systems Originally intended for operation on one single board / PCB
Synchronous Serial Signal Two wires carry information between a number of devices One wire use for the data One wire used for the clock

Today, a variety of devices are available with I2C Interfaces


Microcontroller, EEPROM, Real-Timer, interface chips, LCD driver, A/D converter

I2C Bus Configuration Example

BLOCK DIAGRAM

BLOCK DIAGRAM EXPLANATION Initializing the time and date in the RTC chip through I2C protocol . Real Time and date information is read by microcontroller and then and display in LCD ,LCD used to display time and date of RTC and controlling device timing also. Through setting the device timing either by switch or pre initialization the program itself we can control the any devices. power supply required for both RTC chip and microcontroller .RTC clock having separate battery for to run continuous clock without interrupt .by setting the time in rtc , we can control many device by timing .But in our project we are controlling DC motor.

CIRCUIT DIAGRAM

CIRCUIT DIAGRAM EXPLANATIONS

The 8 bit microcontroller 89c51is used in this circuit to interface lcd and RTC and switches . RTC Real time clock ic DS 1307 is used for clock timing and date .That the time is initialization in the by switches s0,s1,s2,s3 .the switches connected with the microcontroller port 1 pin p1.0,p1.1,p1.2,p1.3 .crystal 12 MHZ connected with microcontroller pin 19 and 18 xtal 1 and xtal2 . The real time clock chip DS1307 pin number 5 & 6 SDA and SCL connected with the microcontroller port0 p0.0,p0.1pin number 38 & 39 shorted with the resister 10K R1&R2and connected 5V . microcontroller port 2.0 to port2.7 is connected with the LCD data D0 to D7. The microcontroller port3.0 is connected with the LCD read pin 4 . the port 3.1 connected with LCD write pin 5. Port 3.2 is connected with LCD enable pin 6 . that we can take the output from the controller p3.2 to p3.7 according to the program . but in this circuit we connected the relay drivers circuit at port 3.4 32KHZ crystal resonator are used for DS1307 . DS1307 ground pin number 4 . positive supply at pin number 8 and 3V battery positive is connected with Vbat , pin number 3 and then battery connected with pin number 4. For LCD pin number 1 is for ground and pin number 2 is for VCC and pin number 3 is for VEE. For microcontroller pin number 20 is ground. Pin number 31 ,9 &40 connected with 5V supply .

EMBEDDED SYSTEM
An embedded system is some combination of computer hardware and software either fixed in capability or programmable that is specially designed for a particular function. A computer system designed to perform one or few dedicated function often with real time computing constraints. Embedded system are controlled by or more main processing cores that is typically either a microcontroller or a DSP. These are processors, arrays or other hardware using dedicated logic or programming called FIRMWARE. They are designed around a microcomputer which integrates memory and peripherals.

MICROCONTROLLER
ATMEL 89C51 FEATURES COMPITABLE WITH MCS 51 PRODUCTS. 4K BYTES OF IN-SYSTEM REPROGRAMMABLE FLASH MEMORY ENDURANCE:1,000 WRITE/ERASE CYCLES. FULLY STATIC OPERATION:0 HZ TO 24 MHZ. THREE-LEVEL PROGRAM MEMORY LOCK. 128x8-BIT INTERNAL RAM. 32 PROGRAMMABLE I/O LINES. TWO 16-BIT TIMMER/COUNTERS. SIX INTERRUPT SOURCES. PROGRAMMABLE SERIAL CHANNELS.

PROGRAM FLOW CHART


START
INITIAL LCD INITIAL I2C START I2C

SEND RTC ADDRESS


SEND INITIAL LOCATION SEND SECONDS

SEND MIN,HRS,DAYS,MONTHS,YEARS SEND STOP


START I2C SEND RTC ADDRESS FOR WRITE SEND RTC ADDRESS FOR FIRST LOCATION SEND READ ADDRESS READ SEC,MIN,HRS,DAYS,MONTHS,YEARS I2C STOP

SEND TO LCD
DELAY FOR 1 SEC

CONCLUSION
This our project will be new attempt at the student level being a real time clock project student will have wide exposure to the real time I2Cprotocal project .
In our project real-time clock application is widely used in the irrigation field ,it is easy to implement in the irrigation field , with low cost, most effective and easy to maintains. our project will surely prevent the hardships faced by a farmers when he works in irrigation field .

This project would not have been a great success without the guidance and support of our department staff .we thank them whole heartily.

You might also like