From 7ced3600d95d622d0543730aeae90d5ced335f03 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Fri, 24 Apr 2026 15:20:58 +0800 Subject: Minor improvements to RF door lock post. --- _log/fpm-door-lock-rf.md | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/_log/fpm-door-lock-rf.md b/_log/fpm-door-lock-rf.md index e29f733..86ed5d3 100644 --- a/_log/fpm-door-lock-rf.md +++ b/_log/fpm-door-lock-rf.md @@ -1,5 +1,5 @@ --- -title: Fingerprint door lock (RF) +title: Built an RF fingerprint door lock date: 2025-06-05 layout: post project: true @@ -9,21 +9,22 @@ thumbnail: thumb_sm.jpeg Wanted to unlock the door with fingerprint, wirelessly to avoid drilling. 2024-11: Started with basic 433MHz RF modules and two Arduinos. Connected data -lines of the transceivers to UART RXD/TXDs of the MCUs. Unreliable--constant +lines of the transceivers to UART RXD/TXDs of the MCUs. Unreliable—constant packet loss. -2025-01: Switched to RFM69 modules. Complete ball-ache. Followed datasheet to -the letter, audited code many times, cross-checked with RadioHead and RFM69 -drivers. No luck. +2025-01: Switched to RFM69 modules. Complete ball-ache to program. Followed the +datasheet as well as I could, audited the code multiple times, cross-checked +with RadioHead and RFM69 drivers. No luck. -ATmega328P runs at 5V; RFM69 3.3V. Suspect logic-level converter (LLC) issues. -High resistance; Not enough swing. +The ATmega328P runs at 5V and the RFM69 at 3.3V. Suspect logic-level converter +(LLC) issues. Not enough swing? -2025-04: Ditched RFM69s. Switched to NRF24L01+ modules--data pins 5V tolerant, -no LLC required. Spent six weekends writing a clean-room driver. Works like a -charm. +2025-04: Ditched the RFM69s. Switched to NRF24L01+ modules. Data pins 5V +tolerant, no LLC required. Spent six weekends writing a clean-room driver. +Finally some success. -XOR cipher encrypts RF channel. Key cycled to resist replay attacks: +Implemented a simple XOR cipher for the RF channel—good enough for my threat +model. The Key is cycled to resist replay attacks: ``` static inline void keygen(char *buf, uint8_t n) @@ -43,13 +44,13 @@ static inline void keygen(char *buf, uint8_t n) } ``` -Protocol: FPM sends SYN. Servo responds with session key. Both xor-ed with -static key. Session key used thereafter. Command set private--serves to -authenticate endpoints. +Protocol: FPM sends SYN. Servo responds with a session key. Both xor-ed with a +static key. Session key is used thereafter. Command set is kept private—serves +as an authentication layer for the endpoints. -2025-05: Wrote FPM drivers for R503 and FPM10A. UART RX sequence was -tricky--adopted Adafruit C++ implementation to C. R503 has built-in LEDs and -better form factor. Chose it for the lock. +2025-05: Wrote drivers for R503 and FPM10A sensors. UART RX sequence was +tricky—adopted the Adafruit C++ implementation to C. Chose the R503 for the +lock due to its built-in LEDs and better form factor. 2025-06: Two PCBs for FPM (front) and servo (back) controllers. @@ -78,13 +79,14 @@ better form factor. Chose it for the lock. PCB specs: 2-layer, 1oz copper, 0.3mm traces (0.5mm for power). Ground plane. -2025-06: NRF24L01+ stopped working after mounting on PCB. Too close to PWM +2025-06: NRF24L01+ stopped working after mounting on PCB. Too close to the PWM line. Soldering a large 47uF (16V) electrolytic capacitor between VCC and ground fixed it. -Power problems became clear. Linear regulators dissipated too much heat. Sensor -and servo drew 13.8mA and 4.6mA quiescent currents--unacceptable for battery. -Servo inrush current exceeds 1A. 0.3mm tracks cuts it too close. +Power problems became clear. Linear regulators dissipated too much heat. The +sensor and the servo drew 13.8mA and 4.6mA quiescent currents—unacceptable for +a battery-powered device. Servo inrush current exceeds 1A. 0.3mm tracks cuts it +too close. Verdict: Functional but not practical. Battery died in under 24 hours. Led to [redesign](../fpm-door-lock-lp/) with proper power management. -- cgit v1.2.3