Measuring distance and getting closer

Hello, I am new to arduino and have a project which is also related with distance measurement such that I have to modular robots which eventually merge, by recognizing eachother and so getting closer. As I searched, lots of people use ir led transmitter and emitter to recognize an object (or using ir signal strength to measure the distance) but somehow I couldn't relate it to my project. I would be much appreciated if you suggest something (what to be on how to find a way for my modular robots to recognize them and so moving towards eachother. Long story short here is what I want to ask for help :

First they must be recognize eachother, then they must be getting closer. I want to know what I must use (sensor, emitter, photodiode, ir led etc.)

It must be something like a prototype of mtran-3 to be inspired.I have not a good English so I hope I make myself clear.
Here is the mtran3 (self reconfiguring modular robot)

Thanks.

any help?

That's a really cool video. It looks like those mini robots are using LEDs to communicate.

LEDs are pretty directional. You could put 6 or 8 LEDS and phototransisters in evenly spaced angles all around your robots. Then you could alternate blinking patterns, and detecting patterns in between the blinks. You could slowly turn your bots in a circle until you detected a pattern from another robot. Then you would know in which general direction it was. You could get some two-way communication going, and use varying brightness as you turn to calculate direction and distance from each other.

You might not even need much distance calculation if you know direction. You could just turn toward it and start moving in that direction.

Thank you but I am not sure that I understand you. Could you be more specific in details please with a more like "for dummies" ?

If you want a simpler solution, you might be able to work with magnets and analog hall effect sensors.

what TanHadron means is that you could use LEDs (or LEDs and Phototransistors or LEDs and IR receivers) for setting up a communication link. This is actually pretty cool. This link might be a bit complex, but browsing it should give you a general idea of what you could do with LEDs.

However, from the type of question you are asking, I believe this might be too complex at this point.

Anyway - still. Here is the link: http://www.merl.com/papers/docs/TR2003-35.pdf

My advice is to go with a hall effect sensor.

Thanks for the answer, it can be a quite good option. But I may have simple solution which I want you to criticize. Lets say I have two modular robot which both have a led and a photoresistor on their front face. At first, modules are beginning to spin on itself with opposite directions (one with clockwise and the other one with counter-clock wise) Eventually, leds and also photoresistors of both modules faced eachother ( By the way I am talking about a 30-60 cm distance (12-24 inc.) And so they managed to sense eachother after that they can get closer. Is it possible???

Thanks again.

kka9:
Is it possible???

Nothing obviously impossible, so it might be. It's quite an obscure goal, though, so you might be the first to tackle the problem.

Assuming it was up to you, how would you go about finding out whether it's feasible?

fkeel:
If you want a simpler solution, you might be able to work with magnets and analog hall effect sensors.

what TanHadron means is that you could use LEDs (or LEDs and Phototransistors or LEDs and IR receivers) for setting up a communication link. This is actually pretty cool. This link might be a bit complex, but browsing it should give you a general idea of what you could do with LEDs.

However, from the type of question you are asking, I believe this might be too complex at this point.

Anyway - still. Here is the link: http://www.merl.com/papers/docs/TR2003-35.pdf

My advice is to go with a hall effect sensor.

Hall effect sensor is great. But I must use it to sense for a distance of maximum 30 60 cm (12 24 inc.)

At first, modules are beginning to spin on itself with opposite directions (one with clockwise and the other one with counter-clock wise) Eventually, leds and also photoresistors of both modules faced eachother

Yes. Except it might take a long time before they were both facing each other, depending on spin rates. Once you start getting a signal, you can spin faster or slower, or even reverse the spin until you get the highest signal strength.

So how about if you put two LEDS and photoresistors on each bot--one on the front and one on the back. That way you could get a signal when they were both facing each other, or both facing away from each other, or one facing toward and one facing away. If you sent different signals out each set you would know whether you were facing toward or away.

Or, how about if you added 2 more sets of LEDS and photoresistors on each bot, one facing right and one facing left. It would take less time to get the bots to sync up.

I think it would help to have omni-directional transmitters and directional receivers. That way robot B can see robot A regardless of what direction robot B is pointing (and vice versa). Obviously robot B must be pointing towards robot A for this to work.

It would probably be useful for Robot B to transmit a different signal from that of Robot A so that you don't have to worry about reflections.

It would be more complex but it may be useful to have two receivers on each robot and use the difference between them to locate the other robot more accurately. For example it's easy to tell the wind direction by moving you head until the sound in both ears is the same - a lot more accurate and quick acting than trying to watch a little flag at the top of a sailboat mast.

If your robots need to be aware of distance they might need to use sonar - measure the time for a reflected sound. Or if they are allowed to be co-operative robots then robotA could transmit a distance measuring sound when robot B requests it and the robot B could measure how long it takes. But short distances would require very precise timing.

...R

Sound could be fun. Two bots beeping at each other could determine distance. You could use ultrasound if you didn't want to have to listen to them talk.

If you had two microphones, you might be able to determine direction by the deltas. Accuracy would also depend on how far apart the mikes could be. How big are your bots?

TanHadron:

At first, modules are beginning to spin on itself with opposite directions (one with clockwise and the other one with counter-clock wise) Eventually, leds and also photoresistors of both modules faced eachother

Yes. Except it might take a long time before they were both facing each other, depending on spin rates. Once you start getting a signal, you can spin faster or slower, or even reverse the spin until you get the highest signal strength.

So how about if you put two LEDS and photoresistors on each bot--one on the front and one on the back. That way you could get a signal when they were both facing each other, or both facing away from each other, or one facing toward and one facing away. If you sent different signals out each set you would know whether you were facing toward or away.

Or, how about if you added 2 more sets of LEDS and photoresistors on each bot, one facing right and one facing left. It would take less time to get the bots to sync up.

I think it is brilliant. I will be trying this. Thanks

TanHadron:
Sound could be fun. Two bots beeping at each other could determine distance. You could use ultrasound if you didn't want to have to listen to them talk.

If you had two microphones, you might be able to determine direction by the deltas. Accuracy would also depend on how far apart the mikes could be. How big are your bots?

This would be 101010 cm probably. I thought sound could be useful but I am a bit restricted by the budget.
Thanks anyway.

kka9:

TanHadron:
Sound could be fun. Two bots beeping at each other could determine distance. You could use ultrasound if you didn't want to have to listen to them talk.

If you had two microphones, you might be able to determine direction by the deltas. Accuracy would also depend on how far apart the mikes could be. How big are your bots?

This would be 101010 cm probably. I thought sound could be useful but I am a bit restricted by the budget.
Thanks anyway.

By the way, I want to say that again maximum distance between bots will be 12 to 24 inc. Are the leds and phototransistors capable of working in that area? I know they supposed to be but just want to be sure.

kka9:
Are the leds and phototransistors capable of working in that area? I know they supposed to be but just want to be sure.

To turn the question around, why don't you try them and find out? You're going to have to get your hands dirty at some point, and the hardware you'd need is not expensive compared to the money you're looking at for your robots and Arduinos.

Actually, LEDs can detect light as well as emit light. It could make your bots simpler hardware-wise to use the LEDs as input devices between blinks.

I bought some relatively cheap and bright yellow LEDs (OVLGY0C9B9) rated at 20000 mcd. I was easily able to detect one of them shining at another one from a distance of 12 inches. I had to be pretty accurate aiming it, which might be a good thing for your project. The green and blue ones are even brighter.