Trigger event based on location / beacon / geofence

This is a slightly vague question, but I was hoping the community might be able to point me in the right direction.

I’m teaching an IoT class using Argons, and I would like to have a project where students can trigger events when they are physically near the Argon (e.g. unlocking their dorm room door). I am already using Losant so I know they can trigger an event from the web app dashboard, but I’m wondering if there is a way to do it automatically with BT perhaps. I considered NFC, but since the Argon doesn’t read NFC itself, this seems like it wouldn’t work.

Two quick caveats:

  1. I would like this to work on iOS and Android
  2. If BT, I would like the code to either be relatively straightforward, or boilerplate such that it could be given to students for them to modify slightly as needed.

I would really appreciate any thoughts, recommendations, or directions to explore! Thanks!

Have you checked out the BLE example code that changes the color of the LED on the main Gen3 Device when a 2nd Gen3 device gets close to it. The LED shows the programmed color of the Gen3 device that is closest and has the highest signal strength.

So if you wanted to unlock a locker door you could have Gen3 device scanning BLE for a specific Gen3 Device Broadcasting via BLE and when the signal strength of the Broadcasting Gen3 device get’s strong enough that it has to be very close to the locker vs further away where the signal strength would be weaker.

See this BLE example:

https://docs.particle.io/tutorials/device-os/bluetooth-le/#device-nearby

1 Like

Thanks @RWB! That might work–I hadn’t seen that example. I’m not super familiar with BLE so it will take me a little time to figure out the code.

Do you think there is a way to mimic the “nearby beacon” from a phone instead of a Gen3 device, for example using something likenRF Toolbox?

1 Like

You can use the nRF Connect app to “clone” any device and use that in the Advertiser feature.

1 Like

Thanks @ScruffR!

1 Like