Inspiration

Kampala floods — and it floods badly. Neighbourhoods like Bwaise, Kinawataka, and Nakivubo sit in low-lying areas that turn into rivers within minutes of heavy rain. These are also some of the city's most densely populated and economically vulnerable communities. Families lose homes, livelihoods, and sometimes lives — not because the rain is unpredictable, but because there is no system to warn people in time.

What struck me most is that the weather data already exists. Satellite forecasts can predict heavy rainfall hours in advance. Yet that information never reaches the people who need it most — largely because most early-warning systems assume internet access, smartphones, or expensive infrastructure. In Uganda, over 60% of the population relies on basic (feature) phones. A flood warning locked behind an app is no warning at all.

That gap — between available data and the people it could protect — is what inspired this project.


What it does

The Kampala Flood Early-Warning SMS System is a lightweight, automated alert tool that:

  1. Fetches hourly rainfall forecasts for Kampala's flood-prone zones using the Open-Meteo API (free, no key required)
  2. Evaluates risk — if forecast precipitation exceeds a defined threshold (e.g. >15mm in the next 3 hours), an alert is triggered
  3. Sends a plain-text SMS to registered residents in affected neighbourhoods via Africa's Talking API
  4. Requires no smartphone, no internet, and no app — just a basic mobile number

A sample alert message looks like this:

⚠️ FLOOD ALERT — Bwaise: Heavy rain expected in the next 3 hours. Move valuables to higher ground. Avoid Lubigi channel area. Stay safe. — KampalAlert

The system also includes a simple web dashboard showing real-time rainfall forecasts and neighbourhood risk levels (green / amber / red) for use by community leaders and local government.


How I built it

  • Weather data: Open-Meteo — open-source forecast API, no authentication required, hourly precipitation data for any coordinates
  • SMS delivery: Africa's Talking — SMS API with strong Uganda network coverage and a free sandbox for development
  • Backend: Python script that runs on a scheduler (cron job), fetches forecast data, evaluates thresholds, and dispatches alerts
  • Dashboard: HTML + JavaScript with Chart.js for the rainfall forecast visualisation and Leaflet.js for the Kampala neighbourhood map
  • Deployment: Designed to run on any low-cost cloud instance or even a Raspberry Pi locally

Challenges I faced

Finding the right threshold. Deciding what rainfall level triggers an alert required researching Kampala's drainage capacity and historical flood events. Set it too low and people ignore alerts; too high and the warning comes too late. We landed on >15mm/3hr as a starting threshold, with the intention of refining it with local hydrology data.

Reaching the right people. Building the SMS list responsibly — ensuring opt-in consent, multilingual messages (English + Luganda), and accessibility for elderly residents — is a real implementation challenge that goes beyond the hackathon prototype.

No smartphone assumption. Designing for feature phones meant stripping every assumption about rich notifications, apps, or links. The message has to be short, clear, and actionable on its own.


What I learned

  • Open weather APIs are powerful and underused in African urban resilience contexts
  • The hardest part of climate adaptation tech is not the code — it's the last mile: trust, language, community buy-in
  • Solutions that work for the most vulnerable tend to work for everyone

What's next

  • Partner with Kampala Capital City Authority (KCCA) and local community organisations for pilot deployment
  • Integrate historical flood data to improve threshold calibration
  • Add Luganda-language alerts and an opt-in registration shortcode
  • Expand to other flood-prone Ugandan cities: Jinja, Mbale, Masaka
  • Explore USSD as a complementary channel for two-way communication

Built With

Share this project:

Updates