3.33333

3.3 | 3 ratings Rate this file 18 Downloads (last 30 days) File Size: 89.15 KB File ID: #16175
image thumbnail

Read a LM92Temperature Sensor using a PIC16F877 and MATLAB

by lazaro camargo

 

30 Aug 2007 (Updated 30 Aug 2007)

Reading a LM92 Temperature Sensor using a microcontroller PIC16F877 and display the plot with Matlab

| Watch this File

File Information
Description

Reading a LM92 sensor temperature using a microcontroller PIC16F877, and using the Matlab to read the serial port and plot the results

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Read LM73 Temperature Sensor

MATLAB release MATLAB 7 (R14)
Other requirements a PIC16F877
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
05 Oct 2007 Sudhir Gupta

It provides a starting point for Instrument Control ToolBox and RS-232 based data acquisition.

27 Feb 2008 shashank jain

It provides a good startup for interfacing...Infact it debbuged my problem.

06 Mar 2008 Ved Vernekar

what kind of data is being sent by the PIC?? if hex then wats the range accepted by the matlab code, i want 2 try it out using a comp to simulate the data transmission..... im workin on a similar project but using an 89c52

13 Mar 2008 wibble blibble

See "Diode Temperature Sensor using I2C bus & ADM1034" for something similar that uses standard off-the-shelf hardware rather than having to program a PIC. It will work with any I2C sensor or ADC

04 Jun 2010 Anuradha Nanayakkara

Hello all,

I need to read my sensor data which comes to the serial port of the PC continuously and plot them real time.
The above program do this only for a limited period of time.

When run with my sensor it gave the following error.

Warning: The input buffer was filled before the Terminator was reached.
Temperature= NaN oC

Can somebody help me to resolve this issue.

Is it ok if i increase the variable i in the following for loop to change from 0:65525(some big value)?
for i= 1 :60 %acquisition of 100 points
    
    data(i)=(str2double(fscanf((s1)))/100); %read sensor
    
    disp(sprintf('Temperature= %3.2f oC' ,data(i)))
  
end

plot(data); %plot 100 points

Also i can't understand how we are getting 100 values becaude we are chaanging i 0:60

Hoping a soon reply.

Thank you.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
example lazaro camargo 22 Oct 2008 09:24:55
application lazaro camargo 22 Oct 2008 09:24:55
lm92 temperature sensor serial port pic16f877 lazaro camargo 22 Oct 2008 09:24:55

Contact us at files@mathworks.com