Let's Make Robots!

New ways of seeing things..

Hi all, I am so excited about this. It may not be much to anybody else, but to me it is!

You all know how we only have the IR's or the Ultra sound to work with when we want to check distance? Yeah, if we have millions we can also get a camera or two, and laser range finders..

However, I wanted something cooler.

This is not that, I am sorry.

However, I am working on something cooler (I hope, but it may be far fetched), and when doing so, as a spin off I made this. 

And it is pretty wicked, I think.

The setup is simple, as simple as you can see it on the video; An LDR (Light Dependent Resistor) is hooked up with a 330 Ohm (or something) resistor, to the analogue input of a standard Picaxe 28 board with no extra modifications.

Also a speaker and a "white" (pale blue they are) LED are hooked up to the standard outputs, batteries, and that is it.

At first you may think that I have done nothing special.. LDR detecting light, or maby just pulsating light.. but then why don't you try to replicate it? I am going to be very surprised (and my day spoiled) if you can make something that works like this! ;)

I have made an LDR measure distance!

There you go, for less than half price of a Sharp IR range finder, and twice as fun, as you can actually see where the robot is focusing!

I am so excited to hear what you all think of this, and to hear if anyone can figure out how I did it, so I am not going to tell yet, but I will make a walkthrough, and am planning to make a robot (Start here-kind of project) that will not drive over the table's edge, and will navigate just by this.

..And while I am at it, I think I may have a look at giving that robot the ability to sense colors as well, so it can find say a red object amongst green on a black surface.. and then it can play ball :)

Because color detecting is also a spin off by this method! (Not on the setup on the video, and I have not tried it in real life yet, but I am pretty sure, and am going to prove it soon :)

And if not for color sensing, then for coolnes: Yes, the LED can be red as well (or any other color, possibly even IR, though I have not tried it yet) In fact it was red when I made the original test, but I swapped it to a "white" so you should not think it was the difference in color that did it. The flash light on the video has 3 LED's of same type & color..

How did I do this? Make me happy, throw me a theory, or try to duplicate :)

Thanks (I will tell later, but here is a chance to take me down first ;) Did I mention it is working in sunlight?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
I'm assuming it is pulsing out light and detecting how long it takes until the light is reflected back (or how strong it is) and then figures out an approx distance?

How can anyone make Picaxe fast enough to detect the speed of light??

If we had that kind of speed in the procoessors it would be great. But as it is now, I think the ray of light would have to travel something across europe for the picaxe to have time to measure anything!

Thanks for guessing, wrong, please come again :)

The speed of light isn't the issue. If you do the maths you'll find that light only travels a few tens of metres in the time that it would take a fast eight bit microcontroller to react, never mind one that operates in the hundreds of megahertz or gigahertz range. The limiting factor is actually the response time of the light dependent resistor which takes milliseconds to react to changes in light levels. However phototransistors and photodiodes don't have that problem so you can use them instead.


I thought "strength of reflected light" too but that can't be it if it works in sunlight as well as the dark.

I doubt it's measuring the length of time to reflect the light: With the speed of light being about 300 million metres per second, and the CPU (presumably a PIC) working at 20MHz, the smallest distance it could measure would be 60 metres (and that would also be its resolution: 60 metre steps). 


Here's a theory...

No. That was before I saw the video. That's not how it's done. It's definitely some really neat-o outside-the-box thinking, though.

I'm guessing once the LDR detects light, you start a timer, then switch the light off until the LDR no longer detects light, then figure out how long the light persisted. The longer it persists, the closer the reflective surface. If you used alternative samples as baselines for the subsequent ones, this would work in variant ambient brightnesses where the ambient light is weaker than the LED focal point.

How am I doing so far? 

I dont know what you are opn about, and please stick to the subject, thanks!

Barnes Wallance invented the "bouncing bomb" which was dropped from a known height. The height was established by focussing two lights on a point on a lake and the aircraft was at a known height when teh light reflected back was strongest. Obviously this would only work for one given distance, though and you appear to have achieved a distance measuring thingy.

Both relevant and humorous, I thought.

Well it is not it under all circumstances :) No better guess?

Are you switching the LED off when the LDR detects light?

When the reflective surface is not perpendicular to the light, does your sensor "think" it's further away?

It's not a geodimeter. The PIC wouldn't be fast enough to measure the wavelength.

No lenses. No phase shift measurements. No interference patters.

I'm stuck. 


A: That would be answred best by "yes and no" :)

B:That would be answered best by "No but yes"

Sorry, it really is the best answers I can give.