Hi,
How would I connect LDR or RTD to the ADC port of my microcontroller ?
Would I connect in two ADC pins dirtectly?
Or i would have to follow a circuit diagram?
What is the main logic?
Please explain and upload circuit diagram if there any.
No you can not connect an RTD not an LDR directly to a microcontroller pin. These two sensors are mere temperature dependemt resitors; meaning that the value of their resistance varies with temperature. You need to convert this variable resistance to a voltage so that it can be sensed with an ADC. The best strategy is to supply them with a constant current (from a current source) and measure the developed voltage. Feed this voltage to the ADC to convert to digital form.
You could take a look at the 8051-based microcontrollers made by Analog Devices for example the ADuC834 has facilities to directly interface to RTD devices.
try connecting it using the inbuilt ADC pins (Eg: PORTA for ATmega16),choose appropriate mux channel and program d algorithm using AVRSTUDIO GCC compiler,output digital signals can be taken from other ports.Watch out videos of tishitu electronics on youtube.
Added after 2 minutes:
It's better to use ADC chips than to use the Adc pins of uC
A Simple arrangement to use these sensors with an ADC is to form a voltage divider circuit. This can be done very easily by connecting the LDR in series with a fixed resistor. Since the two resistors (fixed resistor and LDR) are forming a voltage divider circuit there will be a certain voltage drop across each resistor.
As the resistance of the LDR varies with the intensity of the incident light there the voltage drop across it will also vary.
This change of voltage can be sensed by any ADC wheather it is a built in ADC inside a controller or an independent ADC.
The circuit diagram of a simple circuit that explains the above arrangement is added an an attachment.
One another alternate way for LDR is use comparator with 0.6v internal ref on comparator - pin & at +pin give LDR voltage to compare the light intensity for Light.