In principal they work pretty simply a fixed quantity of light is emited and the amount reflected indicates distance.There are a number of gotcha'sThe material doing the reflecting greatly affects the quantity of light returned (mirror/black body).Ambient IR WILL affect a simple (non-pulsed) light source/receiver combination.Electrical noise crossover between transmitter and receiver.If I were you I'd look at experimenting with homemade ultrasonic sensors first. It is very unlikely you could produce a homemade IR sensor that approached the functionality of one of the commercial units for anything approaching the cost of a commercial IR sensor ($12 is very CHEAP for what you get).If you still want to pursue, one Idea I would consider is to eliminate the measured range component and work on a discrete number of ranges (ie 2 or 3). This could be accomplished with 2 or 3 sensor circuits set to different levels of sensitivity. My gut tells me this might prove easier to get working (op-amp circuits are easy) and could also implement filtering. If you get this working you could increase the number of ranges by simply reproducing the circuit as many times as needed.You could even use multiplexers to feed multiple sensor points into the single set of circuits to allow the op-amps to sense from multiple directions (one at a time)
I know the material doing the reflecting will greatly affect an IR-sensor but that is not very important to me, as I am just doing this to see how good I can make it compared to something that costs 10x more. Besides, wouldn't an ultrasound-sensor have at least a semblance of the same issues? Some materials are extremely reflective to sound, some mostly let it pass through and some are "dead", as in they absorb sound-vibrations..
And as to ambient light/IR affecting my sensor-readings.. won't I have a fair shot at negating this by, like I proposed, taking one reading with the sensors IR-source OFF (to get an ambient IR-light reading), then taking one with the sensors IR-light ON and subtracting the two? With Arduino, I am guessing I can do this quite a few times per second (and if needed average a few readings at a time), though nowhere near the KHz frequencys that commercial IR-proxys are modulated at.
Yeah but the Sun doesnt produce sound. Ultrasonic would have similar issues but they would be far less problematic than IR.
Which is why I would take an ambient light reading. Am I waaay of here? Is there some obvious thing I am missing? =P
1. Read amount of IR-light from the Sun.2. Read IR-light from the Sun + IR from strong emitter on sensor3. Subtract first reading from second reading. Sun - (Sun+light from sensor) = light from sensor.
I think this is not the way people build distance sensors
No you are wrong, many commercial distance sensors use the principal of reflected IR light.