Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Measuring Distance with Smartphones?
17 points by delbronski on Sept 22, 2023 | hide | past | favorite | 19 comments
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!



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 of 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


Thanks so much! A few other People have suggested the same. This looks very promising!


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)


Yes, it is biological sampling! We have some biologists and ecologist in the team that took care of the methodology.

And indeed we have taken a simple approach with some string/ropes that works pretty well as you said. But we have a lot of sites in different parts of the world to sample on a yearly basis. I was looking for a way to make this easier for the people in the field.

Thanks for your tips!


https://blog.estimote.com/post/676268055242883072/apple-open... (February 2022):

“another wireless communication technology called ultra-wideband, or UWB — specifically Apple’s UWB solution with the Nearby Interaction framework and Apple U1 chip-enabled devices, including AirTags. UWB provides precise location and distance ranging, much like the older iBeacon technology but more predictably and accurately. In fact, UWB RF ranging can detect distances as close as a few centimeters!”

I don’t know what range it provides, but it apparently can be used for fining your phone, so 10m seems not out of reach.


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.

Edit: I think the pet industry also makes radio frequency pet trackers that don't operate off GPS or cell, just a tracking collar and a handset that tells you range and direction. Maybe they can wear one of those along with your app? It's probably easier / more accurate with the right hardware than trying to shoehorn it into an average phone...


Thanks. I never heard of this. I'll look into it!


I am not a WiFi engineer.

I suspect trees, other vegitation, and terrain changes in the lines of site between radios can effect signal strength.

But I could be wrong.


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_...


Thanks!


With RTK extensions, and depending on exactly how you augment them, GNSS systems can get you to sub-meter levels of accuracy without too much work. But they're expensive. One of the least expensive devices in this space that I know of is the SparkFun RTK Express Kit.

There may be better solutions out there, but you should also make sure that you know what the possibilities are with the old tried-and-true systems. Then you've got a baseline that you can use for comparison, and see how you can better that with other options.


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...


That sounds interesting, I'll look more into it.


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.


Unfortunately no, in most cases we don't have a direct line of sight to the marker


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


Thanks so much! This indeed does look like a good use case!


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 ;-)


It would need to be sub-meter accuracy. I think something like the Tile/Airtag would be like 8 to 10 meter accuracy.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: