I'm looking for a way to make a swarm of sensors know their position using low cost, low power system (ie ESP32.)


  • low cost per device
  • low power use on devices
  • 1m accuracy is enough
  • 2D only
  • 1 position every 5 sec is enough
  • 500x500m area
  • only the device has to know its position
  • there is a permanent one way data broadcast connection to the devices that we can use (no ways for the device to communicate with the server)
  • the setup on the field like installing beacons and control system could be expensive (only the devices must be cheap and low power)

Time of flight on devices seems too power hungry and expensive to me. Computing offset like GPS does also.

I thought about a solution: - Using three beacons on the corners. - The server send a message saying "next time you get a positioning signal it means you're on row 1". - It wait a bit to be sure all devices get the information. - Then ask the controler to send a message from a pair of beacons with just the right time offset so their signals meet on row 1. - All devices that are on row 1 get signal from both beacons at the same time. - They now know they are on row 1. - The process is repeated for each row. - Then for each column using another pair of beacons.

This approach does not require time of flight chip nor guessing the offset on the device side. Just detecting a match between two pulses. It's quite easy to make a AND logic door (a transistor) between two antennas for two different frequencies.

I'm not sure the signal will meet along straight lines, more like hyperbolic curves, some math will convert to x and y. We can sync the beacons with one master antenna. There could also be master antennas on each rows and columns. So there's no need to mesure time offset.

Do you think this is a good approach? If you have some links that would help me. I'm wondering how to precisely control the offset between emitted signals.

Edit : I changed explanation to make it more clear as comment requested.

  • \$\begingroup\$ These kinds of things are fundamentally challenging with few compromise-free solutions. What you are seeking is within the capability of differential GPS or a comparable (if challenging to build) custom system. \$\endgroup\$ May 18, 2020 at 17:52
  • 1
    \$\begingroup\$ This approach sounds more plausible than the usual attempts. How did your last attempt work out? \$\endgroup\$
    – user16324
    May 18, 2020 at 17:53
  • \$\begingroup\$ If you can tell whether two pulses are synced, you can probably extract the time difference between two pulses. Sounds conceptually similar to Loran-C \$\endgroup\$
    – Neil_UK
    May 18, 2020 at 18:01
  • \$\begingroup\$ @BrianDrummond I have not done any prototype yet, I'm a software developer, I know nothing about radio frequencies, I learnt yesterday how antennas work :) \$\endgroup\$
    – bokan
    May 18, 2020 at 18:24
  • \$\begingroup\$ So you want to shift the individual transmission times of each beacon so the waves arrive simultaneously on particular areas of the field? How did you plan on synchronizing the time reference for said beacons? That seems like one of the more difficult problems to me. \$\endgroup\$
    – DKNguyen
    May 18, 2020 at 18:28

1 Answer 1


It's an interesting idea. You mention an esp32, and it being a widely used wifi networked device works in your favor.

I think you have a couple of challenges in the project. First is that all devices in the swarm have to be operating in a precisely synchronized manner. I've come across White Rabbit project that make use of a very precise clock synchronization protocol across multiple devices on a network. Using this type of protocol would allow the swarm devices to operate in the same time frame. With some equipment you can easily cover the area specified with a single wifi network all swarm devices have to be connected to. I haven't looked at implementing the protocol on a microcontroller, but it should work in principle.

Second challenge is generating an event, or series of events, detectable by all swarm devices in the specified area, and applying triangulation principles based on the time difference measured by each device in the swarm from the moment of event triggering. 500x500 meter distance isn't too large for an audible frequency sound to travel (single-tone whistles can be detected from kilometers away). Having a small microphone listening to the specific tone triggering an interrupt to time stamp an event is all that would need to be done. The base station setup would perform self-calibration from the triggered events to account for the effect on sound speed by temperature and pressure. To get 1m accuracy you would need to be able to detect an event with a precision of under 3 ms, which is achievable on the esp32.

  • \$\begingroup\$ Funny you said I have an interesting idea then describe the exact opposite of what I meant! The solution I suggest does not require syncing the swarm nor time of flight detection. Each device just detect when it gets two signal at the same time and the data channel tells it that it is a this position. \$\endgroup\$
    – bokan
    May 18, 2020 at 20:01
  • \$\begingroup\$ @bokan And how do you plan to transmit both signals at the same time? You are overlooking the synching required by your transmitters. Your swarm might not need to be synced, but your beacons do. It's probably just as much trouble either way. \$\endgroup\$
    – DKNguyen
    May 18, 2020 at 21:55
  • \$\begingroup\$ @DKNguyen maybe we can sync the two beacons by triggering them with a third one being between the them. Using another frequency. \$\endgroup\$
    – bokan
    May 18, 2020 at 22:44
  • \$\begingroup\$ @Bokan The "master" beacon would need to be precisely equidistant from all the other beacons that actually transmit the pulse to the swarm which is probably easier to do than trying to make some other time reference. I don't think it would be reliable for the master to also communicate with the swarm because it would need to know the distance to the slave beacons so it knows how long to wait after sending the synch signal before sending a signal to the swarm. You can try it, but it would basically required a clock fast enough and accurate enough for time-of-flight. \$\endgroup\$
    – DKNguyen
    May 19, 2020 at 0:22
  • 1
    \$\begingroup\$ In addition, circuitry to detect two RF pulses with enough precision to know within 1 meter error when they arrived relative to each other is more complex than you think, even if all you want to know is if they are "close enough" and not the exact time between arrival \$\endgroup\$
    – DSI
    May 19, 2020 at 1:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.