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.

distance meters

Status
Not open for further replies.

hjl4

Member
I need help in making a distance meter using light intensity variations.

I searched on the net, and everyone uses a laser.

In this application, I can't. Imagine being in a dark tunnel, and seeing light at the other end, I need to display how far I am from light and display it on a meter, 7 segment LED.
Nothing fancy.
I was thinking of using Pic micro for processing, A/D converter, and photodiode?
Any help will be appreciated.
I'm not asking for a step by step book here, just the right way to do this, how to go about it.
Thanks in advance.
 
Assuming the 'tunnel' is perfectly dark, with no other light source except the target one - which is always the same brightness, and the alignment between them is always exactly the same, you should be able to get a fairly consistant reading based on the brightness of the light from the source. However, I don't know how well this would translate into distance?.

But it's so loaded with restrictions that it seems pointless - you may as well just install a tape measure down the 'tunnel' and read the distance off.
 
Nigel, I would'nt be asking, if it was that simple.
Yes the light source is constant.
Yes it is completely dark with no other light source intefering.
I was thinking photodiode.When bright, it means I'm close to light source.
When light is dimmer, it means I'm further from light source.
The voltage reference of the photodiode would change as I get closer to light source.
What I need is a way for micro to calculate variation in voltage and convert to digital,(much like a digital voltmeter), and then to a display in either feet or mm.

Sorry for not giving more detail.
I hope this clarifies things.
 
Use an opamp to amplify the output from the photodiode, and use the A2D in a PIC to measure the voltage, scale it as you require in the PIC, and display it on an LCD.

The PIC side is all covered in my tutorials, you just need to get the photo-diode amplified with an opamp - you could do that part and feed a multimeter to prove the concept, then do the PIC part later.
 
Thanks Nigel,
Good old op amp, I had totally forgoten about that.
And yes, your tutorial was on my agenda.
They have helped me in so many projects.
Thanks for your quick response.
Good day.
 
Have you considered using sound?

Connect a piezo sounder with a push button switch to a battery and the microphone with a filter tuned to the frequency and amplifier some distance away to an oscillosope. There will be a delay from sounding the buzzer to recieving the tone and you should be able to time this using the scope. Using the speed of sound it's fairly easy to work out the distance.

Once you've experimented a bit it should be fairly easy to build a propper project using a PLL tone detector and a PIC to do the calculations. You might also want to ad a thermistor, pressure transducer and even humidity sensor to compensate for the change in speed of sound. It depends on how accurate you want to be.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top