Cat Tracking Using Bluetooth Indoor Positioning




This Instructable teaches you how to build a system to track indoor positioning of cats. The purpose of this project is to get insight into pet positioning and see their interactions.

The system incorporates RSSI (Received Signal Strength Indicator) to estimate cat position. A bluetooth device is put on the cat, and other bluetooth devices are used as device scanners ("beacons"). These beacons scan the area for the Bluetooth device attached on the cat. The scanning process results in a RSSI for the discovered device. The stronger the RSSI, the closer the cat is to the beacon. In order for the localization to work, we collected "fingerprints" of the RSSIs to multiple beacons to be used as training data for a classifier to predict the location of the cat. After collecting fingerprint data, we ran the live system with the cats to collect test data. We used Machine Learning on the actual test data to predict the location of the cats using the fingerprint data.

The system is based on

List of Materials

  • One or more cat to track.
  • An apartment or space for cats (preferably a natural environment the cats are comfortable in)
  • At least three Bluetooth-enabled devices to use as beacons. We used Android phones with an RSSI reporting app (explained in steps 3-5)
  • Any Bluetooth-enabled device to attach to the cat. We used Samsung Galaxy Gear.
  • Tape
  • A web server with a database (explained in step 1)
  • A visualization for the data (explained in step 9)


This instructable was made as part of the CS graduate course "Tangible Interactive Computing" at the University of Maryland, College Park taught by Professor Jon Froehlich. Please see for more details. This project was done by Hitesh Maidasani and Sana Malik.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Set Up a Web Server to Collect Data

The server should be able to accept and store data in a database. The code for the server is available at

The server receives and stores training fingerprint data. The process for collecting the fingerprint data is explained in Steps 3-4.

The server also receives and stores the actual testing data once the whole system is live. This process is explained in Steps 5-7.

The server can be hosted on a local machine or on any cloud service such as Heroku. We used a node.js server hosted on Heroku in order to avoid running a local server for the entire experiment which was run for over 36 hours.

The database and tables should be setup. Attached is a dump of the PostgreSQL database with sample data (b012.dump). The dump also consists of the schemas of the tables.

Step 2: Attach the Three Beacons to Different Parts of the Space

Tape the three Android phones to different parts of the space.

We taped one phone under a living room coffee table, the second to the table in the dining room, and the third to the dresser in the bedroom.

Ensure that the phones are connected to a stable power supply and that the phone sleep settings are turned off.

Step 3: Install Data Training App on Each Phone

The Android app for collecting training data is located here:

The app has a text box for the ID for each test point location. When "Scan Devices" is pressed, the app scans the area for the two Galaxy Gears. Once they are found, the app sends the RSSI values for each Gear to the web server along with the location entered in the text box and the current phone's MAC address which is used to identify each phone. If the Gear is not found, the app reports a zero value.

Note: Do not pair the Gear with the phone. The app simply scans the area for all Bluetooth-enabled devices.

Step 4: Collect Fingerprinting or Training Data

This step is the most time consuming step.

We chose 15 spots in the apartment to track: table, litter, scratch post, hallway, dresser, couch, counter, desk, lvngrm corner, kitchen window, balcony, door, bed, bed window, food.

We placed both Gears at each location and ran the fingerprinting app on each of the three phones with the appropriate label from the above list. The app scanned for both Gears and reported the RSSI of both Gears (labeled with a gear id) to the server with the location. We ran the app 7 times at each location for reliability.


Place the two Gears at the desk. Now run the app on the first phone with the label "desk" seven times. Next run the app on the second and third phone with the same label 7 times each.

Now, the database table for the fingerprinting data should have 21 rows with location "desk. Of these 21 rows, 7 are for one MAC address, 7 for a second MAC address, and another 7 for the third MAC address. There should be some post-processing done to join these 3 sets of 7 rows to just one set that has the three RSSI from the three devices on one row.

After doing this for all 15 locations, the table should have 315 rows. After doing the post-processing and joining, the table should have 105 rows.

Step 5: Install the Data Logging or Testing App on the Android Phones

Once the fingerprinting data has been collected, the actual test data can be collected to observe the behavior of the cats. Now install the data logging app on the phones. Our app can be found here:

The app scans for the Gears. The Gears can be at any location within the area. Once the app has discovered the Gears, it reports the RSSI from of both Gears (with a gear id) and the phone MAC address. This app scans every 12-15 seconds and reports the RSSI's to the server. So, there are 3 of these apps running simultaneously and reporting to the server.

We do some post processing again on this data to join the three RSSI reading of the same gear and average the readings over a minute time frame.

Step 6: Attach the Galaxy Gears on the Cats

Attach each Galaxy Gear on each cat. This may need some modification to the strap of the watch since each cat's neck has a different size. We used string to elongate the size of the strap. Ensure that the watch is not making the cat uncomfortable since this is an experiment and the device should not modify the cat's usual behavior. Also, ensure that the Gear should not be easily removed by the cat.

Note: These cats were not harmed or distressed by wearing this collar.

Step 7: Let the System Run for Several Hours

We ran the system for about 44 hours.

While doing this, it is a good idea to keep track of some sort of manual log for some location points that the cats are at. This can help test the accuracy of the location classifier used in the next step.

Step 8: Run Location Classifier

We used a K-Nearest Neighbors classifier to predict the locations of each test point. A test point consists of 3 RSSI readings from each phone for a particular Galaxy Gear. Using this test point and the training fingerprinting data, we run the KNN classifier with N=3 to obtain the predicted location.

The classification code is located at

Step 9: Visualize Data

Using the predicted locations during the 44 hour period, we visualize the data using a heat map and a time flow location map.

The visualization code is available at



    • Indoor Lighting Contest

      Indoor Lighting Contest
    • Make It Fly Challenge

      Make It Fly Challenge
    • Growing Beyond Earth Maker Contest

      Growing Beyond Earth Maker Contest

    28 Discussions


    19 days ago

    Point of safety-- anything around a cat's neck absolutely /does/ need to
    be able to be removed by the animal. A breakaway of some kind is
    essential to keep it safe from getting stuck or caught in a way that
    might strangle it or injure the neck.


    1 year ago

    so .... what did we learn from the tracking data ?
    that they are pretty mammalian in their habits spending their time:

    10% eating
    25% explorative
    35% socially interacting
    28% sleeping

    ...... and 2% watching humans leave for "work"? at 9:15am


    1 year ago

    sorry for this stupid question of mine but im hoping someone will answer this...can i use ble (BLUETOOTH LOW ENERGY) as beacons and track android phones instead?? thanks in advance for the one who will answer this


    3 years ago


    Navi NathaneCroshan_gop

    Reply 3 years ago


    (Protip: demanding quick answers is one of the main reasons why questions dont get answered.)


    4 years ago on Introduction

    Hey cool project.

    I'm wondering what's the accuracy you are getting?

    Check out this arduino shield called pozyx for indoor positioning with an accuracy of 10cm. You can use it for tracking, or in your case, you can use it to quickly build a RSSI database without manually having to measure all the points. By just walking around and measuring the RSSI with a BLE shield and the position with the pozyx shield you have a database in no time! Check it out:


    4 years ago on Introduction

    can you use anything that transmits Bluetooth to stand in for the watch? Does this work for multiple floors?


    4 years ago on Introduction

    Is there a pre-compiled apk for the rssi reporter?


    4 years ago on Introduction

    Can i have the procedure and method to teach me how to make it? i need it for my fyp. need it asap!thx so much


    4 years ago on Introduction

    Hi, I do really appreciate it if you can explain the fingerprint process, and also how can be connecting to database


    5 years ago

    There are 11 'apps' at the website...
    not sure which one.


    5 years ago on Introduction

    Awesome project. Will build it as soon as I can convince my girlfriend to have a cat :)

    3 replies

    Reply 5 years ago on Introduction

    The phones we used could scan devices that were 10-15 feet away. I assume it does vary from device to device.


    Reply 5 years ago on Introduction

    thanx. I ask cause i have 2 cats and they hidding in my house which is quite big.....and sometimes (hardly if they are hungry) i seek all house places and its annoing.