Pet Indoor Positioning with Fermion BLE Sensor Pack

BLE Sensor Beacon is a wireless beacon that broadcasts sensor data via Bluetooth, with built-in 11-bit ADC acquisition and I2C write/read functionality. It can be connected to digital or analogue sensors for data acquisition and broadcasting. Sensor data broadcasted by the beacon can be accessed within the beacon's broadcast range using mobile phones, ESP32 and other devices that support BLE reception.


Every beacon can be powered with a CR2032 battery that could last months according to the configuration. 


Besides sensors, you can also use the beacons to report location and this project is exactly that: a prototype to locate your pet inside a big house.


Beacons will be placed through the house. The pet collar will have a Firebeetle 2 with a battery that will calculate the location using BLE RSSI and report the location to a central server that will present a floor plan with pet location.

Get the parts

1 x Firebeetle 2 

3 x BLE beacons 

1 x 3.7 battery

3 x CR2032 batteries

1 x USB 6x1 TTL to program the beacons


First we will setup every beacon. Solder pin headers to the beacons. Then connect 4 jumper cables GND, VCC, IO0, IO1 to USB TOOL: GND, 3v3, TX, RX

You will also need to put the first jumper up and the second jumper down in the USB 6x1



Connect the USB to the computer and run the Config Tool. No installation is required. Just unzip and run NanoBeaconTools/NanoBeaconConfigTool.exe


It could look intimidating but we will only setup the beacon name and get the Mac Address. Click Probe in the upper right, then Connect.



Go to Advertising set 1, Edit, Custom, Settings. Click on Device Name and assign the room name. Then go to Advertising Parameters and assign an address. It could be 00 00 00 00 00 01, then 02, etc


You can test with Run in Ram but it will lose the configuration without the battery. If you are sure you can Click Burn in Ram but that will be permanent, so be careful. 


Consider that MAC will appear backwards. 01 00 00 00 00 00.


Repeat for the other Beacons.


Now open the .ino code with Arduino IDE and enter the Mac address for every location, your WiFi credentials and the URL for the web page that will maintain the floor graphic. 


You can also test RSSI for each room using https://inplay-tech.com/nanobeacon-ble-scanner 

and adjust the threeshold


int myThreshold=-65; // close to 0 is closer


Connect a USBC cable and upload the ino to the Firebeetle. If you get an error due to sketch size, change Partition Scheme to Huge. 

Using the included zip/images/location1.png location2 and location3 floor plans, create your own floor plans with the pet graphic inside each room.


Upload the PHP and INI files to your web server. The ini file permissions should be set to 777, so it can be updated. 


Connect the battery to the Firebeetle and place the Firebeetle in pet collar. 



Everything is setup. Now you only have to open that page anywhere to view where is your pet. 



Where to go from here


This is just a basic example of the use of BLE beacons for indoor location but you can extend the project with Trilateration calculations to determine kind of accurate location, even inside the same room. 


Source code download

To download project source code please go to https://github.com/ronibandini/bleIndoorLocation

All Rights