Precision Fertiliser System
A complete precision-fertilising rig: ESP32 firmware driving a dosing motor, an MQTT link, and a Flutter dashboard that runs on phone, desktop and web.
- My role
- Firmware, MQTT contract, and Flutter dashboard.
- Field
- IoT & Embedded, Mobile Apps
Overview
Fertiliser is expensive and easy to waste. The rig meters it out by commodity instead of by habit: the operator picks what is being grown, the app works out a dose per plant, and the device dispenses exactly that at every point.
The architecture is still deliberately server-less. The Flutter app and the ESP32 talk to each other through an MQTT broker as two peers — no back end to keep alive, no database bill, and operating statistics stay in the device’s own EEPROM. What changed in version 2 is that the door is no longer open. The first version used a public broker with fixed topics shared by every unit, so anyone who knew the topic could change the dose. Now the broker is configurable, TLS is on by default, credentials sit in the phone’s Keystore or Keychain, and each device lives under its own topic.
The second change is that a command is not finished when the broker accepts it. Every command carries a random id and a timestamp; the app shows a summary first, publishes, then waits for a status message that echoes the id back. If none arrives within eight seconds the operator is told the command was sent but not confirmed — instead of assuming it worked. The old JSON keys were kept, so the firmware only has to move topics and start acknowledging.
In pictures





Function
- Device
- ESP32 with DC dosing motor and OLED display
- Transport
- MQTT + JSON over TCP/WebSocket, no server in between
- Client
- Flutter dashboard for Android, iOS, web and desktop
What it does
- 01Rule-based dose recommendation for 13 crops by days after planting, for NPK or Urea, with the plant count estimated from field area and spacing.
- 02Doses outside what the dispenser can deliver (5–50 g per point) are blocked with an explanation instead of being sent.
- 03Every command is reviewed in a summary sheet and confirmed by the device, with a clear “sent, not confirmed yet” state.
- 04Configurable broker with TLS and credentials; the password is kept in Keystore/Keychain and never shown again.
- 05Live device status — online, offline, disconnected or not set up — with automatic reconnect that backs off but never gives up.
- 06Usage statistics from the device with a live chart, plus manual dosing for when the operator overrules the recommendation.
- 07Onboarding, a searchable in-app guide and FAQ, and a help button on every screen that opens its own section.
- 08One Flutter codebase serving Android, iOS, web and desktop.
Technical notes
- Broker
- Configurable; TLS on 8883 (WSS 8084 on web), username/password
- Topics
- ferticore/<device-id>/status and /command, one device per topic
- Commands
- Random id + timestamp, acknowledged by the device within 8 s
- State
- Provider for app state; EEPROM for device statistics
- Back end
- None — app and device are MQTT peers