User avatar
DaedalusOS
Posts: 13
Joined: Mon Aug 26, 2019 8:08 pm

Re: Wireless Distance Sensing?

Mon Nov 11, 2019 3:41 pm

deepo wrote:
Mon Nov 11, 2019 9:40 am
PiGraham wrote:
Mon Nov 11, 2019 8:08 am
deepo wrote:
Sun Nov 10, 2019 9:27 pm

Searching for "long range uhf rfid reader raspberry pi" gives a few results worth checking out.
Nothing specific that might suit this application?

There are things like this:
https://www.amazon.co.uk/reader-vehicle ... B018EFLJJI
which claim 3 to 5 metres reading range but would that give useful proximity range info under 3m?
It large for handheld use (20cm) and it's £150.

Then there is this one:
https://www.amazon.co.uk/dp/B075WY8DSR/ ... NrPXRydWU=
Similar price, range 10 to 150 cm which may be more appropriate 120 x 85 x 23 mm
.
The latter RFID reader is handy, and acts as a USB HID keyboard device, so it should be easy to interface with it, as the ID of the RFID tag read is being sent as keyboard key presses.
But using RS232 as the first device does is not that hard to do either.

But for scavenger hunt a smart phone with a Bluetooth LE app, and either BLE tags or RPi Zero W's acting as BLE tags can get the OP most of what he needs, except for the feedback part. And it's cheap.

/Mogens
When you say BLE Tag, what exactly are you referring to? Could you link me to an example of what you are looking at? I would really appreciate it, as I'm still fairly new to all of this!

Thanks!

deepo
Posts: 611
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: Wireless Distance Sensing?

Mon Nov 11, 2019 4:16 pm

DaedalusOS wrote:
Mon Nov 11, 2019 3:41 pm
deepo wrote:
Mon Nov 11, 2019 9:40 am
PiGraham wrote:
Mon Nov 11, 2019 8:08 am


Nothing specific that might suit this application?

There are things like this:
https://www.amazon.co.uk/reader-vehicle ... B018EFLJJI
which claim 3 to 5 metres reading range but would that give useful proximity range info under 3m?
It large for handheld use (20cm) and it's £150.

Then there is this one:
https://www.amazon.co.uk/dp/B075WY8DSR/ ... NrPXRydWU=
Similar price, range 10 to 150 cm which may be more appropriate 120 x 85 x 23 mm
.
The latter RFID reader is handy, and acts as a USB HID keyboard device, so it should be easy to interface with it, as the ID of the RFID tag read is being sent as keyboard key presses.
But using RS232 as the first device does is not that hard to do either.

But for scavenger hunt a smart phone with a Bluetooth LE app, and either BLE tags or RPi Zero W's acting as BLE tags can get the OP most of what he needs, except for the feedback part. And it's cheap.

/Mogens
When you say BLE Tag, what exactly are you referring to? Could you link me to an example of what you are looking at? I would really appreciate it, as I'm still fairly new to all of this!

Thanks!
BLE tags that are iBeacons or Eddystone beacons are easy to implement in a RPi Zero W, as I have posted links above.
(Almost) cheaper than buying them, but one like this:
https://www.banggood.com/Waterproof-BBe ... rehouse=CN

Or this one:
https://www.banggood.com/Estimote-Beaco ... rehouse=CN

/Mogens

PiGraham
Posts: 4179
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Wireless Distance Sensing?

Mon Nov 11, 2019 4:37 pm

The big advantage of buying the beacon tags is that they integrate a battery into a neat case and last for a long time.
Battery life is over 3 year on default setting.
battery CR3032 battery
https://www.banggood.com/Waterproof-BBe ... rehouse=CN
RPi Zero, wonderful as it is, could not run a day from a coin cell.

A benefit of BLE over RFID is the range as standard with cheap kit is roughly what you want. Zero to 10 metres.
And you get that for free on every smartphone, table and PiZeroW!

That just leave you to work out if you can use BLE beacons to locate things in a treasure hunt. You can try that out on your phone for free. You may have better luck than I did.

deepo
Posts: 611
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: Wireless Distance Sensing?

Mon Nov 11, 2019 7:14 pm

PiGraham wrote:
Mon Nov 11, 2019 4:37 pm
The big advantage of buying the beacon tags is that they integrate a battery into a neat case and last for a long time.
Battery life is over 3 year on default setting.
battery CR3032 battery
https://www.banggood.com/Waterproof-BBe ... rehouse=CN
RPi Zero, wonderful as it is, could not run a day from a coin cell.

A benefit of BLE over RFID is the range as standard with cheap kit is roughly what you want. Zero to 10 metres.
And you get that for free on every smartphone, table and PiZeroW!

That just leave you to work out if you can use BLE beacons to locate things in a treasure hunt. You can try that out on your phone for free. You may have better luck than I did.
I can't argue with that. I'd just suggest the RPi Zero W as beacon, because then you have some RPi Zero's to play with afterwards :)

But the RPi Zero W can of course be a beacon receiver using Python and then something to indicate to the user how close (how high/low the RSSI is) you are to the beacon.

/Mogens

PiGraham
Posts: 4179
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Wireless Distance Sensing?

Tue Nov 12, 2019 9:48 am

deepo wrote:
Mon Nov 11, 2019 7:14 pm
something to indicate to the user how close (how high/low the RSSI is) you are to the beacon.

/Mogens
Does that really work? As I mentioned the two Bluetooth finder apps I tried seemed all but useless for locating Bluetooth devices.

Maybe it would work better if there were some fixed beacons in known positions and the reading used the ratio of RSSI to target and static beacons and triangulated.

User avatar
Gavinmc42
Posts: 4824
Joined: Wed Aug 28, 2013 3:31 am

Re: Wireless Distance Sensing?

Tue Nov 12, 2019 10:13 am

Found a RFID post
https://www.raspberrypi.org/forums/view ... 3&t=196341

RFID transceiver, you can make the coil directional, do RFD with loop antennas.
https://www.melexis.com/en/product/MLX9 ... ransceiver

Even more directional if you use a ferrite rod, like the old AM radios.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

deepo
Posts: 611
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: Wireless Distance Sensing?

Tue Nov 12, 2019 10:57 am

PiGraham wrote:
Tue Nov 12, 2019 9:48 am
deepo wrote:
Mon Nov 11, 2019 7:14 pm
something to indicate to the user how close (how high/low the RSSI is) you are to the beacon.

/Mogens
Does that really work? As I mentioned the two Bluetooth finder apps I tried seemed all but useless for locating Bluetooth devices.

Maybe it would work better if there were some fixed beacons in known positions and the reading used the ratio of RSSI to target and static beacons and triangulated.
You are in effect asking for indoor GPS, which is not a trivial task at all. It's quite difficult.
A simpler solution, but more error prone is just looking at RSSI - with all the faults that may have.
When I tested it at home with my RPi Zero W and an app for iOS, I did get different RSSI values depending on the distance.
But if you turn your back to the beacon I get a different value.
That's just what it is.

/Mogens

PiGraham
Posts: 4179
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Wireless Distance Sensing?

Tue Nov 12, 2019 12:31 pm

deepo wrote:
Tue Nov 12, 2019 10:57 am
You are in effect asking for indoor GPS, which is not a trivial task at all. It's quite difficult.
I'm not asking for anything. The OP asks for a hide-and-seek detector system.
From a cursory test of BT using RSSI and noting numerous comments on the ineffectiveness of such apps I'm sceptical whether BT is a viable option.

My advice is not to go too far down the path using BT. Try it out using what is readily available. Maybe it works in some cases.

Gavinmc42's suggestion of directional antennas seems promising. Maybe that can be tried with Bluetooth,
Maybe a Pi0W in a can. See Cantenna.

Put a Pi0W in place of the USB WiFi dongle
https://www.youtube.com/watch?v=sxmeWecCUE4

User avatar
DaedalusOS
Posts: 13
Joined: Mon Aug 26, 2019 8:08 pm

Re: Wireless Distance Sensing?

Tue Nov 12, 2019 3:18 pm

Everyone,

Just as an update to this, I'm expecting to receive a BLE iBeacon in the mail from Amazon today and I'm going to toy around with that and see if I have any luck with it. If I see that it does actually become viable, then I'll update you guys here with everything and I'll make sure to update with my progress along the way.

Thanks everyone for your input, I really appreciate it!

User avatar
DaedalusOS
Posts: 13
Joined: Mon Aug 26, 2019 8:08 pm

Re: Wireless Distance Sensing?

Tue Nov 12, 2019 9:43 pm

Everyone,

Alright, just as an update for this:

This beacon just showed up in the mail a little bit ago: https://www.amazon.com/gp/product/B07FC ... UTF8&psc=1

I've gone ahead and installed bluepy onto the Pi and have the following code running:

Code: Select all

from bluepy.btle import Scanner

while 1 == 1:
	scanner = Scanner()
	devices = scanner.scan(.5)

	for device in devices:
		if device.addr.upper() == "80:6F:B0:6C:88:8C":
			print(device.rssi)
Its definitely not perfect right now, however this is a pretty decent proof of concept. As I move it farther away, the RSSI does seem to get bigger the farther I move it away. Again, I really don't care about the accurate distance, just that the user is getting closer.

I'll have to do some more testing but so far this does seem promising.

User avatar
DaedalusOS
Posts: 13
Joined: Mon Aug 26, 2019 8:08 pm

Re: Wireless Distance Sensing?

Wed Nov 13, 2019 9:12 pm

All,

As an update on this, I'm still in the proof of concept stage and it looks somewhat promising, however I'm running into some roadblocks...

The RSSI is proving to be a bit of a challenge to work with, for a big reason: Inconsistency. The RSSI is constantly changing, even if I set the Pi and the Beacon at a set distance and then not move at all or do anything, and the RSSI will change, and sometimes spike. That, and the way that I have it setup to scan, it scans every 1 second, and it doesn't pick up the Beacon every single time, which can cause delay and confusion in attempting to find it.

That's where I'm at right, I'm still trying to figure this out...

deepo
Posts: 611
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: Wireless Distance Sensing?

Wed Nov 13, 2019 9:18 pm

DaedalusOS wrote:
Wed Nov 13, 2019 9:12 pm
All,

As an update on this, I'm still in the proof of concept stage and it looks somewhat promising, however I'm running into some roadblocks...

The RSSI is proving to be a bit of a challenge to work with, for a big reason: Inconsistency. The RSSI is constantly changing, even if I set the Pi and the Beacon at a set distance and then not move at all or do anything, and the RSSI will change, and sometimes spike. That, and the way that I have it setup to scan, it scans every 1 second, and it doesn't pick up the Beacon every single time, which can cause delay and confusion in attempting to find it.

That's where I'm at right, I'm still trying to figure this out...
I'm afraid it's not going to be much better than that.
All you can do is smooth the RSSI a little with a exponentially weighted moving average function.
And RSSI from RFID is not going to be any better.

/Mogens

User avatar
Gavinmc42
Posts: 4824
Joined: Wed Aug 28, 2013 3:31 am

Re: Wireless Distance Sensing?

Thu Nov 14, 2019 3:19 am

Use a BT dongle and a parabolic reflector to make it directional?
That has been done for WiFi by hacker, but you only need it as a BT RSSI receiver.

I suppose it could be done with a Zero, antenna at the focal point.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

jayben
Posts: 104
Joined: Mon Aug 19, 2019 9:56 pm

Re: Wireless Distance Sensing?

Mon Nov 25, 2019 5:16 pm

Take a look at Decawave Ultra-Wideband ranging, it uses remarkably precise time-of-flight measurement to get around 10 cm (4 inch) accuracy. I've written a detailed description of a test system that uses Raspberry PI and Python, see
https://iosoft.blog/real-time-location-ultra-wideband/
..but you can also get self-contained battery-powered tags with the necessary firmware.

Return to “Other projects”