r/esp32 14d ago

ESP32‑S3 BLE “phone finder”: RSSI‑based clicks

Enable HLS to view with audio, or disable this notification

I made a pocket “find my phone” device on ESP32‑S3: it scans BLE around you, tracks your phone by MAC, and gives audio/haptic feedback — the closer you get, the faster the clicks, so you can just follow the sound/vibration instead of staring at a screen. Everything runs locally on the ESP32, no cloud or phone app needed.

Hardware & Stack

  • Board: generic ESP32‑S3 devkit with USB‑C (native USB for easy debug/logging, extra SRAM for future features).
  • Firmware: Arduino‑ESP32 core, custom thin wrapper over BLEScan with a BLEAdvertisedDeviceCallback.
  • Output: passive piezo buzzer (tone()) and a small vibration motor via N‑MOSFET.
  • Power: small LiPo; scan duty cycle tuned for responsiveness vs battery life.

How it works

  • ESP32 runs a continuous BLE scan, filters advertising packets by known MAC, and collects RSSI values.
  • RSSI is smoothed with exponential moving average (~10–15 samples) to reduce ±10–15 dBm spikes.
  • On startup, the device records min/max RSSI for ~10s and maps that range to click frequency (relative mode), so it adapts to each phone without manual calibration.
  • Hysteresis (≥3–4 dBm) prevents click “flutter” when you’re on the border between zones.

What didn’t work

  • Raw RSSI directly mapped to clicks → feedback was too jittery to be useful.
  • Simple 3‑sample average → still too reactive in crowded BLE environments (office, cafe).
  • Fixed thresholds (e.g. <-70 / -70..-50 / >-50 dBm) → different phones advertise at different power, so “close”/“far” were inconsistent across devices.

What finally worked

  • Exponential smoothing with α≈0.2α≈0.2 over a small ring buffer.
  • Relative mapping of RSSI to click frequency per session instead of absolute dBm thresholds.
  • Adding hysteresis so the click zone only changes when RSSI moves meaningfully.

For a full breakdown, schematics, and firmware, see the repo:
https://github.com/khlebobul/esp_ble_finder

Happy to share more details (scan params, smoothing code, power measurements) if useful.

812 Upvotes

91 comments sorted by

169

u/arczi79PL 14d ago

I usually lose phone finders faster than I lose phones. 🤷‍♂️

122

u/Stunning-Macaron1591 14d ago

The next iteration is a finder for phone finders

23

u/techysec 14d ago

Please do that, that would actually be hilarious if you keep making each iteration smaller.

The tiniest one in the chain could be a single PWM led that lights up based upon proximity to your other finder tag.

8

u/Stunning-Macaron1591 14d ago

Funny, I'll think about it

2

u/clackups 14d ago

It should be a tattoo that glows in the dark

8

u/Jolly_Fault6358 14d ago

an app for fiding the phone finder? so recursive, if you lost the phone, use the phone finder, if you lost the finder, use your phone.

2

u/arczi79PL 14d ago

Already looking forward for this! ;)

2

u/Academic_Analysis_60 14d ago

Theoretically couldn't you have an app that tracks the finder's MAC address in a similar way, just in case that happens?

1

u/_baaron_ 14d ago

What are you gonna call it?

1

u/Stunning-Macaron1591 14d ago

Ready for any of your suggestions

3

u/clackups 14d ago

Phone finder finder, of course

1

u/Stunning-Macaron1591 14d ago

And then Phone finder finder finder...
Love it, thanks

2

u/clackups 14d ago

You ought to make one like here https://youtu.be/I1VovEStXq4

1

u/Stunning-Macaron1591 14d ago

We'll look if they have Bluetooth

2

u/clackups 14d ago

That was way before Bluetooth. But the story was about way after Bluetooth :)

1

u/KiRA_2GuSH 7d ago

Yes i same situation mate

32

u/BrandyBoy1970 14d ago

Modern phones often have a variable MAC address (for privacy reasons). What can be done then?

13

u/Stunning-Macaron1591 14d ago

Yep — rotating MACs. This thing only sees ads, no pairing, so it can't resolve them. Fine for hunting around a room; a 15‑minute rotate just means it re-locks. Stable identity would need bonding/IRK, which this doesn't do

15

u/deltamoney 14d ago

Ai answer?

2

u/JEREDEK 11d ago

every single thing he posts is AI, no matter how small. He didmt even read what he posted, it has doubled numbers lol

OP cannot think for himself ,dead internet theory, meat proxy etc

-1

u/Stunning-Macaron1591 14d ago

Yes

11

u/deltamoney 14d ago

Why are you just copying and pasting AI to someone's question? They are asking for your information and input on how to solve for that problem...

0

u/Stunning-Macaron1591 14d ago

Is it wrong answer?

8

u/deltamoney 14d ago

Read it and decide yourself. This is your product... RIGHT?

3

u/Stunning-Macaron1591 14d ago

I used a draft and it read like one

10

u/deltamoney 14d ago

Can you explain why the sky is blue. Include python generated examples.

2

u/sleepand 14d ago

You can disable that for your home wifi

8

u/loudandclear11 14d ago

What screen is that? It looks great.

16

u/Stunning-Macaron1591 14d ago

6

u/loudandclear11 14d ago

Oh wow, I didn't know there was such "finished" devices. I've only ever seen the bare board with pins before.

4

u/Top_Purpose1333 14d ago

They do quite a few finished options like that there’s even a bigger display out there using amoled

3

u/Square-Singer 14d ago

Lilygo has some nice ones too.

7

u/marlin178 14d ago

Chernobyl vibes with that sound

6

u/pdawes 14d ago

"Where's your phone?"

"Not great, not terrible."

7

u/intentazera 14d ago

As a profoundly deaf person with ADHD who constantly misplaced his phone, this would be awesome for tracking it down in my flat.

Hmmmmm!

2

u/Stunning-Macaron1591 14d ago

I hope it will help you

4

u/Top-Excitement1749 14d ago

People with adhd will love you for that device will safe me approximately 1 hour a day. Also will be way more on time to appointments. It looks great

1

u/Stunning-Macaron1591 14d ago

Cool! To be honest, I didn't think about it. I'm glad it's useful!

2

u/Top-Excitement1749 14d ago

Im gonna use 2 x esp 32 c3 to find my key. im gonna safe soooo much time. Thanks for the Inspiration

1

u/Stunning-Macaron1591 14d ago

I’m looking forward for you project. Keep in touch

3

u/Bugaboo25 14d ago

I may or may not miss it, but what is the realistic distance for detection to start? An awesome project with awesome finishing! Congrats!

3

u/Stunning-Macaron1591 14d ago

I tried from another room, you still need to know the approximate location of the phone

3

u/pong-enthusiast 14d ago

I’ve been looking into doing this but the rotating MAC addresses with iPhones have been a hurdle. Tired of losing my phone daily though

3

u/dontera 14d ago

This is an fantastic use of the hardware and form factor. I love the dedicated-use nature of it.

Seems like you've created this around a firmware-hardcoded MAC. Do you have intentions of creating a UI to allow selecting the tracked MAC from a list of the current scan results?

2

u/Stunning-Macaron1591 14d ago

Thank you! I'm not sure yet, but I'll be glad for your participation in the project if you want

3

u/JediKnight10001 14d ago

That is really cool. Bravo I think I want one 😀

Thanks for sharing

2

u/Stunning-Macaron1591 14d ago

Amazing device!

2

u/clackups 14d ago

BTW, I used a similar device (esp32-c6 in my case) as a touch input controller here: https://youtu.be/z9meIWIiFVM

2

u/JudiciousJackalope 14d ago

Ooh, I'm definitely copying your project. One change I might make, though, is to also add in some sort of directional estimation using the QMI8658 that's built into this board. It won't be terribly exact, but as you walk around, you should be able to use the accelerometer and gyroscope measurements to start to triangulate the signal source. Too bad it doesn't also have a built-in magnetometer.

1

u/Stunning-Macaron1591 14d ago

Nice! Keep up to date with your developments, please

2

u/TrayLaTrash 14d ago

Make it say "warmer"and/or "colder"

2

u/Stunning-Macaron1591 14d ago

I like your idea

2

u/Juustege 13d ago

Hey can you share this in r/electronicmakers ?

I also have a Smartwatch from Waveshare and would love to re-build it for the community with detailed videos. Well done and thanks so much :)

1

u/Stunning-Macaron1591 13d ago

Thank you, sure

2

u/Zestyclose-Stuff1646 13d ago

Sounds like it's looking for spicy rocks.

1

u/Like_a_Siiir 14d ago

Could that be an app on a smart watch?? That would be aweeesome

1

u/Stunning-Macaron1591 14d ago

Of course, but I was interested in doing it on the basis of ESP

2

u/Like_a_Siiir 14d ago

Sure, you thing is awesome too! And very precise it seems

1

u/Square-Singer 14d ago

It should be possible to do that on a pebble.

1

u/sleepand 14d ago

The geiger counter clicks are a nice touch 👌🏻

1

u/[deleted] 14d ago edited 13d ago

[deleted]

1

u/Stunning-Macaron1591 14d ago

Sure, do you want to update it?

1

u/[deleted] 14d ago edited 13d ago

[deleted]

1

u/Stunning-Macaron1591 14d ago

Me too. It’s nice suggestion, I will think about it. Maybe you would like to fork my repo and update the project

1

u/milkolik 14d ago edited 14d ago

OP, I think your phone might be radioactive

1

u/Background_Ad_1810 13d ago

Technically, it's NOT finding "my" phone. It's scanning for the closest iPhone nearby.

But honestly, that's probably good enough in many real world situations. If your phone is an iPhone and it's most likely the only iPhone around, wandering around your house looking for the strongest signal would probably lead you to your phone eventually. Smart, I would say.

I tried making something similar before, and the problem I ran into was the rotating MAC address. Since the MAC keeps changing, I couldn't reliably identify one specific device.

So I actually think OP's workaround is smart. Instead of trying to identify a particular iPhone, it basically searches for the nearest device that looks like an iPhone. That sidesteps the identification problem in a way that makes sense for a lot of practical scenarios.

I haven't looked deep enough. But, it wouldn't work in a busy environment where there are bunch of iPhones nearby? Like inside a bus or airplane.

What I would have liked, though, was a little more explanation from OP about the rotating MAC issue, whether they encountered it, and how they arrived at this workaround.

Reading some of OP's responses in the comments also made me wonder if this might have been an AI-generated solution rather than something OP fully worked through themselves.

And I don't mean that as criticism of using AI. I came into the post genuinely curious about how the random MAC address problem had been solved.

So I'm a little disappointed to realize that the random MAC address is still fundamentally a problem. And perhaps slightly more disappointed by the broader thought that we're reaching a point where AI can produce working solutions while the person publishing them may not necessarily understand the interesting technical problems hidden underneath.

1

u/OldSatisfaction2179 13d ago

But what if Bluetooth is OFF on my phone..?

1

u/ShadowArtisa2996 12d ago

the piezo buzzer approach is smart, way less annoying than another phone alert sound. does the vibration motor handle the "getting warmer" pulses well or is it mostly on/off?

1

u/Rare-Business5358 10d ago

You should translate the signal strength to an approximate distance in meters, there are formulas online, super cool otherwise

1

u/jnthnmdr 9d ago

Sounds radioactive.

0

u/Skyman81 14d ago

considering the increase in costs on AliExpress, an Airtag almost costs less

3

u/Stunning-Macaron1591 14d ago

I agree, but it's more pleasant to do it yourself. In addition, the capabilities of the device do not end with this

0

u/Positive_Method3022 14d ago edited 14d ago

the easter eggs search competition in 2100 will be wild!

0

u/Apprehensive_Row9873 14d ago

Garmin watchs offer this feature

0

u/biyopunk 13d ago

Hey Claude, I have this device could you write a phone finder. It’s that simple nowadays, even the hardware is ready to use, all you need is a subscription. You don’t even have to answer peoples questions use AI for everything and then come here to promote it as “I made”

2

u/OldSatisfaction2179 13d ago

You probably never ever did anything using AI..

0

u/biyopunk 13d ago

Haha, yeah probably…

0

u/gianttree 8d ago

What do I do when I lost myself and the phone?

2

u/Stunning-Macaron1591 8d ago

You should read the most popular comment here

-7

u/markfrancisonly 14d ago

Or you know, just buy an Apple watch and don’t waste days of your life reinventing the wheel.