Work · Fintech and M-Pesa

Stima: pay-as-you-go electricity

Pay on M-Pesa and the lights come on. No 20-digit token.

Status
PrototypeWorking prototype with demo video; v2 deployed on cPanel
Period
Dec 2025 → 2026
Role
Hardware, firmware and backend
Brand
Tuchopini
Stima: pay-as-you-go electricity screenshot

An M-Pesa STK Push payment hits a Flask callback, is logged to SQLite, and an Arduino/ESP8266 relay switches power on for the paid duration at KES 1 per 10 seconds. Version 2 re-architected the device to poll the server every three seconds so it works from any Wi-Fi with no port forwarding, and deployed the backend to shared cPanel hosting so it demos anywhere.

The problem

Prepaid electricity in Kenya makes you pay, wait for a 20-digit token by SMS, walk to the meter and type it in. People mistype it or lose the SMS.

What we built

Payment applies credit automatically. The token step disappears.

What it does

  • M-Pesa Daraja STK Push and callback
  • Reverse-polling ESP8266 firmware
  • Relay control timed to the amount paid
  • Deployable on shared hosting via Passenger

Every part of the chain is standard technology. The engineering is designing for the weakest link: the GSM or Wi-Fi at the meter's wall, not the data centre.

Watch

M-Pesa payment switches the relay (73 s) · 1:13

More fintech and m-pesa