Cylock
Cylock is the final project I developed for my Android development diploma. This page will explain my experience developing the project, focusing on the technical challenges and design decisions, rather than specific technical details.
You can download the original project report (it is in Spanish).
Overview
Cylock is an IoT solution aimed at preventing bike theft by tracking and localizing the bike. The project was guided by two main goals:
- Low-cost: The IoT device had to be affordable for general bike users.
- User-friendly experience: The system should be simple to configure and easy to use without needing advanced technical knowledge.
Architecture
The architecture consists of three main components:
- An IoT embedded system written in C++, acting as the MQTT Publisher.
- An Android application written in Java, acting as the MQTT Subscriber.
- A Firebase server acting as the MQTT Broker.
IoT Device
The IoT device is built using an Arduino Nano, a SIM800L GPRS module, and a Li-Ion battery. This setup provides geolocation and internet access via a SIM card.
Key features of the device include:
- Arduino Nano: Manages the SIM800L module, initializes it, periodically requests GPS coordinates, and sends MQTT messages to notify the Android app. The device operates in two modes:
- Standby Mode: Requests GPS data less frequently to save battery.
- On Movement Mode: Increases the GPS request frequency when movement is detected (based on a GPS location threshold).
The device intelligently switches between these two modes to avoid mode changes caused by minor GPS deviations or known errors.
- SIM800L (GSM 2G module): Provides GPS and internet capabilities. This module allows the device to connect to the internet using a SIM card with a mobile data plan.
Cylock (Android App)
The Android app serves as the main interface for users, allowing them to interact with the IoT device. It subscribes to MQTT messages and acts as the control center for the alarm system.
The app’s core functionality includes:
- Alarm System: Users can arm or disarm the system, which monitors the bike’s status (parked or potentially stolen) using the following flow:
- Metrics Calculation: Calculates and displays metrics such as saved CO2/fuel based on registered activity.
- Activity Log: Keeps track of past activities and alerts.
- User Onboarding: A live tutorial guides new users through the app’s main features.
Challenges & Decisions
IoT Device Design
-
Ubiquity: The biggest challenge was ensuring ubiquity (wide-area communication) without being tied to a local connection like Bluetooth or WiFi. I initially considered non-SIM-based GPS devices but rejected this approach because they couldn’t provide internet access. Since a user might be far from their parked bike (e.g., at work or home), I opted for a GSM module, which requires a SIM card with internet access. Although this added some cost to the user experience, it resolved the distance limitation.
-
IoT Device Logic: The SIM800L GSM 2G module cannot be programmed directly; it is controlled via AT commands, which required integration with the Arduino Nano microcontroller. The Arduino handled sending these AT commands to the SIM800L, ensuring it could send MQTT JSON messages to Firebase, which acted as the broker for real-time communication. Although 2G internet is limited to 64 Kbps, this was sufficient for the small data packets (GPS coordinates) sent by the device. In the future, the system could be upgraded with more advanced SIM modules that offer higher speeds but still use the same AT commands.