0% found this document useful (0 votes)
22 views7 pages

Lavizares Plate No.1

The document describes a student laboratory assignment to create a microprocessor system to select and display readings from different sensors. The system uses a PIC16F877a microcontroller connected to an LCD display and buttons to select between a temperature, soil, or flame sensor. The student's work includes a circuit diagram created in Proteus, source code for the microcontroller, and a sample output screenshot displaying a temperature reading on the LCD. The work is evaluated based on functionality, circuit design, diagram presentation, and submission documents.

Uploaded by

Elgene Lavizares
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views7 pages

Lavizares Plate No.1

The document describes a student laboratory assignment to create a microprocessor system to select and display readings from different sensors. The system uses a PIC16F877a microcontroller connected to an LCD display and buttons to select between a temperature, soil, or flame sensor. The student's work includes a circuit diagram created in Proteus, source code for the microcontroller, and a sample output screenshot displaying a temperature reading on the LCD. The work is evaluated based on functionality, circuit design, diagram presentation, and submission documents.

Uploaded by

Elgene Lavizares
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

The UNIVERSITY of MINDANAO

College of Engineering Education

Microprocessor System

Plate No. 1

Analog Signal Selector

LAVIZARES, ELGENE LARODA


Student Name
(LN, FN MI)
LAB NO.1
Laboratory Rm No. Subject Code

Subject Teacher

Date Submitted

Score
Plate No. 1

I. Statement of the Problem:


Monitoring the different sensors is important in order to be aware of the
possibilities of an incident that may happen due to lack of sensing the
different parameters like temperature, flame, etc. with this you are to create
a system that will display the read analog signal from the different sensors.
The system consists of the following:
- Sensors namely temperature (degrees Celsius), soil (centibar (cb) or
kilopascal (kPa), flame or heat sensor (microamps (uA)).
- You are going to select which data you are going to display (see sample
output below).
- Use PIC16F877a for microcontroller LCD 16x4 for display and button
for selections.
- Use Proteus for simulation purposes.

Sample Output:
LCD OUTPUT:
Select the Data to Display Temperature Reading
1. Temperature 35 C
2. Soil Sensor
3. Heat/Flame Sensor

Soil Sensor Reading Soil Sensor Reading

30 cb (kPa) 5 uA
II. Screenshot of the Circuit Diagram using Proteus.
 The circuit diagram of the soil sensor and heat/flame sensor interfaced
with lcd using the pic16f877A microcontroller. It shows that I used a
default terminal for different pins to reduce complexity of the circuitry.

III. Source Code


sbit LCD_RS at RC0_bit;
sbit LCD_EN at RC1_bit;
sbit LCD_D4 at RC2_bit;
sbit LCD_D5 at RC3_bit;
sbit LCD_D6 at RC4_bit;
sbit LCD_D7 at RC5_bit;
sbit LCD_RS_Direction at TRISC0_bit;
sbit LCD_EN_Direction at TRISC1_bit;
sbit LCD_D4_Direction at TRISC2_bit;
sbit LCD_D5_Direction at TRISC3_bit;
sbit LCD_D6_Direction at TRISC4_bit;
sbit LCD_D7_Direction at TRISC5_bit;

void main() {
double temp, moist, flame;
int celcius, moist_value, flame_value;
char display1[10], display2[10], display3[10];
PORTD=0x00;
TRISB = 0xFF;

Lcd_Init();
ADC_Init();
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
delay_ms(50);
while(1)
{
main:
Lcd_Out(1, 3, "Select Data");
Lcd_Out(2, 2, "1. Temperature");
Lcd_Out(3, -2, "2. Soil Sensor");
Lcd_Out(4, -2, "3. Heat/Flame");

if(!PORTD.F0 && PORTD.F1 && PORTD.F2)


{
first:
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
temp = ADC_read(2);
celcius = ((temp*5.0)/1024)*100;
inttostr(celcius,display1);
Lcd_Out(1,3,"Temp Reading");
Lcd_Out(3,3,Ltrim(display1));
Lcd_Out(3,5,"C");
delay_ms(150);
if(PORTD.F0)
{
goto main;
}
goto first;
}
else if(PORTD.F0 && !PORTD.F1 && PORTD.F2)
{
second:
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
moist = ADC_read(0);
moist_value= (moist);
inttostr(moist_value,display2);
Lcd_Out(1,3,"Soil Reading");
Lcd_Out(3,0,Ltrim(display2));
Lcd_Out(3,4,"cb(kpa)");
delay_ms(150);
if(PORTD.F0)
{
goto main;
}
goto second;
}
else if(PORTD.F0 && PORTD.F1 && !PORTD.F2)
{
third:
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
flame = ADC_read(1);
flame_value= flame;
inttostr(flame_value,display3);
Lcd_Out(1,3,"Flame Reading");
Lcd_Out(3,2,Ltrim(display3));
Lcd_Out(3,5,"uA");
delay_ms(150);
if(PORTD.F0)
{
goto main;
}
goto third;
}

}
}
IV. Sample Screenshot of the OUTPUT.
 It shows the temperature reading who currently displayed in the LCD
which is 79 C.

Fig. 1 Temperature Reading Fig. 1 Temperature Reading

As shown in figure 1 is the reading of the temperature sensor. The temperature


reading is classified as normal, hot and cold…

V. Rubrics:
a. Functionality (50%)
b. Design of the Circuit Diagram (25%)
c. Presentability of the Circuit Diagram (15%)
d. Submitted Documents (10%)

You might also like