r/FastLED • u/tome_oz • Feb 12 '25
Discussion Is this possible - Led wearables that change colour/effect based on the physical distance from each other?
I want to build 2 led bracelets with esp32 board as controller. I want that when the 2 bracelets are physically near to each other they change the effect so that they are i.e. in sync when near to the other bracelet. Any ideas how I could do that?
2
Upvotes
3
u/ntgcleaner Feb 12 '25
Check here for how to get wifi RSSI strength (if it doesn't anchor you there, do a page search, it's closer to the bottom)
https://randomnerdtutorials.com/esp32-useful-wi-fi-functions-arduino/#:~:text=Get%20WiFi%20Connection%20Strength&text=Open%20the%20Serial%20Monitor%20and,(received%20signal%20strength%20indicator).
Essentially, you'll make one of them a wifi host, blasting the SSID, the other will then connect to it when it's within range. Then you should be able to read the RSSI and determine what do you want and what colors you want. It's definitely not a 0-100 scale, so you'll have to do a bit of math, trial and error to see what you want most.
Biggest issue imo is the power cost, especially of a device looking for wifi. You might want to make a script that pings once a minute or something instead of full time.
I haven't messed with Bluetooth yet, but I'm assuming it should be kind of the same thing. One has to blast a signal, the other has to look for it.
2
u/Zouden Feb 12 '25
I made something like this using bluetooth on nRF52840. It worked quite well.
1
u/Marmilicious [Marc Miller] Feb 12 '25
You might need to specify how "near", because that could change how it's done.
1
u/ntgcleaner Feb 12 '25
To use wifi, you'd have to have one of them be a host and the other look for the signal, then depending on the db of the connection, change the color of the lights maybe? Hard thing is, it only works with 2 (or one to many) without having to have a tracker and/or host triangulation.
You could possibly use GPS for greater distances (obviously an addon to the esp) and then NFC or RF signals (again, one would have to host).
If you have Bluetooth on them, you may be able to see which Bluetooth devices are close.
1
u/marketlurker Feb 12 '25
I think if they are wearables, I wouldn't use WiFi or Bluetooth (BLE). I would use ESP-NOW and check it's RSSI signal strength. You will be able to get a very long distance.