

If MikroC asks to import libraries then click OK to import all libraries. Now make sure you have all this stuff, first of all create new project in MikroC, choose your Microcontroller i.e PIC18f452 and set frequency 4MHz (this is basically the frequency of oscillator, in our case we have used 4MHz). Total distance= count x (circumference/number of holes) Note: To get more accuracy increase the number of holes on disc and use the formula below So we can easily measure distance using this device. Now multiply the round count by circumference and display on LCD. Total distance = round count x circumference After a one complete round of disc wheel our distance will be equal to the circumference of disc used. Now place the disc wheel on ground and start rotating wheel when disc hole comes in front of IR Sensor after a complete rotation then IR sensor gives a LOW signal and we increment distance by one unit. We are using a round disc wheel with a hole on its corner and IR sensor is fixed in front of hole as shown in figure below. So are you wondering how we will use IR Sensor as distance measurement device? Pretty Cool.

If we place any object in front of IR sensor it give HIGH output signal otherwise signal remains LOW.

IR sensor give output as signal HIGH or LOW. It is modern distance measurement device using IR Sensor.
