Geofencing with Amazon Location Service and AWS IoT
Publication date: December 21, 2020 (Diagram history)
With this architecture, you can track high-value equipment leaving or entering premises and generate alert notifications. The solution integrates Amazon Location Service with AWS IoT Core to send asset coordinates to Location Service Trackers. The trackers generate and act on geofence enter and exit events through Amazon EventBridge.
This scenario uses Bluetooth Low Energy (BLE) tagged asset locations in a warehouse with an arbitrary x, y coordinate system. You can also use GPS coordinates outdoors.
Geofencing with Amazon Location Service diagram
The following steps describe the architecture:
-
Create a Geofence Collection resource in Amazon Location Service and add one or more geofences. Create a Location Tracker resource and associate it with the geofence collection. This configures the service to send geofence events to EventBridge.
-
Publish asset position to AWS IoT Core directly or through AWS IoT Greengrass. With AWS IoT Core in the path, you can manage asset metadata through IoT Thing models.
-
Configure an IoT rule in AWS IoT Core to invoke a AWS Lambda function.
-
Write a Lambda function to send the location (DeviceID, x, y) to the Location Tracker.
-
The Location Tracker maintains device position history, and the associated geofence collection publishes enter and exit events to the default event bus in EventBridge.
-
Configure EventBridge to invoke a Lambda function for the event received from the service.
-
(Optional) Configure an EventBridge rule to invoke a Lambda function for further processing of raw geofence events.
-
(Optional) Add a Lambda function to forward events to AWS IoT Events for complex event detection. Store event history as a time series in Amazon Timestream.
-
Publish the event to an Amazon Simple Notification Service topic directly from EventBridge to notify the end user.
-
Publish complex events detected by AWS IoT Events to an Amazon SNS topic to notify the end user.
Further reading
For additional information, see the following resources: