Referring to ADC module of PIC18F4550, there are many analog output sensor to interfaces with this MCU. LM35 is a simple analog temperature sensor, creating analog voltage output representing its temperature conversion in degree Celsius. The step temperature from this device is 10 mV per degree Celsius. I don't want to put all its details here. For more information about using this device, please see this post.
In this post, LM35 connects to AN2 analog channel of the ADC. The MCU reads the analog voltage, converting it to temperature value in both degree Celsius and degree Fahrenheit.
A temperature reading of 31.2 degree Celsius. |
A very simple LM35 comes in a transistor-like TO-92 package.
LM35DZ in TO-92 package. |
C source code fed from GitHub.
Click here to download the zip file of this example.
Schematic Diagram |
No comments:
Post a Comment