This project mainly consists of three units: a sensor unit, an ADC component and the LCD module.
The sensor, Sharp 2Y0A02 infrared ranger, gives an output voltage proportionate to the distance of an object from it. It has a detection range of 20cm - 150cm and the output characteristic can be obtained from the datasheet. The analog output of the sensor is connected to the input of the ADC0804.
The input received at ADC is processed and its equivalent binary is sent to the microcontroller. The Vref/2 pin of the ADC is connected to a preset which can be adjusted to set the step size for relevant measurement.
The microcontroller AT89C51 is programmed to read the digital output from ADC and convert it into a decimal representation. This value corresponds to the distance of the object and is sent to be displayed on a 16x2 LCD.
Note: This value does not correctly represent the distance. For actual measurement, it has to be calibrated in accordance with the characteristic curve given in the datasheet, through microcontroller programming.