DIY BLE Asset Tracker with XIAO ESP32-S3
Build a BLE asset tracking system using the XIAO ESP32-S3 as iBeacon or Eddystone beacons detected by ESPHome base stations. At just 21x17.5mm, the XIAO is small enough to attach to tools, bags, or pets. This guide covers firmware, deployment, and room-level tracking.
What You Need
Step-by-Step Instructions
-
Step 1 Flash BLE Beacon Firmware
The XIAO ESP32-S3 supports both iBeacon (Apple's protocol) and Eddystone (Google's protocol). For Home Assistant integration, iBeacon is the simplest — ESPHome's BLE tracker component natively detects iBeacon UUIDs.
Use Arduino IDE or PlatformIO to flash the beacon firmware. Install the ESP32 board package (version 2.0.14 or later for S3 support) and the NimBLE library, which is lighter and faster than the default BLE stack. The beacon sketch is approximately 30 lines: initialize BLE, set the advertising UUID, major, and minor values, and start broadcasting.
Set the advertising interval to 1000ms for a balance between detectability and battery life. Shorter intervals (100ms) drain the battery faster but improve tracking responsiveness. Longer intervals (5000ms) extend battery life but introduce detection lag.
Tip: Use NimBLE instead of the default Arduino BLE library — it uses 50% less flash and 30% less RAM, leaving more room for your application logic. -
Step 2 Configure UUID and Major/Minor Values
Each iBeacon broadcasts three identifiers: a 128-bit UUID (identifies your tracking system), a 16-bit major value (identifies a group, like a room or category), and a 16-bit minor value (identifies the individual beacon).
Generate a unique UUID for your tracking system using any UUID generator. Keep this UUID constant across all your beacons. Use the major value to group beacons by category — for example, 1 for tools, 2 for pets, 3 for keys. Use the minor value to identify individual items.
The TX power value affects how base stations estimate distance. Set it to the measured RSSI at 1 meter from the beacon. For the XIAO ESP32-S3 with its built-in PCB antenna, this is typically -59 to -65 dBm. Measure this with a BLE scanner app like nRF Connect on your phone.
Tip: Write the major/minor values on a label and attach it to the beacon. When you have 10+ beacons, you will forget which minor value maps to which item. -
Step 3 Test Detection Range
The XIAO ESP32-S3's BLE 5.0 radio provides typical indoor range of 10-15 meters through open air, dropping to 5-8 meters through a single wall. Test your specific environment by walking the beacon away from a base station while monitoring RSSI values.
RSSI values translate roughly to distance: -50 dBm means the beacon is within 1-2 meters, -70 dBm is 5-8 meters, and -85 dBm is at the edge of detection (10-15 meters). These values vary with obstacles, interference, and antenna orientation.
For reliable room-level tracking, you need the beacon to be detectable by at least one base station in each room. Thick walls, metal structures, and 2.4GHz interference from WiFi and microwave ovens all reduce effective range.
Tip: Orienting the XIAO's PCB antenna perpendicular to the base station's antenna improves range by 2-3 meters compared to parallel orientation. -
Step 4 Deploy Multiple Beacons for Room-Level Tracking
For room-level asset tracking, place one ESPHome BLE scanner base station in each room or zone you want to monitor. The base station that receives the strongest RSSI from a beacon is the one closest to it — this is the room the tracked item is in.
Power each beacon with a CR2032 coin cell (220mAh) or a small LiPo battery. At a 1-second advertising interval with the XIAO ESP32-S3, a CR2032 lasts approximately 3-4 months. With a 5-second interval, expect 8-12 months.
Attach beacons to items using 3D-printed cases, adhesive Velcro, or zip ties. For pets, use a waterproof case attached to the collar. The XIAO's tiny 21x17.5mm footprint makes it one of the smallest practical BLE beacons available — comparable in size to a Tile tracker without the subscription fees.
Tip: Deploy beacons in pairs for critical items. If one beacon's battery dies, the other continues tracking. Alternate battery replacement schedules. -
Step 5 Set Up ESPHome BLE Tracker on a Base Station
Dedicate one or more ESP32 boards (any variant with BLE) as base stations running ESPHome with the ble_tracker component. The base station continuously scans for BLE advertisements and reports detected beacons to Home Assistant.
esp32_ble_tracker: scan_parameters: interval: 1100ms window: 1100ms active: false
binary_sensor: - platform: ble_presence ibeacon_uuid: "your-uuid-here" ibeacon_major: 1 ibeacon_minor: 1 name: "Drill in Workshop"
Set the scan window equal to the scan interval for continuous scanning. Use passive mode (active: false) to reduce power consumption on the base station — iBeacons broadcast all necessary data in the advertising packet without needing a connection.
In Home Assistant, create an automation that updates a helper entity with the room name based on which base station reports the strongest signal for each beacon. This gives you a simple asset tracking dashboard showing the last known room for each tagged item.
Tip: Use an ESP32-S3 as the base station for its BLE 5.0 support — it detects beacons at greater range and with more reliable RSSI measurements than BLE 4.2 on the classic ESP32.
Frequently Asked Questions
How does a DIY BLE tracker compare to Tile or AirTag?
DIY BLE beacons cost $7-9 per unit (XIAO ESP32-S3 + coin cell) versus $25-35 for commercial trackers. You get unlimited beacons with no subscription fees. The tradeoff is no crowd-sourced finding network — your tracking works only within range of your own base stations at home.
How long does the battery last on a XIAO ESP32-S3 BLE beacon?
With a CR2032 coin cell (220mAh) at a 1-second advertising interval, expect 3-4 months. At a 5-second interval, expect 8-12 months. A 150mAh LiPo battery lasts roughly the same as a CR2032 but is rechargeable. For longer life, use a 500mAh LiPo for over a year.
What is the BLE detection range indoors?
The XIAO ESP32-S3's BLE 5.0 radio typically reaches 10-15 meters in open indoor spaces and 5-8 meters through a single drywall or wood-stud wall. Concrete, metal, and brick reduce range further. For reliable room-level tracking, place a base station in each room.
Can I track multiple beacons simultaneously?
Yes. A single ESPHome base station can detect dozens of beacons simultaneously. Each beacon uses a unique major/minor combination within your UUID namespace. Home Assistant creates a separate entity for each beacon, so you can track as many items as you have beacons.
Are there privacy concerns with BLE beacons?
BLE beacons broadcast a fixed UUID, which means anyone with a BLE scanner can detect them. For personal asset tracking at home, this is not a concern. Do not use fixed-UUID beacons for tracking people in public spaces. For privacy-sensitive applications, use BLE address rotation, which the XIAO supports.
Can I use the XIAO ESP32-S3 beacon outdoors?
The XIAO ESP32-S3 is not waterproof. For outdoor use, enclose it in a waterproof case (IP65 or better). Outdoor BLE range is typically 20-30 meters line-of-sight without walls. Temperature extremes below -20C or above 60C can damage the battery and reduce range.
What is the difference between iBeacon and Eddystone?
iBeacon (Apple) broadcasts UUID + major + minor values. Eddystone (Google) supports multiple frame types including URLs and telemetry. For ESPHome Home Assistant tracking, iBeacon is simpler and better supported. Eddystone-TLM adds battery voltage reporting, which is useful for monitoring beacon health.