GPS speedometer and clock
A bike or car speedometer that needs no wheel sensor: satellites do the measuring.
Shop by category
Shop all componentsA BLE beacon broadcasts a short advert every second or so. An ESP32 scanning nearby can tell when a known beacon is close by its signal strength. Here it switches an LED strip or relay on for five minutes when your beacon arrives.
Anything connected to 230 V mains must be installed by a qualified electrician in a closed, earthed enclosure.
Tick anything you already have and the total updates.
Coin-cell BLE beacon for your keys
Follow the colours: red is power, dark grey is ground, blue is a signal.
ble_presence.inoVerify & upload in Electrolark#include <BLEDevice.h>
#include <BLEScan.h>
const char* BEACON = "aa:bb:cc:dd:ee:ff"; // your beacon's address, lower case
const int NEAR = -75; // RSSI threshold
const int RELAY = 23;
const bool DEBUG = true;
unsigned long onUntil = 0;
BLEScan* scan;
void setup() {
Serial.begin(115200);
pinMode(RELAY, OUTPUT);
BLEDevice::init("");
scan = BLEDevice::getScan();
scan->setActiveScan(false);
}
void loop() {
BLEScanResults* found = scan->start(2, false); // ESP32 core 3.x returns a pointer
for (int i = 0; i < found->getCount(); i++) {
BLEAdvertisedDevice d = found->getDevice(i);
String addr = d.getAddress().toString().c_str();
if (DEBUG) Serial.printf("%s %d\n", addr.c_str(), d.getRSSI());
if (addr == BEACON && d.getRSSI() > NEAR) onUntil = millis() + 300000UL;
}
scan->clearResults();
digitalWrite(RELAY, millis() < onUntil);
}
Check its battery and that it advertises (some sleep until shaken).
On ESP32 core 2.x, start() returns an object: use BLEScanResults found = scan->start(2, false); and found.getCount().
Lower NEAR a little or require two scans in a row.
Phones change their Bluetooth address for privacy, so a dedicated beacon is more reliable.
Months to years, depending on the advert interval.
Only a rough one; walls and bodies change it a lot.
6 parts: ESP32-WROOM-32 38-Pin Development Board, EasyReach Solutions BLEV-Beacon-2.1 Bluetooth 5.0 Low Energy Beacon, 5V Relay Module with Optocoupler, ESP32-C3 SuperMini Expansion Board, Solderless Breadboard and Dupont Jumper Wires (40 pcs). On this page you can tick the parts you already have and add only the rest to your cart.
No. This page has the complete, tested code (ble_presence.ino).
About ₹1,380 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
BLE advertising and MAC addresses; RSSI and why it is only a rough distance; Scanning with the ESP32 BLE library.
Anything connected to 230 V mains must be installed by a qualified electrician in a closed, earthed enclosure.
Ideas that reuse this build: UWB distance meter. They are listed under Take it further on this page.
A bike or car speedometer that needs no wheel sensor: satellites do the measuring.
Records where you went every five seconds, ready to open on a map.
Two boards, two radios: press the button at the gate and it rings indoors.
Check temperature, humidity and pressure from any phone on your Wi-Fi.
Learning project. Check every circuit and the datasheet of each part before you power it up.