Fall-Larm

Fall-Larm is an end-to-end IoT system that detects falls in elderly people living at home, using an accelerometer on an ESP32-C6. Alarm data is encrypted on-device with XChaCha20-Poly1305 (libsodium) and sent via MQTT/TLS to a local Raspberry Pi Zero 2W (fog node), which stores the data in an SQLCipher-encrypted database — without any sensitive health data ever leaving the home network.
Tools & tech
My role
The assignment
The challenge
Challenge
Solution
Key features
Results
- End-to-end encryption verified: 145 B plaintext → 185 B ciphertext, negative test with the wrong key confirmed
- NVS buffer handles up to 16 offline alarms — automatically flushed on reconnection
- SQLCipher AES-256 enabled with GDPR-compliant retention and 30-day backups
- mTLS with per-device certificates signed by an internal CA — every device authenticated individually
- fail2ban blocks an IP after 5 failed connection attempts within 120 seconds
Screens





Design process
System Topology

- •Shows the full system: ESP32 (edge) → MQTT/TLS → Raspberry Pi (fog) → SQLCipher database → Cloud (future).
C4 Component Diagram

- •Detailed view of the ESP32 firmware (FreeRTOS tasks) and the fog hub (Python modules).
Database Encryption

- •SQLCipher + libsodium on the Raspberry Pi Zero 2W: encrypted SQLite database, access control, and audit log.
Wiring Diagram

- •Hardware components: ESP32-C6, accelerometer, buzzer, LED, and button.
Conclusion
Fall-Larm shows that IoT security doesn't have to be an afterthought in school projects — real-world-grade protection is achievable with the right architectural choices.
Choosing a fog architecture (local Raspberry Pi) instead of the cloud was key to GDPR compliance and minimizes the attack surface.
A soft dependency on SQLCipher (graceful fallback to sqlite3 with a warning) shows that robustness and transparency can go hand in hand.
Next steps: topic-level ACLs for fine-grained per-device permissions, certificate revocation (CRL/OCSP), and integration with a physical ESP32-C6.