Is it possible to calculate the distance between an arduino bluetooth shield (BLE Shield 2.1) and cell phone? More specifically, when the cell phone is within <5 feet of the shield, I want it to perform an action. I know BLE Beacon technology is able to do this in a general sense (immediate, near, far) so I'm wondering if it is possible?
Looking through stack overflow, I've found the following answers but they are all dated:
<a href="https://stackoverflow.com/questions/11846506/calculate-distance-between-bluetooth-device-in-android" rel="nofollow">Answer 1</a> <a href="https://stackoverflow.com/questions/29859666/distance-between-bluetooth-module-and-an-android-device" rel="nofollow">Answer 2</a>
I know that ultrasonic frequency and laser sight are both options but I am trying to keep costs low so I would prefer a way in which the distance is calculated without the use of an additional tool.Answer1:
Yes you can use it for distance calculation based on RSSI (received signal strength). You should implement iBeacon on Arduino side as stated in Eirik M answer. The most important thing in my opinion is that you have to be aware of BLE/iBeacon precision.
Please read carefully the following articles to determine if iBeacon technology fits to your needs. If so, implementation should be straight forward.
<a href="https://community.estimote.com/hc/en-us/articles/201636913-What-are-Broadcasting-Power-RSSI-and-other-characteristics-of-beacon-s-signal-" rel="nofollow">Broadcasting power and RSSI</a>
<a href="https://blog.shinetech.com/2014/02/17/the-beacon-experiments-low-energy-bluetooth-devices-in-action/" rel="nofollow">The Beacon Experiments: Low-Energy Bluetooth Devices in Action</a>Answer2:
If BLE beacons are good enough for you, it should be fairly easy to implement a beacon for the Arduino shield. There are a few things you need to be aware of, such as output power and antenna characteristics. I recommend to read up on beacon technology to understand how it works.