Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

IR Distance Sensor

Status
Not open for further replies.

ma_ge38

New Member
Hi, currently I am planning to build a IR distance sensor using normal IR emitter and receiver. However, the the range for normal sensor is too short which is below 5cm. Is there any method to increase the range of it?And is there any method to increase the reliability of these sensor as I don't wish to go for those expensive distance sensor. :)
 
How are you going to measure distance with IR?
1) The reflection is weak, so it must be far away, or it doesn't reflect very well, or it reflects at the wrong angle.
2) It doesn't work in sunlight or if there is any other bright light.
3) The delay caused by distance is too short (the speed of light is very fast) to be measured with electronics.

The distance sensors I have seen use ultra-sonic transducers (higher than audio frequencies). The circuit accurately measures the time delay caused by the distance since the speed of sound is fairly slow.
 
I think a delay caused by the speed of light cannot be measured with an electronic circuit unless the distance is very far:
 

Attachments

  • speed of light.PNG
    speed of light.PNG
    2.8 KB · Views: 588
hello,

first, to reach long ranges, you need to PWM the sensder led, so that you increase the instatenous current flowing in the emitter led, you can go up to 1 A, if the led is on for only 1/100 of the time.

then, to measure the range, you need to do something like successive aproximations, where you start by sending a weak IR signal, and increase progressively this signal, until you reach a point where the signal is powerful enough to be detected by the sensor. you can figure out by this method the range of the obtacle... this is one of the easiest way to do it with IR.. but still, it wont be precise .. because the range will be different depending on the surface..

good luck
 
Hi, thanks for the reply in advance... My initial idea for this project is determine the distance by using the ratio of distance vs voltage across the receiver part of the sensor. As the intensity of the IR received changed, the voltage across the receiver part changed too... please correct me if there is any mistake.
 
ma_ge38 said:
Hi, thanks for the reply in advance... My initial idea for this project is determine the distance by using the ratio of distance vs voltage across the receiver part of the sensor. As the intensity of the IR received changed, the voltage across the receiver part changed too... please correct me if there is any mistake.

as a theory.. it's not totally wrong.. but also depends on the kind of receiver you use.. some receivers are locked at some frequencies and will only give 5 or 0 volts..

but the technique i told you about is not that far from your idea, and i did use in a projects before.

my advice.. don't try to do that the way you said!
 
Last edited:
As you have discovered, the received signal diminishes rapidly with distance. It is non-linear, so calibration will be a problem and the signal will be in the noise level unless you use a powerful transmitter. A focused beam can improve the range.
 
The intensity of the received signal also depends on how well the distant object reflects. How can you calibrate it?
 
Actually I am using this IR distance sensor as the sensing mechanism of my micromouse. But those available distance sensor is quite bulky and expensive. Any suggestion for this? I had seen people build a distance sensor using the TSL261 and OPE5594 before... so does that mean we can never have a distance sensor by using normal IR emitter and receiver pair?
 
ma_ge38 said:
Actually I am using this IR distance sensor as the sensing mechanism of my micromouse. But those available distance sensor is quite bulky and expensive. Any suggestion for this? I had seen people build a distance sensor using the TSL261 and OPE5594 before... so does that mean we can never have a distance sensor by using normal IR emitter and receiver pair?

IT can be done,
i did this before, with normal IR sender and receiver. how? read my previous post.
 
Originally Posted by ikalogic
IT can be done,
i did this before, with normal IR sender and receiver. how? read my previous post.
So you mean that I need to increase the current flow through the IR emitter and modulate it, so that it operate in at least 100Hz (1/100 of the time?). Sorry... nobby here... how about the receiver part? Do I need to have some filter circuit for it?
 
ma_ge38 said:
So you mean that I need to increase the current flow through the IR emitter and modulate it, so that it operate in at least 100Hz (1/100 of the time?). Sorry... nobby here... how about the receiver part? Do I need to have some filter circuit for it?


ok, i'll explain it.

You need to be able to control the flow of current into the led, because the intensity of emitted light, is proportional to the current. so, to control the range, we need to control the current.

Next step: how to control current?
answer: PWM, or Pulse width modulation, where you send pulses to the LED, of FIXED FREQUENCY and fixed duty cycle (duty cycle is the ON time w.r.t the OFF time of each pulse) if the ON time is 1 ms and the off time is 10 ms, then the duty cycle is 10%.

Now, inject the maximum current in the led, which is equal to the maximum forward current of the LED divided by the duty cycle of the PWM. (if you'r clever with math and waves, you will notice that we are playing around with with the average current through the led). after you've figured out the max current (which can go as high as 2 A... as long as the average current does not exceed the maximum DC current specified in the datasheet) you then need to chose a switable resistor value for this current.

then to play with the range, you'll have to change the voltage that you send to the emitter block (LED + in series resistor). you can easily do that with an r/2r ladder network and an op-amp..



I know this might seem complicated, but that's as simple as it can get to acheive a project like yours.
 
Hi,
The method I use in my laser range finder, is to stretch time.

At the instant the laser is pulsed a logic gate switches a long tailed transistor pair.
The long tailed pair constant current charge a poly capacitor in a negative direction, to a
voltage of -5v at a maximum range of 5000 mtrs. As the reflected laser pulse is amplified and detected
the long tail pair is toggled and the poly cap is discharged via a constant current circuit giving
a linear discharge ramp. A high impedance amp senses the poly cap voltage and its output is fed
into zero crossing detector.

A 15 MHz xtal counter is gated from the time the echo is received until the up ramp
crosses zero, at zero crossing the counter has a count directly proportional to the range in
metres [ rem: double path length ], as the nominal speed of light is 300,000,000 m/sec.
The charge and discharge constant currents are a ratio of 100:1 , so that path transit
time has been stretched by a factor of 100.

As a result of the fall off in reflected signal strength as the range increases, the
switching times are slower, therefore, the range appears longer. To overcome this, the peak
strength of the echo is amplified/rectified and input to a fast 8 bit adc. During calibration
of the laser a 256 bit lookup table is created. The 8bit signal level is used as an address
to the table and it subtracts it from the apparent range.

I appreciate that this is an over kill for the original enquiry, but the same linear
ramping principles can be applied to IR emitter/receivers.

Let me have your views.
Regards

EricG
 
He has a micro-mouse. A tiny robot? He needs to sense an obstacle that is maybe only 15cm away. The delay of the light beam due to 30cm round trip is only 1ns. How are you going to time only 1ns?

If the IR receiver picks up a reflection then the micro-mouse should turn to avoid hitting the obstacle. It doesn't need to know how far away is the obstacle.
 
You can take advantage of the frequency response curves of the ir detector to create distance Zones. For example: the ir detector may be more sensitive at 37.5Khz than 36.5Khz ,35.5,34.5,33.5...and so on. For a full write up check out pg. 269 of the pdf located here.
FreqResponse.GIF

zones.GIF
 
ikalogic said:
ok, i'll explain it.

You need to be able to control the flow of current into the led, because the intensity of emitted light, is proportional to the current. so, to control the range, we need to control the current.

Next step: how to control current?
answer: PWM, or Pulse width modulation, where you send pulses to the LED, of FIXED FREQUENCY and fixed duty cycle (duty cycle is the ON time w.r.t the OFF time of each pulse) if the ON time is 1 ms and the off time is 10 ms, then the duty cycle is 10%.

Now, inject the maximum current in the led, which is equal to the maximum forward current of the LED divided by the duty cycle of the PWM. (if you'r clever with math and waves, you will notice that we are playing around with with the average current through the led). after you've figured out the max current (which can go as high as 2 A... as long as the average current does not exceed the maximum DC current specified in the datasheet) you then need to chose a switable resistor value for this current.

then to play with the range, you'll have to change the voltage that you send to the emitter block (LED + in series resistor). you can easily do that with an r/2r ladder network and an op-amp..



I know this might seem complicated, but that's as simple as it can get to acheive a project like yours.


wow...that's detailed explanation...thanks. But do I need to include some filter in the receiver circuit as the transmitter is being modulated??


Sig239 said:
You can take advantage of the frequency response curves of the ir detector to create distance Zones. For example: the ir detector may be more sensitive at 37.5Khz than 36.5Khz ,35.5,34.5,33.5...and so on. For a full write up check out pg. 269 of the pdf located here.
View attachment 10854

View attachment 10855

Sig239: How about this? Do I need to filter the receiver part?
 
You forgot to say which IR receiver IC you are using so we don't know how good is its built-in bandpass filter. Most are pretty good. The IR receiver is the inexpensive but very sensitive ones used for IR remote control of TVs and DVD players.
 
audioguru said:
He has a micro-mouse. A tiny robot? He needs to sense an obstacle that is maybe only 15cm away. The delay of the light beam due to 30cm round trip is only 1ns. How are you going to time only 1ns?

If the IR receiver picks up a reflection then the micro-mouse should turn to avoid hitting the obstacle. It doesn't need to know how far away is the obstacle.

Actually I need to know the approx. distance from the wall as I need it to make the mouse move in the center of the path...

audioguru said:
You forgot to say which IR receiver IC you are using so we don't know how good is its built-in bandpass filter. Most are pretty good. The IR receiver is the inexpensive but very sensitive ones used for IR remote control of TVs and DVD players.

But I thought those TV remote control receiver will provide us with digital output? (sorry, newbies in building circuit :) ).I need some analog reading to be able to calibrate my robot to make it move in the center way....
 
ma_ge38 said:
But I thought those TV remote control receiver will provide us with digital output? (sorry, newbies in building circuit :) ).I need some analog reading to be able to calibrate my robot to make it move in the center way....
You are correct, a TV remote receiver won't detect the strength of the reflection from a white or shiny wall nor the weak one from a black or dull wall. If both side walls are the same then maybe your mini-robot will steer between them.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top