![]() ![]() ![]() (paste this into a new sketch and it will be ready to run!) The Arduino Code: 0bin - encrypted pastebin Note: Until someone properly calibrates the Distance algorythm, I advise you to use the RSSI values as the trigger for any proximty application you may want to create, trust me on this one.īefore using the code, make sure to install all the Required Arduino Dependencies: The Kalman Filter works pretty good as it is right now, it really smoothens the RSSI and it makes it a bit more stable but it could be calibrated even further if you need to It means that if you are 1 meter away from the device it will indeed show that you're that far away, but the problem is that it ain't yet calibrated to add enough distance when you move away and the signal strength drops. Some variables of the distance meassuring algorythm (this is the most uncalibrated one) There are a few things that are currently functional but not properly calibrated: Yes, maybe it can't tell exacly at what distance you are standing from the Esp32, but it can sure tell if you're far or close, if you come close or go further away and the big signal fluctuations are pretty rare, at least in my case.Ī Serial Plot Monitor Screenshot with the code in action: I've heard alot of people saying that you can't really use the Bluetooth for Distance meassuring but I can tell you one thing about this, from my tests: It can trigger a certain PIN on your Esp32 devices (or more) at whatever signal strength or distance range you want to The code comes already equiped with an applied Kalman noise filter, which can be calibrated even further I tested the algorythm indoors (through walls) and in open air and it's pretty stable (meaning the signal will not tend to drop or increase too much when stationary or walking towards or away from the Esp32) when you move at arpoximative 15-25 meters away. *The RSSI meassurement is incredibily decent, with high values that stop at 0 when you're near the Esp32 and low values that go down to -50 aprox. It allows anyone with an Esp32 at their disposal to develop aplications that can trigger events based on the distance between the Esp32 module and the other device it is connected to *(in my case I used an Android Smartphone (Nexus 5x)). The reason I went with using Bluetooth Classic over Bluetooth Low Energy is that of range, BT Classic having a much bigger range at which it can operate at, unlike BLE (at least that's what I've read).īoth Bluetooth Modes have their ups and downs so it's up to you what's the best option, depending on your project terms, the range of operability and the battery consumption aspects, etc. With all of that being said I am sharing here the progress I've made to try and make this task a bit more easy on those who wanted to use this technology and to improve it and play with it. There are, however, some tutorials and there is some documentation for Bluetooth Low Energy (BLE) which you may find by doing a simple Google Search using the apropriate keywords. When I started working at this Application (about 1 month ago) there was not too much documentation if any at all, in regards to meassuring distance via Bluetooth Classic (BT) for the Esp32. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |