PIC16F877A interface LM35 temperature sensor project tutorial using MikroC code & Proteus demo.
Learning Microcontrollers Learning Microcontrollers
3.09K subscribers
2,644 views
54

 Published On Oct 9, 2022

Hello guys Welcome to learning microcontrollers,
Guys I had made a course for you guys on Udemy.
This course will teach you how to directly get your hands dirty on arduino and make useful projects to earn money.
Please do take this course on udemy this will greatly help me to grow my channel.
You will assisting my channel by paying for that course.
Here is the link to the course:


https://www.udemy.com/course/learn-ar...


A quote:
Learn from cradle to grave.
/
/
/
////////////////////// Hello Guys,
Welcome to learning Microcontrollers.
I had made a course for you guys to learn under my direction supervision on Udemy.
This course will make you a master of PIC microcontroller based projects making using MikroC for PIC software.
Please do take this course the link is below. This will greatly help my channel aswell to grow.
https://www.udemy.com/course/pic-micr...

A beautfiul quote:
The road to sucess is always under construction.
/
/
///////////////////////////////////////////////////// Hello guys,
This tutorial is about how to interface an LM35 sensor with a PIC16F877A microcontroller and it displays output on a 16x2 LCD. Demonstration is on proteus software.

Become a Patreon and support my channel using link below:
https://patreon.com/user?u=81261678

How to setup PIC hardware video link:
   • Setting up a PIC16F877A/PIC16F887/PIC...  

How to setup Lm016 16x2 LCD video link:
   • PIC16F877A interface Lm016 16x2 JHD L...  

Code of current video is as under:

// Lcd pinout settings
sbit LCD_RS at RC0_bit;
sbit LCD_EN at RC1_bit;
sbit LCD_D7 at RD1_bit;
sbit LCD_D6 at RD0_bit;
sbit LCD_D5 at RC3_bit;
sbit LCD_D4 at RC2_bit;

// Pin direction
sbit LCD_RS_Direction at TRISC0_bit;
sbit LCD_EN_Direction at TRISC1_bit;
sbit LCD_D7_Direction at TRISD1_bit;
sbit LCD_D6_Direction at TRISD0_bit;
sbit LCD_D5_Direction at TRISC3_bit;
sbit LCD_D4_Direction at TRISC2_bit;
float temp;
char temp1[6];
float celcius;

void main() {
LCD_init();
Delay_ms(500);

ADC_init();
Delay_ms(500);

Lcd_Cmd(_LCD_CURSOR_OFF);
Delay_ms(100);

Lcd_Cmd(_LCD_CLEAR);
Delay_ms(100);

while(1)
{
temp = ADC_read(0);
Delay_ms(50);

celcius = ((temp * 5.0)/1024) * 100;
Delay_ms(50);

floattostr( celcius , temp1 );
Delay_ms(50);

LCD_OUT(1,1, "Temp = " );
LCD_OUT(1,9, temp1);
LCD_OUT(1,16, "C");
Delay_ms(100);



}
}

show more

Share/Embed