Office Dog Triangulation Keeps Spot Accounted For

[Matt Reed] works at a pet friendly work-space, where his pooch called [Bean] loves to wander around and disappear. She’s not getting in trouble, but nonetheless, [Matt] worries about her. So he took the creepy stalker route and put a beacon on her collar to track her every move.

He’s using a small BLE beacon that will poll a signal every second, sending out a unique ID code and a RSSI value (Received Signal Strength Indicator). Normally beacons are placed in a stationary location to help people navigate — but this time, it’s on a moving dog.

In order to better understand [Bean’s] location in the office, [Matt] set up three Raspberry Pi’s with Bluetooth adapters around the office. Using Noble, Node.js listens for the RSSI values and triangulates [Bean’s] position, much like a cellphone can be located using different ping times from cellular towers.

He’s put this data on an overlay of the office floor pan on an iPad, and now he instantly knows exactly where [Bean] is hiding. At least until one of his coworkers plays a prank on him and removes the beacon.

What else do pets do when they’re not being watched… Ever wonder how much a hamster might use its exercise wheel?

40 thoughts on “Office Dog Triangulation Keeps Spot Accounted For

    1. It has to be trilateration, as there is no way to tell what direction the signal came from, with a standard bluetooth module.
      RSSI gives you an indication of the distance to the transmitter.

    1. Exactly what I was thinking. I worked on distance approximating program a while back with Mindstorms NXT with lejos firmware, it was pretty accurate within a few feet, keeping in mind of course the NXT was released around 2000ad so I would imagine bluetooth signal strength is more accurate.

    2. Accurate enough for things like this (you pretty much just need to know what room the dog is in) but if you wanna do something like cm/inch resolution, Bluetooth prolly doesn’t suffice until you go a few steps further (like map out which walls lower signal strength by how much)

  1. We do beacon stuff at work and triangulation with beacons suuuuuucks. It’s a rough estimate of a rough estimate. For tracking a god I guess it’d be okay though…but we couldn’t get it to do anything useful. Slightly used batteries, people walking around, building structure/materials are all detriments.

        1. This whole thing is ready for kickstarter.

          It wont work very well, but then again that does not matter that much. People desperately want products like this – and they assume that the lack of the product on the market is because engineers have no vision – not that it is difficult bordering on impossible to use RF in this way without a lot of special infrastructure.

          A breathless voice over is all it would take to snag at least 50-100k, but with the right video who knows how much.

          This would be in the mold of ‘iFind’.

          I can just imagine the comments now!

          “The creators said they would show us the tag working after the funding closes! They just need funding to get the wound-coil antenna made. Once they have the wound-coil antenna, the meter accuracy will be fine! INNOVATION TAKES FERVENT BELIEF”

        2. Depending on their beliefs, and also depending on whether it was always on or always off, some people would believe it works, and the rest would declare that it’s broken. And just how would you TEST it?

    1. Yeah, I was wondering about that. There are people who would also maybe try this with RADAR, but that requires pretty fast circuitry to get decent resolution. My choice, were I to try spending a lot of time on a project with very little usefulness, would be a sonic version of something like an aircraft transponder. Each base unit sends a pulse (one unit at a time), and the transponder collar just repeats it back. The base unit then can measure the distance to the collar based on the time delay. I think this could easily get within a couple inches.

      1. Yeah, we’ve also been looking at some of the broad spectrum wireless proximity stuff, uses multiple frequencies over a wide range and some special algorithms to mitigate a lot of the inaccuracy. No client has come to us wanting tracking as precise as that yet, so it’s kind of on the back-burner.

    2. You are absolutely correct on all of those variables. The problem with RSSI values is that they are terribly jumpy. You can however get a pretty accurate value but the tradeoff is time. If you use a simple easing equation the value becomes averaged into a more accurate value the longer the beacon is stationary. With my dog that is constantly digging in trashcans or sleeping in the middle of conference rooms her values average out fairly accurately within 10-20 seconds. If she’s on the move it’s less accurate to an exact point and becomes more of a “she’s around here close”.

      1. Over the last n years, I’ve lost count of the number of people who think that RSSI of a 2.4GHz signal is a good way to triangulate position. Invariably, they’ve all been wrong. 2.4GHz is far too easily absorbed/reflected in a typical human-occupied environment. Also, on top of that, BLE chips tend not to have a flat transmit power across the channels, and the receiver cannot be treated as such either. And you don’t know the channel you’re on, so can’t mitigate that either.

        To the above commenter about it being good enough for “a room or two”, that’s true, but as an even remotely accurate triangulator it’s garbage.

    1. The dog isn’t a robot, where you might need to know precise location to avoid obstacles. Nor is this any other app where such precision is needed. If you want to find the dog, and can narrow the search to a room or two out of a large office building, then it’s useful.

  2. I really wish people would simply publish their code or not publish their article until the code is ready. So many times I find a neat project with the “I’ll publish the code after I clean it up” and 5 years later it’s not up and they don’t answer emails about it.

    Please, just publish your code right away as it is if you intend to share it.

    1. For most, this stuff is leisure time activity. You are asking them to enter a damned if they, damned if they don’t environment. You would damn them for not releasing any code immediately, others will damn them for releasing unpolished code. Sometimes I have to wonder how many far out ideas aren’t put forth because those who have the ideas understand they aren’t able to please anyone all the time, and they decide to they don’t have to put up with that shit, and keep their ideas to themselves. And no I don’t think you are out of line, making a request or suggestion politely, just offering a reason why something may not be happening, other than what are life priorities are always changing.

  3. Set up the same thing over the Thanksgiving weekend. Using an Estimote on the dog collar, three Raspberry Pi’s around the house, careful shielding of the USB Bluetooth adaptors, careful matching of the iBeacon advertisement rate and RSSI averaging gives a pretty useful plot of signal strength.
    I have not yet tackled the trilateration side of things yet, wanted to get the RF side sorted first.
    Regarding the code, there are a few repos that have the necessary Python scripts to pull the UDID and RSSI from iBeacons, I just picked one that was close to what I needed and tweaked it to stream the details via UDP to my home automation controller.
    All in all I found it a pretty interesting project and look forward to finishing it up. Plotting the dogs location in the house so we can fully automate the garage door.

  4. I had a BRAINSTORM while reading through this thread. How about using PowerLine repeaters (PLR)? It’s an interior application in where all physical locations are known. The PLR would just repeat Infrared lamps on the dog’s collar to a single base station when it got close enough to the PLR. The PLR is plugged into a wall outlet and it’s digital ID code is written down with it’s physical location (i.e. 2nd floor coffee room?) to be stored in a database at the base station.

    When the dog is within proximity of a PLR it’s omnidirectional IR light (from the collar) is seen by the photo-diode in the PLR. The PLR immediately transmits in the blind over the power lines it’s ID code (nothing else). It continues to transmit ident as long as the dog loiters near the PLR. The base station decodes the code, compares to the known location database, then displays an interactive map with dog’s location and breadcrumb track as to where it’s been. During setup you insure that base station can see the PLR’s transmission.

    Signal collisions can be avoided spreading out the PLR’s just outside each others photo-diodes. And if only one dog is being tracked then so much the better on collisions.The PLR’s acquire power from wall outlet. Dog’s collar could have a LiPo battery and the lamps flash at a slow rate to save power between recharges. Putting tables and chairs in front of the PLR’s defeat them. Also people walking in front of them only temporarily impacts them. Also the janitor unplugging them for the vacuum cleaner is a problem (secure it to the outlet with a screw). Put up a sign “DO NOT BLOCK THIS DEVICE!”

    I think this is called an “asset tracker”. Also one could use a RF transmitter like APRS instead of power line. For tracking multiple assets some sort of unique digital code would need to be injected into the dog collar lamps. Also some sort of CDMA anti-collision scheme would need to be worked out with the repeaters.


    1. I think you’d need better anti-collision than putting the detectors far enough apart that their coverage doesn’t overlap, because if they don’t overlap anywhere then there will inevitably be large areas not covered at all. Collision tolerance can be built in by having each detector send its code at slightly different repetition rates, or with delays between transmissions that vary randomly. This way if two detectors collide on one rep cycle they won’t on the next. This is how ancient coax-based Ethernet handled it.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.