CAM Project GK
CAM Project GK
BACHELOR OF TECHNOLOGY
in
ELECTRONICS AND COMMUNICATION ENGINEERING
Submitted by
TABLE OF CONTENTS
CHAPTER 1 INTRODUCTION 1
CHAPTER 2 COMPONENTS 2
2.1 8051 2
Microcontroller
2.2 ADC0804 Board 2
2.3 16*2 LCD Display 3
2.4 LM35 Sensor 3
2.5 Potentiometer 4
2.6 Jumper Cables 4
CHAPTER 3 Circuit Diagram 5
CHAPTER 4 Code 6
CHAPTER 5 Simulation 8
CHAPTER 6 Conclusion 9
i
Course Project Report
CHAPTER 1
INTRODUCTION
CHAPTER 2
COMPONENTS
2.1-8051 Microcontroller
8051 microcontroller is an 8 -bit microcontroller which has 128 bytes
of on chip RAM , 4K bytes of on chip ROM, two timers, one serial port
and four 8 bit ports.
16*2 LCD is a widely used display for embedded applications. There are
two very important registers inside the LCD called data register and
command register. Command register is used to send commands such as
clear display, cursor at home etc., data register is used to send data which
is to be displayed on 16*2 LCD.
2.4-LM35 Sensor
The LM35 is a temperature sensor whose output voltage is linearly
proportional to Celsius temperature. The LM35 comes already calibrated
hence requires no external calibration. It outputs 10mV for each degree of
Celsius temperature.
2.5-Potentiometer
2.6-Jumper Cable
CHAPTER 3
CIRCUIT DIAGRAM
CHAPTER 4
8051 C-CODE
#include<reg51.h>
sfr LCD = 0xA0; //P2=LCD Data pins
sbit RS=P0^5; //Register select (RS) pin of 16*2 lcd
sbit RW=P0^6;
sbit EN=P0^7;
void main(void)
{
msDelay(20);
LCD_INI();
Send_Data("TEMPERATURE");
INTR=1;
RD_ADC=1;
WR_ADC=1;
while(1)
{
WR_ADC=0;
msDelay(1);
WR_ADC=1;
while(INTR==1);
RD_ADC=0;
value=ADC;
convert_display(value);
msDelay(1000);
RD_ADC=1;
}
LCD_CMD(0xc6);
x1=(value/10);
x1=x1+(0x30);
x2=value%10;
x2=x2+(0x30);
x3=0xDF;
LCD_DATA(x1);
LCD_DATA(x2);
LCD_DATA(x3);
LCD_DATA('C');
}
void LCD_CMD(unsigned char x)
{
LCD = x;
RS = 0;
RW = 0;
EN = 1;
msDelay(1);
EN = 0;
return;
}
void LCD_DATA(unsigned char w)
{
LCD = w;
RS = 1;
RW = 0;
EN = 1;
msDelay(1);
EN = 0;
return;
}
void Send_Data(unsigned char *Str)
{
while(*Str)
LCD_DATA(*Str++);
}
void LCD_INI(void)
{
msDelay(100);
LCD_CMD(0x38);
LCD_CMD(0x0E);
LCD_CMD(0x01);
}
void msDelay(unsigned int Time)
{
unsigned int y,z;
for(y=0; y<Time; y++)
for(z=0; z<500; z++);
}
CHAPTER 5
SIMULATION
CHAPTER 6
CONCLUSION