October 11, 2013

Measuring distance between user and the door



We have no way of measuring distance directly between the user (the phone) and the door. However, we can safely approximate the distance by querying the "strength" of the received signal of the Bluetooth communication. The term is called Bluetooth Received Signal Strength Indication (RSSI). RSSI is the relative received signal strength in arbitrary units.

In short, the closer the distance, the bigger the strength of the received signal, the bigger the RSSI numbers.

In our case, we have two ways to implement this:
  1. The Rpi does the query for signal strength and responses (to command the microcontroller to unlock the door) only when the signal strength is within the safe operating range.
  2. The App (instead of the Rpi), which initiates the connection, sends the signal ("within range" or "not within range") along with key based on the received signal strength (Android is able to provide this automatically on each Bluetooth connection or we can use one of the public methods to query manually) of the Rpi.
However, both methods relies heavily on the actual Bluetooth devices that we are using. We need to do some test on our own to approximate better (sadly we only have one Bluetooth dongle that works with Rpi at this moment).

This is one example I've got from the net which should give us some approximations:

          RSSI              Position
          38                   Phone touching Bluetooth dongle
          25                   Phone an inch away
          10                   Phone about 6 inch away
          0                     From 2 feet to opposite side of room
          -3                    In next room (with a wall between)
          -10                  2 walls away

source:
Link1
Link2
Link3





No comments:

Post a Comment

Write a reply