Infrared Range Finder

Discussion in 'The Projects Forum' started by mosfetmike, Mar 25, 2014.

  1. mosfetmike

    Thread Starter New Member

    Apr 19, 2013
    6
    0
    Hello,

    I am working to design an infrared range finder that will measure distances under a meter. The accuracy doesn't have to be great. The goal is to use it to navigate a rover autonomously through a simple maze. I have worked on it for some time now with little luck.

    I am starting to ask the question...is this even possible/practical?

    I want to have an infrared LED that "bounces" light off of walls in the vehicle's path. A phototransistor (maybe photodarlington) will receive the reflected light. After filtering, amplifying, and peak detecting the signal, I will input the signal into the Arduino's ADC. Then based on the output (range data), I will program the microcontroller to control the motors of the rover (i.e. telling it to stop, execute turn, check path, start again).

    I'm trying to base the project off of this Instructable: http://www.instructables.com/id/Homemade-Infrared-Rangefinder-Similar-to-Sharp-GP/. However, this circuit is very short range (few inches). I am trying to improve the range in hopes of using it for navigation, but am doubting if that is even possible now. From what I've gathered infrared is a little fickle to work with because of scattering, etc.

    Does anyone have any ideas about whether I should continue to pursue this or chalk it up as a loss?

    Thanks!
     
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Personally, I'd just buy a Sharp IR sensor, but that depends on the goal of the project - are you trying to make a robot solve a maze, or make an IR sensor?
     
  3. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,292
    1,255
    It might work. If it is to run a maze the walls may reflect pretty well. I think what I would try is to get it working at short range then you can increase the power or the number of LEDs to increase the range.
     
  4. mosfetmike

    Thread Starter New Member

    Apr 19, 2013
    6
    0
    Simply trying to make an IR sensor that will help the robot avoid running into walls. The Sharp's sensor would work, however, for this project, I want to do something that requires a little design.
     
  5. mosfetmike

    Thread Starter New Member

    Apr 19, 2013
    6
    0
    Getting even a short range to work has been the most difficult problem. I am putting about 70 mA through the IR LED (I will eventually pulse it at 38 kHz) but the signal is to weak to be detected by the photodiode/bjt darlington pair. The BJT isn't even turning on.
     
  6. alfacliff

    Well-Known Member

    Dec 13, 2013
    2,449
    428
    since the reflection is coming back at aprox 10.4 microseconds per mile, a few inches is way less than a nanosecond. try some optical tricks like spherical lenses.
     
  7. mosfetmike

    Thread Starter New Member

    Apr 19, 2013
    6
    0
    alfacliff,

    Do you mean use a lens to gather the reflected light as it comes back to the receiver? I will try that, but first, I need to find out how to get the circuit working with direct transmission (i.e. emitter facing directly at receiver). Then I will work towards getting receiver to detected the light when it is reflected off an obstacle (wall).

    Thanks to everyone for all of the input.
     
  8. sirch2

    Well-Known Member

    Jan 21, 2013
    1,008
    351
    AFAIK those Sharp devices have a number of IR sensors in a line and a lens, and the distance is detected by which sensors receive the IR. So suppose the IR LED is on the left of the lens, the further away the surface is, the further to the right the reflected light hits the line of sensors.

    You need to modulate the IR LED so you can separate your signal from ambient IR.

    You can do a similar thing with a laser and a webcam, which might be a good place start to get a feel for it, it's a lot easier when you can see what is happening. Here is an example - https://sites.google.com/site/todddanko/home/webcam_laser_ranger
     
    Last edited: Mar 25, 2014
  9. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,292
    1,255
    I'm not sure the input circuit in the link is correct. What photo diode/transistor are you using?

    PS. He is trying to measure amplitude and not time.
     
  10. mosfetmike

    Thread Starter New Member

    Apr 19, 2013
    6
    0
    ronv,

    I am using the following components:

    Emitter: SFH 4545 (940 nm)
    Photodiode: BPV22F
    Transistor: BC337

    And yes, you are correct, I am trying to measure the amplitude of the voltage related to the intensity of the reflected signal. If I understand it correctly, I can correlate the intensity of the reflected wave to the distance since the intensity is inversely related to the squared distance.
     
  11. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,064
    3,836
    Show us your circuit. Are you properly biased? Do you have a lot of background IR that will be difficult to differentiate from the Emitter? pulsing may make matters easier. also, using an OpAmp may be easier than a simple transistor circuit. You can set the threshhold voltage.

    Also, your IR emitter has a very narrow emission pattern (10 degrees). You have to be very well alligned. Distance might be your friend here to make sure the small dot of light at 1 cm broadens to something that the receiver can actually see at a half meter.
     
  12. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,546
    1,252
    That correlation holds only if everything in the robot's universe has the same reflectivity. The reason cars use ultrasonics for backup alarms is that a flat black bumper has the same audio reflectivity as a shiny chrome one.

    ak
     
  13. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,064
    3,836

    Intensity is the way, and in maze robot competitions, the walls are consistant reflectivity. Most importantly, if a robot is designed correctly, the gap in a wall has no reflectivity.
     
  14. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,292
    1,255
    Try it hooking the cathode of the diode to V+.
     
  15. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,292
    1,255
  16. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    DC reflective IR is only good for tiny ranges, an inch or two, and the output will depend on the surface colour and reflectivity and ANGLE relative to the emitter.

    AC reflective IR can have a much larger range, but is more complex because you need to modulate the IR LED and use an AC amp after the IR sensor, followed by an AC->DC converter to give you a DC voltage based on range.

    And even then it will still have all the bad issues like surface and angle dependencies.

    If you want to detect things more than 2 inches away just use a Sharp GP2 style sensor. :)
     
  17. DickCappels

    Moderator

    Aug 21, 2008
    2,660
    632
    Just an idea:

    If you use this method with multiple emitters, you can use this method to find distance to a wall. The method relies on the fact that the reflected light from most surfaces has its highest amplitude when the angle of the beam from the emitter to the reflecting surface with respect to a line perpendicular to the reflecting surface is complementary to a line drawn from the detector to the same spot on the reflecting surface (in short, when alpha1 = alpha 2). The smaller the angle, the greater the distance, so comparing the response to multiple emitters at different angles will tell your controller the distance.

    A detector circuit and a block diagram of the signal processing circuit can be found in the patent at this link.

    [​IMG][​IMG][​IMG]
     
    Last edited: Mar 26, 2014
  18. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    I'm puzzled by the Apple patent; it looks like just a claim that you can detect when a mouse has been lifted off a table by means of a reflective LED-sensor pair. I don't see how that's novel, but Apple can spend its money any way it likes.

    However, I've heard of two ways to use the concept of "multiple emitters" to make a rangefinder. One is to have two LEDs at essentially the same position, but pointed in slightly different directions. Then any surface that light hits will be illuminated with different intensity from each of the LEDs, based on the fact that light will be most intense on the centerline of the LED but will fall off to the sides. The ratio between the two gives a clue to the angle of the emitting system (noting as The_RB said, that "output will depend on the surface colour and reflectivity and ANGLE relative to the emitter", but the ratio is what's important). A single detector then picks up the light coming from some selected angle, and you can calculate the range based on the length of the baseline between LEDs and detector, and the angles at the end of the baseline. It's trivial to separate the response from the two LEDs--just flash them alternately.

    The other way to do it is to have the LEDs essentially along a single straight line running toward the target. So if one LED is 6 inches behind the other and the target is 12 inches from the front LED, it will be 18 inches from the other. Knowing that an inverse-square law applies to the light intensity at the target, you have a predictable ratio of intensity at the surface versus distance to the emitting device, and as above, you can flash the LEDs to get the two readings. Then just use a single detector to pick up the reflected light.
     
  19. jjw

    Member

    Dec 24, 2013
    173
    31
    Could you use a receiver for a remote controller eg. TSOP38 or similar.
    They are very sensitive, I can turn on a TV-set by pointing the remote controller to walls or ceiling.
    You can also put more current through IR-leds by using narrow pulses.
     
  20. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    The Sharp GP2 sensors use a single emitter pointing directly forward, and a lens with two receivers. Then it's "brain" decodes the distance based on the signal strength difference at the two receivers. They give the same distance reading on white paper as they do on black paper, which is 95% less reflective.
    :)

    [​IMG]

    The smaller size GP2 sensors can be bought for under $10. They give a analogue voltage based on distance, but it is non-linear;

    [​IMG]

    But can be translated to a linear distance by some simple math in the microcontroller (some code on my web page near the bottom);
    http://www.romanblack.com/bitbangserial.htm
     
Loading...