Detect direction and distance between 2 arduinos

Basically, I have 2 Arduino boards A and B and I want to know which sensors would allow me to make the board A (which controls a small car) find where board B is (direction and distance to it) so I can make board A turn the little car towards board B and drive forward until it is about 1m away from board B.

Conditions: both are in the same room (indoors) with no obstacles

Note: I don't know if board B actually needs to be it's own Arduino (maybe a simple 'signal emitter' would suffice) but any suggestions on how to solve this problem would be very much appreciated.

The first step will be for you to find a way for board A to select a base line from which to relate any other direction to. If you can't do that, then you can't do the thing you ask about.

Find a sensor measuring distance, if You can. It's not easy if at all possible for Your budget.

If this was my project, depending the factors not yet presented, I’d be looking at an IR beacon, and the car ‘seeks out’ that IR transmitter.

Think Roomba homing base.

1 Like

One can have the MCU's running a ML algorithm such as Simple machine learning with Arduino KNN | Arduino Blog and a camera to take an image and process the image 'looking' for the other device. Once the device is found one device moves towards the other one. A NanoBLE or an ESP32 could do the trick.

1 Like

The Pololu IR beacon tells you the direction to travel to reach another beacon, but not the distance.

It is much more expensive to measure distance, but possible with UWB ranging modules.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.