HACKER Q&A
📣 delbronski

Measuring Distance with Smartphones?


Hi HN. I built a monitoring system that allows users to make observations in the field (mostly forests) using a mobile app, and then upload those observations to a db.

A recent need that has popped up is to know how far a user is from a marker in the field, and alert the user if they have walked too far away from that marker. For example, there could be 10 points of interest a user might want to observe. Those are marked in a map with a radius of 10m each. In each marker radius a user makes 10 observations. Accuracy needs to be at sub meter level.

I’m looking for a way that the smartphone can keep track of its distance from a given marker. We’ve tried GNSS receivers like the Trimble before, but they are either very expensive or not very practical (they disconnect frequently, battery issues, multiple devices to carry in the field, etc). Our users prefer using a simple old rope over these GNSS receivers, and I don’t blame them. I’ve tried a few times and they don’t always work well in the field.

Do any of you have any ideas on how else I could go about this? Any new technology or research that you’ve come across that can help with this?

Thanks in advance!


  👤 hiAndrewQuinn Accepted Answer ✓
Do you always have direct line of sight between the marker and where you're walking? Probably not, given the forest background, but it never hurts to ask. If so you make the problem quite a bit simpler.

👤 solardev
Can you measure a wifi signal between two phones? https://www.makeuseof.com/wifinanscan-measure-distance-phone...

Or if you can limit it to newer iphones, I think their special UWB antenna lets them accurately sense direction and distance to an Airtag. Some newer Androids have this too but the ecosystem is immature compared to Apple's.


👤 quickthrower2
How accurate? I think a Tile (tile.com) and signal strength (maybe it is hackable to get more than a single word that the app says for example “strong”) might give a rough guide. As a bonus you can make the marker ring if you lose it ;-)

👤 defrost
This sounds a lot like biological sampling and it's kind of quite important to make the sample grids (or circles) uniform for apples to apples biodensity observations across geographic locations (or across season times, before | after fires etc).

Away from a city, out in a forest, phones have access to GPS sats and that's about it - no additional location data from nearby "hot spot" routers, etc.

And GPS by itself (with no base station differential o post processing or other tricks) isn't that great down at the couple of metres range.

I myself would be looking more towards a cheap builders laser distance ruler or a piece of string with a loop about a middle stake hammered in the sample circle.

Back when I did this for a bit we were interested in insect and small things counting and used a section cut from a 44 gallon drum .. just drop that down and count everthing inside, then stand up, take X steps forward, drop and repeat.

KISS (Keep It Simple S...) works pretty well.

(As an aside, outside of a forest in a controlled environment there are photgrammetry tricks you can use if you can clamp the camera parameters and mount reference boards so that triangulation can be done from a snapped photo ... but it's over complicating things in a forest I suspect)


👤 v7n
If the users have a way to verify they are in the center of a marker (visual cues?) you might be able to use dead reckoning by utilizing other sensors in the phone: compass, pedometer (step count lib), accelerometer...

👤 mikewarot
At the distances involved, I'd stick with the rope. Involving orbiting atomic clocks entail a number of sources of error[1] that add up to about 15 meters.

It's possible that an electronic based system could be built, but it would require two transceivers that can measure phase differences of nanoseconds between transmitted and received signals. I'm not aware of any cheap off the shelf systems like that.

[1] https://en.wikipedia.org/wiki/Error_analysis_for_the_Global_...


👤 Someone
[delayed]

👤 danielvf
UWB is exactly what you are looking for, and support for it is built into Apple phones. It's designed to measure distance and approximate direction. Range of about 40 meters and an accuracy 10cm. Standard off the shelf chips.

This is the same tech that is in AirTags, but if you made your own beacon, you could have much control over power output.

Apple documentation: https://developer.apple.com/nearby-interaction/

Here's one chip - there are others though: https://www.qorvo.com/products/p/DWM1000

Forum discussion on ranging: https://forum.qorvo.com/t/dwm3000evb-max-range/11906/5


👤 chrisa
https://estimote.com/ has UWB beacons and a mobile SDK which should work - sounds like a perfect use case!