Infrared receiver and transmitter

First of all, I have no idea what I'm doing and am really confused as where to start. I have some programming knowledge, but I'm at a loss when it comes to hardware. However, I'm part of a college project where I have to calculate the distance with a infrared receiver and transmitter which I both need to put on an arduino board. The idea sounded simple, but I have not even the slightest clue how to put them on the arduino itself (The datasheets aren't really helpful), let alone make them send a signal and calculate the time it takes for the signal to reach the destination and back.

Can you guys help me get on the right track?

Thanks in advance.


PS: The transmitter and receiver are: LD274 and B104

Sorry but you can't do that with those. You need a special distance detector module, like the Sharp one:-

Well, I don't really have the option to buy those as of now, sadly. Is there completely no other way to do it with these? If there isn't, could you please tell me how to attach them to the Arduino to try some different stuff?

Is there completely no other way to do it with these?

No you can't use these for measuring distance. You can measure short range proximity by getting the IR to bounce off an object but you don't get any distance reading.

It is simple to connect them, just wire up the sensor to one of the analogue inputs and do an analogue read on the sensor. Like shown here:-


Can you get a really coarse grained set of distance measurements by driving the emitter with low, then medium, then high current ?

If the detector is trigged with the emitter driven with a low current, you know something is close, medium current - its near but not too near, high current, its further away, not triggered by any of them - its really far away.

4 - distance levels

Duane B

While that sounds fine in theory it simply does not work. There are several problems:-

  1. The range we are talking about is tiny, less than 2cm
  2. The results will depend on the ambient light conditions
  3. You need some sort of D/A to drive the IR emitter with different currents

However as the OP has not stated what he wants the distance measurements for, or for that matter what range of distances he wants to measure it is hard to offer alternative advice.

If you had multiple IR receivers, you might have a shot at it.

The sharp distance sensor all use triangulation and a small linear CCD array to compute the distance and/or presence of objects in the field of view. The location of the reflection in the receiver array (CCD) allows it compute distance based on the angle of reflection.


I saw the IR Approach I suggested mentioned somewhere else, I think it was on letsmakerobots - it made sense to me and so I actually went out and bought a few more IR Receivers to try it with.

I am planning to add npn transistors and series resistors to the transmitter cathodes with say 500 Omh, 2K2 and 10K so I can switch between three drive currents.

Duane B