Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem regarding reading input from LM35 temperature sensor with PIC 16F877

Status
Not open for further replies.

prasanth1216

Newbie level 3
Joined
Jun 22, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,309
I'm trying to read the temperature from a LM35 sensor and print it on an LCD display using PIC 16F877.. But I'm getting an error message in PROTEUS ISIS as 'Power Supply' (1.52v) is outside specified range(3.5v-30v)..
Pls help me .
desgn.JPG
 

Sir,

I have connected the components as you specified..but still i am getting the same error message..
According the error message: the sensor produces only milliVoltage and that is being given to the pic,but the chip requires 3.5V to 30 V ..I think pic is not getting enough voltage.. Is it right ?
 

Hi,

Try this design, as you can see you only get 10mv per deg C. 1.5v is the maximum output from the LM35

Also you need to Pull UP Mclre otherwise your program will not run.

If this design does not work, post you code in case that is causing the problem. - Assume you have configured you input port for analogue ?
 

Attachments

  • ScreenShot001.jpg
    ScreenShot001.jpg
    13 KB · Views: 282
Hi,

Try this design, as you can see you only get 10mv per deg C. 1.5v is the maximum output from the LM35

Also you need to Pull UP Mclre otherwise your program will not run.

If this design does not work, post you code in case that is causing the problem. - Assume you have configured you input port for analogue ?



I modified the design,but still its not working... I don't have much knowledge about sensors circuit..pls help me .....
Thanks in advance.....

Prasanth
desgn2.JPG
 

Hi,

Your design is basically ok, you do not need to show the crystal for the simulation.

Have you set up the Pic chip ? Point onto it and right click, then enter the Crystal frequency used and point the Program Code box to your .hex file from Mplab/Complier.

Then it should run.
If it does not post your program code, in Assembler or C ,together with the .hex file you have built.
 

Attachments

  • ScreenShot002.jpg
    ScreenShot002.jpg
    56 KB · Views: 175

I modified the design,but still its not working... I don't have much knowledge about sensors circuit..pls help me .....
Thanks in advance.....

Prasanth
View attachment 76166

The interface is okay.

But you haven't told us what is going wrong. What do you mean by "still its not working"? Do you get any error messages from Proteus? Or is it that you don't get any error messages, but the circuit isn't simulating as it should?

You haven't pulled your LCD R/W pin low to write to it. You should ground that pin or send a logic 0 from the microcontroller to that pin.
 
Hi Tahmid,

He had make a mistake while connecting VDD of LCD1602 to GND....Please correct me if I am wrong...

I refer the link -

**broken link removed**

regards,

milind
 
Prasanth, please try this code...


New Picture.jpg


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// LCD module connections
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;
 
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
// End LCD module connections
  int i;
  unsigned input;
  char output[13],tmp[10];
void main(){
   Lcd_Init();
 
   //ADC_Init();
   TRISA  = 1;
  while(1) {
   PORTA=0;
    Delay_ms(300);
   
   input = ADC_Read(0);
   input=floor(input*0.48876);
   strcpy(output,"Temp :");
   IntToStr(input,tmp);
 
   i=strlen(tmp);
   tmp[i]='\0';
     strcat(output,tmp);
   //strcat(output, " ' C");
   
   Lcd_Cmd(_LCD_CLEAR);
   Lcd_Out(1,2,output);
 
  // Lcd_Cmd(_LCD_CLEAR);
 
    }
}

 
Last edited by a moderator:
Hi Tahmid,

He had make a mistake while connecting VDD of LCD1602 to GND....Please correct me if I am wrong...

I refer the link -

**broken link removed**

regards,

milind

You are right on the correct connection but I don't think it makes a difference in proteus , it works even without supply so I think that the power pins are not modeled.

HD44780-pinout.jpg lcd.png
 
In the LCD you have connected VDD to GND instead of Connecting VSS to GND.

- - - Updated - - -

The problem is because you have connected an AC Source to LM35. Connect a DC Power Supply to LM35. The error (3.5V - 30V) is for LM35.
 


I'm trying to read the temperature from a LM35 sensor and print it on an LCD display using PIC 16F877.. But I'm getting an error message in PROTEUS ISIS as 'Power Supply' (1.52v) is outside specified range(3.5v-30v)..
Pls help me .
View attachment 76145

Hi, I'm from Indonesia, I got same problem with you. And now I can solve it. You can try to use 5V DC power source to LM35. Then the (-) connect to the ground.
 

Try the following,
1.just connect the first pin of lm35 to Vcc & 3rd pin to GND
2.There is no need to connect Vss,Vdd,Vee pins,so GND only the RS pin
3.Connect MCLR pin direct to Vcc
4.Specify crystal frequency
in actual circuit you need to connect all components but for isis you don't have to.check the output voltage of lm35 using dc voltmeter,you can see a rise of 10mv/1d.cel
post the code if error persists.

regards
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top