HomeAbout
Contact
Back to projectsIoT & Security

Fall-Larm

May 2026IoT Developer — responsible for the entire stack: firmware (C/FreeRTOS), security architecture, fog backend (Python), and GDPR implementation.
Fall-Larm hero

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

ESP32-C6FreeRTOS / ClibsodiumPython 3MQTT / MosquittoSQLCipherRaspberry Pi Zero 2WmTLS / OpenSSLfail2banpynacl

My role

IoT Developer — responsible for the entire stack: firmware (C/FreeRTOS), security architecture, fog backend (Python), and GDPR implementation.

The assignment

A school project as part of a vocational (YH) IoT program, focused on real-world security requirements. The assignment was to build a complete fall-detection IoT system with GDPR compliance and security built into every layer.

The challenge

Challenge

Falls are the most common cause of serious injury among the elderly. Existing alarms require the user to actively press a button — which doesn't help during a sudden fall. The challenge was to build a system that detects falls automatically, communicates securely, and handles sensitive health data in compliance with GDPR — without any data leaving the home.

Solution

A three-layer system: an ESP32-C6 (edge) running 3-phase fall detection with end-to-end encryption via libsodium; a Raspberry Pi Zero 2W (fog) acting as a local hub with an SQLCipher database, automatic GDPR retention, and daily backups; and a network layer with TLS on port 8883, per-device mTLS, and fail2ban against brute-force attacks.

Key features

3-phase accelerometer-based fall detection (FreeRTOS tasks)
XChaCha20-Poly1305 encryption on the edge (libsodium)
NVS flash offline buffer — 16 slots, survives reboot
SQLCipher AES-256 database + GDPR retention + daily backup
MQTT over TLS on port 8883 + per-device mTLS certificates
fail2ban brute-force protection

Results

Screens

Fall-Larm screen 1
Fall-Larm screen 2
Fall-Larm screen 3
Fall-Larm screen 4
Fall-Larm screen 5

Design process

System Topology

System Topology
  • •Shows the full system: ESP32 (edge) → MQTT/TLS → Raspberry Pi (fog) → SQLCipher database → Cloud (future).

C4 Component Diagram

C4 Component Diagram
  • •Detailed view of the ESP32 firmware (FreeRTOS tasks) and the fog hub (Python modules).

Database Encryption

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

Wiring Diagram

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.

Ready to build something clean and user-friendly?

Reach out and let's talk about how I can help bring your idea to life.