# β‘ SolarPay β Smart IoT Solar Pay-As-You-Go System
π **Powering Africa with IoT + Pay-As-You-Go Solar**
Built at the **Africa's Talking Women in Tech Hackathon 2025** β¨
---
## π Problem
Millions of households in Africa use small solar systems but:
- β οΈ Don't know when their battery will die (sudden blackouts).
- πΈ Struggle with flexible, affordable payment methods.
- π΅ Lack access to internet β only feature phones available.
---
## π‘ Our Solution: **SolarPay**
β
IoT-powered battery monitoring
β
Affordable **Pay-As-You-Go energy** with Airtime
β
**USSD & SMS access** (works even on Kabambe phones)
β
Visual hardware demo: light bulb ON/OFF after payment
---
## β¨ Features
- π **Battery Monitoring** β ESP32 + sensors track solar battery status.
- π± **USSD/SMS Menu** β Users dial `*123#` to check power status.
- π° **Pay-As-You-Go with Airtime API** β Unlock power for small payments.
- π‘ **Relay-Controlled Demo Load** β Light bulb switches ON/OFF after recharge.
- βοΈ **Optional Voice Alerts** β For accessibility.
---
## π οΈ Tech Stack
**Hardware** β‘
- ESP32 microcontroller
- Voltage Sensor + Current Sensor
- Relay Module + Light Bulb
**Backend** π₯οΈ
- Node.js + Express
**Database** ποΈ
- Firebase Realtime Database
**Africa's Talking APIs** π‘
- SMS API β Battery alerts
- USSD API β Interactive menu
- Airtime API β Pay-As-You-Go payments
- Voice API β Optional status calls
---
## ποΈ System Architecture
```mermaid
flowchart LR
A["Solar Panel + Battery"] --> B["ESP32 + Sensors"]
B --> C["Relay + Bulb"]
B --> D["Backend - Node.js + Express"]
D --> E["Firebase Realtime DB"]
D --> F["Africa's Talking APIs"]
F --> G["User Phone SMS/USSD/Airtime"]
G --> F
```
---
## π Getting Started
### π Prerequisites
- **Node.js** (v16 or higher)
- **Arduino IDE** (for ESP32 programming)
- **Africa's Talking Account** with API keys
- **Firebase Project** set up
- **Hardware Components:**
- ESP32 Development Board
- Voltage/Current Sensors
- Relay Module
- Light Bulb (for demo)
- Breadboard & β¦