SmartFarm Platform Documentation
Master the unified Project → Device → Sensors architecture. Complete guidance on onboarding, telemetry monitoring, safety-interlocked KUA irrigation, power profiles, AI agronomy, and developer APIs.
1. Quick Start & System Architecture
v7.0 Unified PlatformWelcome to Angaza Elimu SmartFarm. SmartFarm enables farmers, cooperatives, and agronomists to monitor microclimates, automate precision irrigation, and receive agronomic insights from anywhere in the world.
SmartFarm organizes hardware and agronomic telemetry around three decoupled layers:
Project (Tenant)
Top-level administrative boundary encapsulating farm parameters.
- County, Sub-County, Ward
- Point GPS Coordinates
- Crop & Soil Profiles
- Cryptographic API Key
Hardware Devices
IoT controllers executing field operations and transmitting telemetry.
- 1 Master Controller Invariant
- Multiple Slave / Sensor Nodes
- Battery & Solar Power Profiles
- RSSI Radio Signal Link
Sensors & Actuators
Direct environmental sensing & physical water delivery.
- 8 Live Sensor Streams
- Soil Moisture, DHT, NPK, pH
- KUA Solenoid Valves (V1..V4)
- Water Pumps (P1..P2)
Create Account & Enable MFA
Register your account, verify your email, and enable Two-Factor Authentication (App Authenticator TOTP or Email OTP) for bank-grade farm security.
Create a Farm Project
Open Projects & Access → Create Project. Enter project name, choose agronomic crop/soil settings, and set location coordinates (County, Sub-County, Ward, and GPS Pin).
Register & Link Devices
Go to Devices → Register Device to register your Master Controller and sensor nodes. Then connect them to your project via Connected Devices.
Monitor Telemetry & Configure Control
View real-time incoming sensor streams on your Project Control dashboard, set threshold alerts (SMS/Email/WhatsApp), and program irrigation routines.
2. User Roles & Access Control (RBAC)
Access Control MatrixSmartFarm enforces strict multi-tenant Role-Based Access Control (RBAC) to ensure that operators, managers, and stakeholders have precisely the permissions they need without risking unintended field changes.
| Platform Capability | SuperAdmin | Project Owner | Project Admin | Farm Manager | Viewer |
|---|---|---|---|---|---|
| View Live Dashboards & Sensors | |||||
| Trigger Actuators & Run Irrigation | |||||
| Edit Sensor Alert Thresholds | |||||
| Register & Link Hardware Devices | |||||
| Invite & Revoke Team Members | |||||
| Create New Projects & Rotate API Keys | |||||
| Cross-Tenant System Governance & Audit Logs |
To protect high-impact field actions, SmartFarm enforces Step-Up Re-Authentication. When executing destructive or critical operations (such as rotating project API keys, deleting projects, or emergency pump overrides), the system prompts for your account password or MFA token to establish an elevated 15-minute secure session.
3. Project & Location Configuration
3-Step Creation WizardA Project is the parent boundary for all farm operations. Setting up a project properly enables automated regional weather forecasting, geo-specific crop suitability, and tailored irrigation schedules.
1 Step 1: Information, Agronomy & Location
- Project Name & Description: Distinct title (e.g.
Greenhouse Block 2). - Project Type: Choose between Crops Project (select Crop Type, Soil Type, Annual Rainfall) or Others (livestock, aquaculture, nursery).
- Geographic Location & Map Pin: Select your Kenyan
County,Sub-County, andWard. You can also click Detect My Current Location to automatically pinpoint GPS coordinates and place the interactive map marker.
2 Step 2: Alert & Notification Configuration
- Alerting Status: Active (enables automated threshold notifications) or Inactive (mutes alerts during maintenance).
- Delivery Channel: Select SMS, Email, or Both (SMS & Email).
- Contact Routing: Use default account details or toggle Use custom notification details to route emergency alerts to on-site farm managers.
3 Step 3: Review & Instant Deployment
Review the configuration summary card. Submitting the wizard generates your cryptographic project API key, creates a MongoDB Point coordinate geometry index, and redirects you to the My Projects dashboard.
When rotating your project API key, SmartFarm implements an automatic grace period window (api_key_grace_until). During this window, your field devices can continue transmitting using their existing key while technicians update firmware, preventing packet dropouts.
4. Device Registry, Power Profiles & Signal Quality
Hardware HierarchyLearn how hardware devices interact under the SmartFarm network, how power subsystems are monitored, and how to interpret signal strength in the field.
The Master Controller is the sole hardware authority responsible for hydraulic valve station sequencing and pump relay actuation. Connecting a second Master Controller to a project is automatically blocked by the platform to avoid actuation race conditions.
On every Device Manage page (/device-control/:deviceId), the platform provides real-time health diagnostics:
Battery Profile
- Real-time voltage (e.g.
12.6 V) and state of charge (%). - Automatic charging state inference: Displays
CHARGINGwhen solar generation is detected, andNOT CHARGINGduring night cycles.
Solar Panel Profile
- Solar array voltage output (
V). - Live Weather Sky Status: Fetches live sky conditions (e.g. Sunny, Scattered Clouds, Light Rain) from the connected project's weather API. Unconnected devices display
UNASSIGNED / NO PROJECT.
RSSI Signal Strength Benchmark Scale
| RSSI Range (dBm) | Quality Level | Field Action Recommendation |
|---|---|---|
| ≥ -65 dBm | Excellent | Optimal link margin; rapid telemetry delivery. |
| -66 to -75 dBm | Good | Stable connection for all field operations. |
| -76 to -85 dBm | Fair | Occasional packet re-transmission; consider elevating antenna. |
| < -85 dBm | Poor / Critical | High packet loss risk; install directional high-gain antenna or repeater. |
5. Telemetry Ingestion, Widgets & Alert Rules
Sensors & AlertsSmartFarm provides high-throughput telemetry ingestion supporting 8 key agronomic parameters, complete with newest-first tabular streams and anti-fatigue alert suppression.
Farmers can set custom safe limits (e.g. Soil Moisture must stay between 40% and 80%). When readings cross these boundaries, automated alerts are dispatched via Email, SMS (via Africa's Talking), and WhatsApp.
6. Smart Irrigation & KUA Actuator State Machine
Hydraulic Safety EngineIrrigating at scale requires hydraulic discipline. Raw toggle switches risk water hammer, burst pipes, and burnt-out pumps. SmartFarm implements the KUA Staged Actuation State Machine.
valve_open → [5s delay] → pump_start → running → pump_stop → [10s delay] → valve_close → complete
- Valve Open First: The target solenoid valve opens and confirms state before the pump is energized. This prevents pump cavitation and pressure buildup against a closed valve.
- Pump Stop First: When stopping or pausing, the pump stops first. The valve remains open for a 10-second dissipation delay to relieve pipeline line pressure before closing.
Quick Run
Instant manual burst (e.g. 5–15 mins) across all stations or selected zones with countdown timers.
Cycle-and-Soak
Divides watering into repeated micro-bursts (e.g. 5 min water / 5 min soak × 2) to eliminate surface runoff and penetrate heavy clay soils.
Smart Rain Delay
Automatically skips scheduled irrigation if OpenWeatherMap forecasts rain or live soil moisture exceeds target threshold.
7. AI Agronomy Advisor & Standalone Weather Station
AI & MeteorologyLeverage local agro-meteorological intelligence and machine-learning models to optimize crop yields and reduce resource waste.
Crop Suitability Matrix
Evaluates your project's soil pH, historical moisture levels, ambient temperatures, and annual rainfall to recommend optimal commercial crops.
Irrigation Advisory
Calculates precise evapotranspiration (ET) crop water demands based on growth stages (vegetative, flowering, fruiting).
Soil Nutrition Balancing
Interprets NPK readings to advise on targeted organic amendments, urea, or NPK blends, avoiding fertilizer burn.
6-Day Regional Forecast
View localized 6-day weather forecasts on /weather with rainfall probabilities, wind speed, and humidity predictions.
8. Developer REST API & MQTT Protocol
Integration GuideIntegrate external hardware kits, custom gateways, or ERP dashboards using our authenticated REST endpoints and Buni v1 MQTT bridge.
Every REST API request must supply your project API key:
1. Telemetry Ingestion (Multi-Sensor Uplink)
2. Actuation Control (KUA Start / Stop / Quick Run)
9. Hardware Setup, Wiring & Field Pinouts
ESP32 HardwareOfficial wiring standard for deploying ESP32 DevKit v1 Master Controllers and Sensor Nodes in agricultural environments.
| Peripheral / Sensor | ESP32 GPIO Pin | Interface Type | Operating Voltage |
|---|---|---|---|
| DHT22 (Temp & Humidity) | GPIO 4 |
1-Wire Digital (4.7kΩ Pullup) | 3.3V / 5V DC |
| Capacitive Soil Moisture v1.2 | GPIO 34 (ADC1_CH6) |
Analog Input | 3.3V DC |
| RS485 NPK Sensor (MAX485) | TX: GPIO 17, RX: GPIO 16 |
UART2 Modbus RTU | 5V DC (Sensor 9-24V DC) |
| Relay 1 (Solenoid Valve V1) | GPIO 26 |
Digital Output (Optoisolated) | 5V Logic (12V Switched) |
| Relay 2 (Water Pump P1) | GPIO 27 |
Digital Output (Optoisolated) | 5V Logic (12V/240V Switched) |
| Battery Voltage Divider | GPIO 35 (ADC1_CH7) |
Analog (100kΩ / 20kΩ Divider) | 0 - 3.3V Range |
10. Troubleshooting, FAQs & Offline USSD
Field SupportStep-by-step diagnostic procedures for field recovery and basic phone offline operations.
Farmers in remote areas with poor or zero internet connectivity can operate SmartFarm using any basic GSM feature phone by dialing *384#:
- Dial
*384#from your registered farm telephone number. - Select 1. Soil Moisture Status to receive live root-zone percentage via flash SMS.
- Select 2. Manual Irrigation Run to choose Station 1 or 2 and trigger a 10-minute watering burst.
- Select 3. Emergency Stop to sequentially shut down active pumps and valves.
manager or higher role permissions.