FlatLock

Asking the lock…
Deska FlatLock: ESP32 s relé a šroubovými svorkami, napájená z USB

When it was unlocked

unlocked locked no record

The chart shows the state reported by the board, not what the server asked for, so locking by the board's own countdown shows up too. Who unlocked is not shown here.

An entrance lock that unlocks itself as you approach home. The phone recognises your arrival by its location (GPS), so the door is unlocked before you reach it. Custom board, firmware and mobile app.

How it works

Unlocks itself as you walk homeThe phone in your pocket watches its location. On the way home it unlocks the door about 40 m before you reach it and the rest of the household gets a notification.
Open it even from workA courier calls from the front door and you are away. One tap in the app and the door is unlocked for five minutes.
A demo of the app, try tapping the lock. It does not open the real door.

The app

One button, a home screen widget and arrival detection that unlocks by itself. Under the button, the truth about the board: lock state, firmware version and signal strength.

Access to a particular door is granted separately; installing the app alone lets nobody in.

Android installs the app outside Google Play, and it keeps itself up to date. iPhone opens the web version, which you add to the home screen via Share → Add to Home Screen. Either way you then enter your e-mail and wait for approval: installing alone does not open the lock.

What it solves

The building's front door unlocks from a phone, with no fob and no key. It sounds like a detail until you are standing outside with your hands full. Then you just push the door open.

  • It unlocks by itself. Using the phone's location, the app notices you are coming home and unlocks the door just before you reach it. The phone stays in your pocket. Once per time you leave, so it does not open every time you walk past.
  • And locks again. If your phone unlocked the door, it locks it once you are home on the Wi-Fi or next to the lock board (Bluetooth). It does not lock if someone else is arriving after you.
  • The household knows who is home. The others get a notification like “Nikolka is home”, only within their own household.
  • The location stays on the phone. It is evaluated only there and coordinates are never sent anywhere; the server only learns that you have arrived.

Technical

ControllerESP32, Wi-Fi, powered over USB
Outputrelay with screw terminals, wired in parallel with the door release button
ControlMQTT for commands (response in tenths of a second), HTTPS as a fallback
Telemetryrelay state, uptime, signal strength – every 5 s
UpdatesOTA over HTTPS, with automatic rollback to the previous version
Location unlockgeofence around the door and two consecutive accurate fixes at the threshold; locking after arrival by home Wi-Fi strength or the board's Bluetooth signal
AppFlutter (Android), home screen widget, background arrival detection, self-updating
BackendPHP on my own VPS, permission records, unlock history
ESP32 ESP-IDF MQTT OTA Flutter GPS Bluetooth PHP Wi-Fi

Want something similar?

From the schematic through the board and firmware all the way to the app and the server.

Write me

davidpetrov@email.cz • or via contact form