Batam Pulse
Batam Pulse is a live geospatial dashboard for Kota Batam that runs entirely on one Arduino UNO Q, with Gemma 4 E2B (open weights, llama.cpp) running locally on the board’s CPU as the AI assistant. No cloud, no API fees, and no resident data ever leaves Batam.
What it does
- Map of all 64 kelurahan with BMKG’s official 3-hourly forecasts (rain intensity, temperature, wind), aggregated per kecamatan.
- City conditions: air quality (PM2.5 / US AQI), sea level and wave height for the north coast (tidal-flood / rob indicator), latest BMKG earthquake, and live aircraft over Hang Nadim (OpenSky).
- Gemma 4 on-device writes a one-line headline with an alert level (JSON-schema constrained: tenang / waspada / siaga), a daily briefing for residents in Bahasa Indonesia, and answers questions such as “Perlu masker nggak hari ini?” or “Hujan nggak di Nagoya malam ini?” (it knows Nagoya is in Lubuk Baja and answers from the hourly forecast).
- LED matrix: the 8x13 matrix shows the silhouette of Batam island (rasterised from GADM); kecamatan with rain right now blink, rain expected within 6 h stays lit. Driven by the STM32 sketch over Arduino Bridge RPC.
Privacy by design, radically cheaper
- Every prompt a resident types is processed by an open-weight model on the board itself. Questions, locations and habits are never sent to a third-party API, logged in a cloud, or used for training. The only outbound traffic is public open data (BMKG, Open-Meteo, OpenSky).
- The whole stack runs on an Arduino UNO Q (under US$60, one-time), versus a GPU server or a monthly cloud-LLM bill. It idles at a few watts, works 24/7, and the LED matrix still shows the city state even when nobody opens the browser.
How Gemma 4 runs fast on a 4-core Cortex-A53
- Python does all the geospatial work (nearest kelurahan, kecamatan aggregation, place aliasing) and hands Gemma a ~300-token summary.
- The summary sits in the system prompt and stays constant between data refreshes, so llama-server’s prefix cache makes a question cost ~25 new tokens: measured 127 s cold vs 9.5 s warm prompt processing. General questions answer in ~37 s, place questions in 70-115 s, on CPU with no GPU.
- Headline uses structured JSON output; the briefing is regenerated after every BMKG refresh; the prefix is re-warmed hourly with fresh air/sea data.
Impact
Batam is an island city where it can pour in Batu Aji while Nongsa is sunny, coastal areas flood at spring tides, and haze season changes air quality within hours. Batam Pulse turns open government and open data into hyperlocal, spoken-language guidance on a device that can sit in a kelurahan office, a school, or a BPBD post. Everything is open source.
Next phase
- Sensors on the UNO Q (rain gauge, PM2.5, water level, BME280) so every board becomes a live station on the map and Gemma can compare local readings with the BMKG forecast.
- Voice in / voice out: microphone + speaker with on-device speech-to-text and TTS so residents can ask aloud and hear Gemma answer in Bahasa Indonesia, no screen needed.
- Mesh of boards across kelurahan offices, schools and BPBD posts sharing readings over the local network.
Stack
Arduino UNO Q (Debian + STM32U585), Arduino App Lab (web_ui brick, Bridge), Python, llama.cpp b12019, Gemma 4 E2B Q3_K_M (unsloth GGUF), Leaflet + OpenStreetMap, BMKG open API, Open-Meteo, OpenSky Network, GADM 4.1.
Built in one day for Hacktoberfest Hack Day Kota Batam, with Claude Code as the coding agent.
Built with
AI tools
Prize Categories Entered
- Submitted
Best Use of Gemma 4
- Submitted

Best Open-Source AI Project