Hey, I'm trying to build a device that uses an Arduino Uno board to measure the distance to a bluetooth beacon. My idea was to use a HC-05 module as the master and a bluetooth beacon as the slave. What I want to do is simply measure the distance from the module to the beacon.
The Beacon I want to use is this one.
The first question would be if this is even possible with the hardware I have as I'm a bit confused if I maybe need another module like the HM-10 that supports BLE/Bluetooth 4.0?
If it is possible with the HC-05 then how can I get the distance?
What I already tried was setting up the HC-05 module as a master and tried to scan for devices. It seemed to work as it found some bluetooth headphones but the beacon was not detected.
I hope you can help me or point me in the right direction for a different technology that can solve this problem easier if that exists.
That looks like a BLE device so a HC05 won't be able to communicate with it.
In any case the question of using Bluetooth to measure distance using signal strength has been considered on the Forum many times. It simply does not work. There is too much variation in signal strength.
Railroader:
What gives You the idea that a HC05 can be used to measure distance? It's a communication device.
Goggle "Arduino + distance measure".
We're trying to use the RSSI to measure the distance based on the signal strength.
What we need for our project is a small (beacon) device on a keychain or the sorts and based on it's distance to the Arduino we want to trigger different events.
Robin2:
That looks like a BLE device so a HC05 won't be able to communicate with it.
In any case the question of using Bluetooth to measure distance using signal strength has been considered on the Forum many times. It simply does not work. There is too much variation in signal strength.
...R
Yeah I pretty much guessed so. So the HM10 would probably work for this use case?
I know Bluetooth distance measuring is not very exact. But we didn't really find any better technologies that fit our use case of detecting the distance to a very small device. It doesn't need to be very exact as long as it kinda works.
grymare:
I know Bluetooth distance measuring is not very exact. But we didn't really find any better technologies that fit our use case of detecting the distance to a very small device. It doesn't need to be very exact as long as it kinda works.
Two peopale are holding 2.4Ghz transmitters, in a holding a mobile phone type situation and they are facing each other 2m apart.
One person turns around 180degrees and signal strength measurments now suggest they are 10m apart, even though they are still 2m apart.
That is the result of a practical experiment I carried out. The so called 'distance' measured could be out by a factor of 5. Adverse orientation of the sending and receiving antennas could easily increase the margin of error to a factor of 10 or more.
It doesn't have to be super accurate. For now I think it would be enough to just differentiate between "it's in the same room (2-3 metres)" and "it's in another room (5+ metres)".
Anything more detailed than that would be great but I could work with that.
You mentioned 'keychain or the sorts' which suggests people are involved so there are all sorts of variations in bodies blocking the view of the beacon, orientations of antennas etc.
Given that you want to differentiate between 3m and 5m, how does that fit in with the real world practical example I mentioned in post #4 ?
grymare:
So the HM10 would probably work for this use case?
There is nothing probable about it at all, however, the AT commands are there. I believe it works by adjusting the power over four levels and testing the connection, a sort of suck it 'n' see method. There is some information on how you can waste your time in this arena on the Martyn Currey website.
grymare:
would be enough to just differentiate between "it's in the same room (2-3 metres)" and "it's in another room (5+ metres)".
The performance of an HM-10 is much the same as an HC-05 and indeed such that your criteria just might be re-written as "in range" (same room) "out of range" ( another room). So, if that is good enough for you, you might get a result. If you want anything better, you will need to waste more money as well.
We want to use it at home with the Arduino mounted near the entrance. The idea was to simply check if the keychain is in about 2-3 metres radius to the Arduino device and then trigger A. If it is still detected but further away (for example in another room) we will trigger B.
We thought Bluetooth would be good enough to check for this since it doesn't have to be too exact but it seems like it's more complicated than we initially expected.
If there are other technologies that could solve this way easier I'm open to try them.
Bluetooth is not very good with walls so with a little luck you can tell "in room at the entrance" vs. "not in room at the entrance". Add a receiver in the second room to tell "in the second room" vs. "not in the second room".