this instrument can detect precisely any object from a distance of 40 cm to 0.5 cm.
and this can actually calculate the distance of the object .
Here i will use this feature to analogWrite the LED.  which will incerease its brightness as the distance gets lesser ...

Step 1: The Circuit

You Can Build this with these Materials :-

-Arduino (Uno)
-Jumper Wires
-LED(Indicator ,any colour)
-IR LED Pair

You should follow The Schematict to make your own sensor then you may follow ahead ........
<p>So, the sensor output value is a voltage in the range of 170 to 980, correct? is that millivolts? microamps? </p><p>The sensor output range will depend on your power supply, right?</p><p>i'm thinking you could take the Arduino out of the circuit, and drive the LED directly from the sensor, no? Maybe with a boost transistor.</p><p>thx</p>
<p>It's the Arduino's ADC value, each unit is equivalent to roughly 4.8 millivolts. The scale is 0v-5v. </p>
Dudes is right .
<p>Nice job! </p>
<p>could i get rid of the arduino and just mesure the voltage output of the ir led?, will it be proportional to the distance?</p>
Yeah sure . But the voltage will be inversly proportional . As amount of IR light reflected is inversly proportional to distance . You might have to do some careful caliberations .Go ahead and tell me how it worked ..!
<p>confused, because i thought the IR sensor outputs only low or high. How does it detect distance? thx</p>
<p>you are reading the voltage drop across the IR Sensor ! that is analog voltage !</p>
<p>i made it too but works sometimes and sometimes it dont(shows frequent zero's and high numbers) Help me plzz</p>
<p>Is it the same code ? or have you modified it ?</p>
<p>I Made It</p>

About This Instructable




More by HarshV:Automatic Temperature Sensor  IR-Distance (Analog Value) Sensor 2$ Opto-Isolator  Homemade (9 - 35 Volts with Arduino) 
Add instructable to: