Location of a robot to a precision of small distances (i.e. <.1 inches) is valuable for navigation of small robots. The goal of this project was to create an affordable "GPS" system that could locate a robot within .1 inches and be easy to construct from off the shelf parts and easy to setup in the field.
I cannot take credit for this idea but it is beautifully simple. Use a radio transmitter/receiver pair on two different Arduinos. One to transmit the request for a "ping" from a beacon, the other a beacon to receive the request and then "ping". When the beacon gets the request for a ping over radio it "pings" by oscillating an acoustic transducer for a short period of time. The requesting Arduino simply measures the amount of time between the request and the ping. This is very highly correlated with the distance between the requesting Arduino and the beacon Arduino. To multiplex this if the request is for a particular Beacon to ping then the distance to N Beacons can be measured by one requesting Arduino. I will refer to the requesting Arduino as the GPS unit because it becomes an analogy for a "real" GPS unit after this point.
For each Beacon you need
For the requesting Arduino (GPS Unit)
The block diagram is basically to get a feel for the two devices.
In the Beacon the Transducer is connected across two digital lines, so a 10 -> 01 pattern on those lines causes a 2 X 5V movement of the transducer. Where if a single line was used only a 5V deflection would occur. The current limited on the Arduino is relied upon so the transducer is directly connected across the two lines. The LED is used to debug/diagnose problems. In general it flashes when a ping request for it is received. The output of the receiver is tied to the hardware serial input line. Not shown are three (or more) pins used to set the "address" of the beacon. If these pins are labeled X, Y, and Z then no short is Address 0. A short between X and Y is Address 1 and a short between Y and Z is Address 2. The LED is nice when three beacons are used because you can see the requests cycling through the beacons. It is kinda fun to see as well.
The GPS uses the same transducer but it is connected through a LM324 Operation Amplifier Circuit that essentially is tuned to the frequency of the transducer and creates levels that are Digital Level (0-5V) with distances of many feet away. The circuit is very much like the first two stages of EFYMag February 2006 Ultrasonic Proximity Detector or Maxim App-notes on Proximity Detector. The detector part d1 to the rest of the left is not needed that is done with software. Any ultrasonic range finder amplifier will do. I used one that only needed capacitors and resistors and used a single ended power supply for the Op Amp (the LM324 my favorite Op Amp). The transmitter is tied to pins that are a software serial port. This leaves the hardware serial port for communication with another device. The LED blinks when a "ping" from at least one Beacon is heard through the amplifier.
This code was written with certain choices for connecting the LED, Jumper for setting Address, and Transducer. The Beacon software is
The GPS Software is
I have a version of the GPS receiver that performs the Trilateralization that takes the three distances and converts to an X and Y in a plane.
We have reproduced another set of this GPS system and experimented with cheaper radios. The cheaper radios required and extra byte be transmitted to give the radio receivers a more data before actual data is transmitted.
The different Arduino had some time synchronization issues. Most importantly is that you "tune" the delay in lines 42 and 45 of the beacon to get the most signal from the transducer on the receiver. We did this by connecting a spare transducer to an oscilloscope and changing the loop function to just repeatedly call PulseTransducer. We then changed the time delay to get the maximum peak on the oscilloscope.