What I want to do it is measure the distance between two points/ devices which are constantly moving apart or together. The value for distance isn't really required I'd just be looking to have an alarm sound when the devices/objects are about 25cm apart and there are no obstructions between them. I did see that it could be possible to use an RFID tag on one of the parts with a reader of some sorts on the other, this would measure the signal strength and when it was so far away an alarm would sound.

Am I on the right track with this? If so, any further reading on detailing this sysyem would be great.


3 Answers 3


Using RF signal strength to estimate a distance such as "about 25cm apart" will not work for a few reasons:

  1. Signal strength will vary between the two devices even when there is apparently unobstructed line of sight between them, due to changes in dielectric constant of the air due to barometric pressure, humidity, suspended particulate matter, and perhaps other factors too. This means there will be variation even across the diurnal cycle. At the small distances in question, this variation will be significant.
  2. Presence of conductive materials (and RF reflecting surfaces) within the vicinity will also cause signal strength variation, just like light intensity of an LED measured by a sensor would vary due to reflected light from surroundings.
  3. The emission signal strength itself is not guaranteed to be constant, nor precisely equal between any two RFID devices. Also, some devices boost signal periodically to improve reading from passive RFID tokens, or to scan for low-signal devices.
  4. When the distances involved are comparable to the wavelength used, other effects such as signal polarization and diffraction also add wildcards to the distance estimation effort. This is especially true of the common 900 MHz RFID band, with wavelengths in the vicinity of 30 centimeters.

Now for some solutions...

For the distances mentioned, ultrasonic distance sensing is commonly used.

If the two objects are at a known orientation to each other, or at least one of them can be oriented towards the other, many of the popular hobbyist ultrasonic TX-RX pairs or sensor modules (such as Parallax Ping)))) can be used.

If orientation is not fixed, then an omnidirectional ultrasonic emission is used rather than the common directional TX units, and multiple RX units arranged to cover a circle, provide return pulse sensing for distance computation.

Alternatively, if precision of distance is not so crucial, and if the albedo (reflection coefficient) of the sensed object is essentially fixed, then an alternative is to use an infrared proximity sensing module, such as the Vishay TSSP4Pxx series. This answer has further insight into this approach.


Depending on how generous you are willing to be on the word "about" you can use bluetooth for this.

Lockitron uses bluetooth to determine when your bluetooth enabled cell phone is within a few feet of your Lockitron front door lock (which has bluetooth). The idea is that bluetooth can be put into an automatic pairing mode and most modules have the ability to change the transceivers power so once your cell phone a bluetooth door lock are paired, the lock knows your phone must be within X feet of the device.

Some of the issues Anindo mentions in his answer are mitigated by using the bluetooth protocol but on the whole his concerns are still 110% valid. You will not get very accurate results using this method. Expect maybe 6-12 inches of variance unless you know something I don't and implement it more intelligently. Also, one last thought, the pairing process takes a few ms so there's latency on the protocol side of things.

If you think this is an OK approach I suggest you look around at various bluetooth topics (particularly look at bluetooth 4.0 which has the advantages of lower power and lower latency) and then comeback with new specific questions about your implementation attempts.


What you don't go into in your question is orientation. A simple vertical antenna for instance will generate a uniform field that (apart from obstructions and reflections from nearby objects) spreads itself 360 degrees around the antenna. But if you go vertically too high or too low the field pattern has dramatically changed.

I'm not saying use RF, rather I'm trying to use the example of a radio antenna to demonstrate that you need to define the two moving objects better. If they are free to move with respect to each other totally then it's unlikely an electromagnetic antenna is going to work consistently.

However, you may have better luck with magnetic fields - the loop antennas can be "stacked" so that you get more "even" coverage and they are less effected by the normal things that affect radiowaves.

If you have power at both ends it makes things much easier. If you haven't then you might just about get enough power in the "powerless" unit from the field generated by the "powered" unit. I've got a system that couple power (2W) to a remote circuit and I can get 5cm out of it. You'll need nothing like 2W - probably less than 20mW. I think Mr. Tesla might have something to say about this if he were alive.

If there is power at both ends then both can measure their distance from each other.

Assuming it's like a transponder system i.e. power at one end then you'll need to design a loop antenna that is highly tuned/resonant. It doesn't need to work at VHF - a few hundred kHz or a few MHz will do. The "remote" device coming into the field will pick-up the magnetic field and, using a highly resonant coil/capacitor start to charge power into a bigger capacitor that can power a small "respond" circuit for a few milliseconds. The respond circuit could send a response possibly by retuning the power coil and this could be picked up by the powered unit. You could even "kick" an RF transmitter to send something and this could be picked up.

This solution does need engineering for it to work but gut-feeling tells me it should.


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