Safe Safar

Create a localized security net

Safe Safar is a low-cost safety keychain that sends emergency alerts via local public internet grids. It works instantly without you ever having to grab your phone or open an app.

The Working Mechanism

01

Our project, Safe Safar, turns the existing internet infrastructure of Pakistan into an invisible safety net.

02

When a student clicks this button 3 times, it screams an open radio distress cry into the air. It does not need to know any private Wi-Fi passwords.

03

We partner directly with big internet companies like StormFiber and PTCL. A simple update on their central network tells nearby street routers to catch that distress cry and instantly fire a live tracking map straight to the parents' phones. Zero hardware costs for us, and 100% safety for the city.

9:41

Command Panel

Guardian Daemon Active

Monitoring local gateways · 3 nodes in range

Location

Live

Keychain

Paired

Alerts

Private

Failsafe

Armed

PrivateCommunityLog

Mobile Companion App Engine

This application runs silently as an ultra-lightweight background listener to securely capture local hardware distress tokens and route critical telemetry.

Technical Source Code Architecture

Keychain Software Code

Framework Language: C++ / Arduino IDE. This embedded firmware script handles hardware click inputs, wakes the Wi-Fi chip from low-power standby, and injects raw unauthenticated 802.11 management probe request frames into local open airwaves.

keychain_firmware.ino

#include <ESP8266WiFi.h>
extern "C" { #include "user_interface.h" }
const int BUTTON_PIN = 4;
int clickCount = 0;
unsigned long lastClickTime = 0;
uint8_t packetPayload[] = { 'S', 'U', 'R', 'A', '1', '0', '1' }; 

void setup() {
  pinMode(BUTTON_PIN, INPUT_PULLUP);
  WiFi.mode(WIFI_OFF);
}
void loop() {
  if (digitalRead(BUTTON_PIN) == LOW) {
    unsigned long currentTime = millis();
    if (currentTime - lastClickTime > 200) {
      clickCount++;
      lastClickTime = currentTime;
    }
    if (clickCount == 3) {
      sendEmergencyProbe();
      clickCount = 0;
      ESP.deepSleep(0);
    }
  }
  if (clickCount > 0 && (millis() - lastClickTime > 2000)) {
    clickCount = 0;
  }
}
void sendEmergencyProbe() {
  WiFi.mode(WIFI_STA);
  for (int channel = 1; channel <= 13; channel++) {
    wifi_set_channel(channel);
    for (int i = 0; i < 5; i++) {
      wifi_send_pkt_freedom(packetPayload, sizeof(packetPayload), 0);
      delay(10);
    }
  }
}

Mobile App Code

Framework Language: JavaScript / React Native. This background service acts as an offline black box loop. If local network infrastructure is missing, it commands the phone's satellite GPS chip to cache the current latitude and longitude coordinates safely inside the device's internal storage disk.

offlineFailsafe.js

import { NativeModules } from 'react-native';
import Geolocation from 'react-native-geolocation-service';
import AsyncStorage from '@react-native-async-storage/async-storage';

const KEYCHAIN_DEVICE_SIGNATURE = "SURA101";

export async function handleKeychainBroadcastEvent(detectedSignature) {
  if (detectedSignature !== KEYCHAIN_DEVICE_SIGNATURE) return;
  
  Geolocation.getCurrentPosition(
    async (position) => {
      const emergencyPacket = {
        timestamp: new Date().toISOString(),
        latitude: position.coords.latitude,
        longitude: position.coords.longitude,
        status: "OFFLINE_BLACKBOX_LOGGED"
      };
      await AsyncStorage.setItem('@SafeSafar_LastActiveLocation', JSON.stringify(emergencyPacket));
      triggerBackgroundDataNetworkSync(emergencyPacket);
    },
    (error) => { console.error(error.message); },
    { enableHighAccuracy: true, timeout: 5000, maximumAge: 0 }
  );
}

Industrial Cost Architecture & Physical Specs

Retail Market Price

450 – 500 PKR

Highly economical for local Pakistani students.

Factory Production Cost

~250 PKR

Per unit, at manufacturing scale.

Chipset Module

120 PKR

Power Cell

30 PKR

Polymer Casing

50 PKR

Structural Elements

50 PKR

Size

2.0 x 1.0 x 0.4 inches flat profile.

Weight

15 grams total mass.

Materials

Polycarbonate shell, ABS structural plastic core, and textured rubber toggles.

Frequently Asked Questions