INDUSTRIAL IoT · TEA PROCESS INTELLIGENCE

SPECTRA
LEAF

Digitizing the Fermentation Sweet Spot

Spectra Leaf aims to make black-tea oxidation measurable and repeatable by capturing temperature, gas and colour telemetry for live factory guidance and future quality-control models.

3Sensor DomainsTemperature · Gas · Colour
Real-TimeBatch TelemetrySynchronized sensing
ServerlessAWS ArchitectureElastic cloud services
24/7Remote MonitoringConnected visibility
AI-ReadyStructured DatasetBatch-linked profiles
01Project overview

Spectra Leaf aims to digitize the most judgement-sensitive stage of black-tea production and help factories reproduce a better fermentation sweet spot from measured evidence.

Spectra Leaf is an Industrial IoT system that measures what happens across the tea bed, sends the signals to a secure cloud platform and turns them into live operational guidance.

Tea makers commonly call the post-rolling stage “fermentation”. Technically, the main transformation is enzymatic oxidation: rolling or CTC ruptures the leaf cells, oxygen reaches the compounds inside, and colour and aroma develop across the moist solid leaf bed.

This is the phase Spectra Leaf addresses. Temperature, volatile-gas response and colour are captured together so a factory officer can follow the batch without depending on isolated visual checks alone.

Tea leaves spread across a fermentation trough during the monitored oxidation stage
MONITORED PHASE Post-rolling enzymatic oxidation
BLACK TEA PROCESS / TARGET PHASE

The project observes the window between rolling and drying.

Leaves are spread as a solid bed while oxygen-driven reactions develop the expected coppery colour and characteristic aroma. Drying then arrests the reaction. Spectra Leaf concentrates its measurements and guidance inside this changing window.

01WitherReduce leaf moisture
02Roll / CTCDisrupt leaf cells
03OxidizeMonitor this phase
04DryStop oxidation
THE AUTOMATED METHOD

Sense. Synchronize. Guide. Learn.

The system automates data capture, cloud synchronization, batch history and live visualization. Expert quality evaluation remains part of the loop and supplies the labels needed for future prediction.

01

Sense

Sample temperature, gas and leaf colour at the same time.

02

Synchronize

Publish batch-linked readings securely through AWS IoT.

03

Guide

Show live progress and device state to the factory officer.

04

Learn

Pair each completed profile with its final Good Leaf Percentage.

Current constraintMANUAL
01Subjective visual judgement
02Inconsistent batch quality
03No synchronized sensor history
04Limited remote visibility
05No suitable local training dataset
Spectra Leaf responseCONNECTED
01Quantified sensor measurements
02Real-time factory guidance
03Batch-linked historical records
04Secure remote access
05AI-ready structured telemetry
ASSEMBLY FILMScroll-driven build sequence

From components to one complete device.

Scroll through the three assembly stages, from the first sensor connection to the finished enclosure.

  1. 01
    SENSOR ASSEMBLYBuild the sensing layer.

    Mount the temperature, humidity, gas and vision sensors that observe the leaf bed.

  2. 02
    PUMP + PCBIntegrate flow control and the custom PCB.

    Connect the pump system, relay interfaces and the project-specific controller board.

  3. 03
    FINAL DEVICEComplete the full device assembly.

    Bring sensing, flow control, enclosure and edge connectivity together as one operational unit.

02Objectives

Journey / 01—04

From a human reading
to a system that learns.

Four deliberate moves connect the factory floor to future intelligence—without removing expert judgement from the process.

Chapter 01

Digitization

Replace subjective manual monitoring with measurable sensor data.

Replace instinct-only checks with a view of the living leaf bed.

Observe01
Chapter 02

Real-Time Guidance

Give factory officers a responsive dashboard for monitoring active fermentation batches.

Give the shift team immediate context while the batch is active.

Measure02
Chapter 03

Data Harvesting

Build structured fermentation profiles mapped to final Good Leaf Percentage values.

Keep every signal attached to its batch and final quality result.

Understand03
Chapter 04

Future Automation

Prepare for machine-learning-based detection of the optimum fermentation endpoint.

Turn accumulated evidence into future endpoint intelligence.

Automate04
Human observationAssisted intelligence
03Key features

The current prototype combines practical sensing, reliable telemetry and usable factory insight while preparing every batch for future intelligence.

01
SENSOR CHANNELS

Six synchronized inputs

Temperature, humidity, vision and three gas-response channels capture one batch-linked view of the changing tea bed.

02
SHARED PROCESS STATE

Shared live batch control

Starting or stopping fermentation updates the backend-owned process state seen by connected web and mobile clients.

03
EDGE RECOVERY

Resilient camera edge

The ESP32-CAM coordinates sensing and visual context, reconnects after interruptions and resumes secure publishing.

04
SECURE TELEMETRY

Serverless cloud pipeline

AWS IoT Core, Lambda and DynamoDB move telemetry securely without fixed server infrastructure.

05
USER ROLES

Role-aware access

Cognito protects operational data while officers and managers receive interfaces matched to their responsibilities.

06
QUALITY LABEL LINK

Quality-ready evidence

Completed sensor profiles can be paired with expert Good Leaf Percentage results for future model development.

04Architecture

Signal journey / 01—03

One batch identity.
Every handoff intact.

Follow a reading from the warm leaf bed, through a secure cloud state, to the people making the next decision.

01 / EdgePhysical world → telemetry

Capture at the tea bed

The ESP32-CAM aligns every reading with the active device, batch and timestamp before secure transmission.

TemperatureHumidityVisionMQ137TGS2620TGS822
02 / CloudTelemetry → trusted state

Synchronize and preserve

AWS services validate incoming data, retain batch history and maintain one shared fermentation state.

IoT CoreDevice ShadowLambdaAPI GatewayDynamoDB
03 / InterfaceTrusted state → action

Guide the factory team

Authenticated web and mobile views translate the same backend state into role-appropriate controls and insight.

Officer mobileFactory dashboardCognitoLive state
Continuity register05 connected handoffs
01Sensor inputSix physical channels

Temperature, humidity, imaging and three gas-response signals.

02Edge controllerESP32-CAM

Synchronized capture, device identity and secure Wi-Fi publishing.

03Cloud stateIoT Core + Device Shadow

Telemetry transport and one shared RUNNING or STOPPED state.

04Application dataLambda + API Gateway + DynamoDB

Validation, protected operations and batch history.

05Authorized clientsCognito + web + mobile

Role-aware access to controls, trends and completed records.

05Hardware system

The device combines temperature, humidity, imaging and three complementary gas-response sensors around a central ESP32 controller.

ESP32 controller board used as the main Spectra Leaf hardware controllerMAIN CONTROLLER / ESP32
MAIN CONTROLLER

ESP32 controller

The ESP32 is the device control hub. It reads the sensor channels, coordinates pump and relay actions, manages the local display and publishes batch-linked telemetry over secure Wi-Fi.

DUAL-CORE MCU2.4 GHz WI-FII²C / ADCMQTT/TLS
HARDWARE COMPONENTS

One synchronized sensor array, six distinct signals.

01 / 06
CHANNEL 01 · DS18B20 / 1-WIRE

Temperature probe

The stainless probe sits inside the tea bed and records process temperature without exposing the sensing element to moisture.

WHY THIS SIGNAL MATTERS

Direct leaf-bed temperature is the clearest signal for checking whether oxidation is progressing inside the material rather than only measuring chamber air.

READSTemperatureOUTPUT°C · DIGITAL
Spectra Leaf V1.0 custom PCB with labelled ESP32, sensor, display, relay and power connections
Spectra Leaf V1.0 · Team-designed control PCB
TEAM-DESIGNED HARDWARE

Custom control PCB

The Spectra Leaf V1.0 board consolidates ESP32-CAM control, temperature and humidity inputs, three conditioned gas channels, relay interfaces and regulated power on one project-specific PCB.

  • Labelled connections for repeatable sensor assembly
  • Integrated controller, display and relay interfaces
  • A compact base for field trials and enclosure revisions
FIRMWARE SEQUENCE

A loop designed to recover, report and continue.

01

Connect securely to Wi-Fi

02

Connect to AWS IoT Core

03

Subscribe to Device Shadow

04

Read RUNNING / STOPPED state

05

Sample temperature and humidity

06

Read MQ137, TGS2620 and TGS822

07

Capture an ESP32-CAM frame when required

08

Attach device, batch and timestamp

09

Publish telemetry using MQTT

10

Update reported Shadow state

11

Reconnect after interruption

12

Continue the sensing loop

Spectra Leaf firmware sequence dashboard
06Cloud infrastructure

The architecture separates device messaging, shared process state, validation, storage, identity and presentation so each part can scale and recover independently.

CLOUD ARCHITECTURE / DATA + CONTROL

Telemetry moves left to right. Start and stop commands return through the same authenticated path and are synchronized with the edge node through Device Shadow.

01Factory edgeESP32 samples and identifies each batch
02IoT Core + ShadowMQTT telemetry and shared RUNNING state
03Lambda + APIValidate, transform and expose operations
04DynamoDBPersist time-series and batch quality
05Web + mobileRole-specific views through Cognito
CONTROL RETURNDashboard → API → Device Shadow → ESP32
01

AWS IoT Core

Secure MQTT gateway and device communication layer.

02

Device Shadow

Synchronizes desired dashboard state with the ESP32 reported state.

03

AWS Lambda

Runs validation, processing and control logic without persistent servers.

04

API Gateway

Provides controlled REST endpoints for dashboard operations.

05

DynamoDB

Stores batch records and timestamped sensor telemetry.

06

Amazon Cognito

Authenticates users and issues tokens for role-aware access.

07

AWS Amplify

Connects the Next.js client to identity and cloud services.

07Software platform

The software stack turns synchronized telemetry into clear, role-appropriate actions while keeping identity and protected cloud access in one managed flow.

IMPLEMENTED TECHNOLOGY STACK

Frameworks, languages, cloud services and security components used across the platform.

ExperienceNext.js · React · TypeScript · Tailwind CSS
IntegrationAWS Amplify v6 · REST APIs · MQTT state
Cloud dataDynamoDB · Lambda · API Gateway · IoT Core
IdentityAmazon Cognito · JWT · role claims
CLIENT STACK / AWS AMPLIFY v6

Secure access without operational friction.

Next.js and React power the responsive interface, while TypeScript and Tailwind CSS provide a consistent implementation and visual language. Amplify connects Cognito identity to protected cloud services and preserves session continuity through token refresh.

Active batches, device connectivity and fermentation progress remain visible across desktop, tablet and mobile.

Next.js + React

Responsive operational interface

Amazon Cognito

Managed user identity and sign-in

Protected requests

JWT attached to authorized APIs

Session continuity

Token refresh across active work

Responsive access

Desktop, tablet and mobile

Clear batch state

Active work stays visually prominent

SECURITY / AMAZON COGNITO

Identity is checked before operational data is exposed.

Cognito manages sign-in and session tokens. The client attaches a valid JSON Web Token to protected requests, where authorization rules can distinguish factory officers, factory managers and general managers.

1. Sign inCognito user pool2. VerifyJWT + role claims3. AuthorizeProtected API access
08Data and AI

Every batch creates a synchronized record that connects physical change, cloud data and expert-evaluated final quality.

Open datasets correlating detailed tea-oxidation sensor readings with final factory quality measurements are limited.

Spectra Leaf captures synchronized temperature, gas and colour readings, then links the completed profile to an expert-evaluated Good Leaf Percentage.

DATABASE → AI MODEL → FACTORY GUIDANCE

The prediction layer is the planned outcome of the dataset now being collected; it is not presented as a production model.

01DynamoDBRaw readings + batch records
02Labelled datasetSensor profile + final GLP
03ML trainingFeature engineering + validation
04Operational guidanceFuture stage estimate + alert
01

Capture

The officer starts a batch and the ESP32 samples temperature, gas response and colour together.

02

Transmit

Readings are identified by device, batch and timestamp, then published securely through MQTT.

03

Validate + store

Cloud functions check the payload and persist the time-series profile in DynamoDB.

04

Add quality label

After grading, the expert-evaluated Good Leaf Percentage is linked to the completed batch.

05

Curate the dataset

Profiles are cleaned, aligned and organized into trustworthy model-ready examples.

06

Train + guide

Future models learn process-to-quality patterns and can return stage estimates or alerts.

09Future ML concept

Machine learning is planned future work. The current contribution is a reliable, batch-linked and expert-labelled dataset.

DATASET LAYER ACTIVEINFERENCE LAYER · FUTURE WORK
Concept artwork showing synchronized sensor signals converging around a tea leaf
01 / SIGNAL FUSIONCONCEPT VISUAL
Temporal modelMulti-sensor sequence classification
Batch-linked evidence available now
PROPOSED MODEL FEATURES
Rate of temperature riseVOC trend slopeColour change rateElapsed fermentation timeCombined sensor signaturesHistorical batch similarityGood Leaf Percentage labels
01CaptureSensor profiles by batchACTIVE
02LabelPair profiles with expert GLPDATA PHASE
03TrainValidate a time-series modelFUTURE
10Role-based platform

Three authenticated roles share one data platform while receiving the controls, detail and reporting appropriate to their responsibilities.

01
Live operations

Factory Officer

  • Start and stop fermentation
  • Assign batch and device IDs
  • Follow live sensors and trends
  • Review batch history and enter GLP
View interface
02
Factory performance

Factory Manager

  • Review priced and pending batches
  • Manage batch pricing
  • Track factory revenue
  • Compare batch-level analytics
View interface
03
Multi-factory view

General Manager

  • See consolidated factory status
  • Compare revenue contribution
  • Identify top batches and factories
  • Review organization-wide charts
View interface
MOBILE COMPANION

Live batch context travels with the factory officer.

The mobile interface keeps active batches, latest readings and sensor trends visible away from the desktop command centre.

Spectra Leaf mobile dashboard in dark modeSpectra Leaf mobile dashboard in light mode
Field-ready monitoring
11Testing + CI/CD

Statuses are editable project markers, not claimed pass rates. The test strategy spans delivery, security, cloud parity and edge resilience.

TEST SUITE / 01Implemented

CI/CD

The following work areas define the validation scope for this layer.

GitHub ActionsEditable status
Automatic checks on pushEditable status
AWS Amplify hosting pathEditable status
Main branch deploymentEditable status
13Future roadmap

Every card below is a future objective, not a current deployment claim.

FUTURE OBJECTIVES
01

Larger factory pilot

SYSTEM SCALE
02

Sensor calibration refinement

SYSTEM SCALE
03

Multi-trough deployment

SYSTEM SCALE
04

Advanced analytics

INTELLIGENCE
05

Machine-learning model training

INTELLIGENCE
06

Automated sweet-spot alerts

INTELLIGENCE
07

Predictive batch comparison

DEPLOYMENT
08

Commercial deployment

DEPLOYMENT
14Team and supervision

The student team develops the connected system with academic supervision and Crop Science guidance grounded in tea processing and quality evaluation.

01
Nadeera Kothalawala, Role pending team confirmation
E/21/226

Nadeera Kothalawala

Role pending team confirmation

Member of the multidisciplinary student team developing the Spectra Leaf fermentation system.

02
Lahiru Dinushan, Role pending team confirmation
E/21/049

Lahiru Dinushan

Role pending team confirmation

Member of the multidisciplinary student team developing the Spectra Leaf fermentation system.

03
Rangana Madhushanka, Role pending team confirmation
E/21/200

Rangana Madhushanka

Role pending team confirmation

Member of the multidisciplinary student team developing the Spectra Leaf fermentation system.

04
Deshan Dinidu, Role pending team confirmation
E/21/054

Deshan Dinidu

Role pending team confirmation

Member of the multidisciplinary student team developing the Spectra Leaf fermentation system.

Academic and domain guidance

Academic supervision

Crop Science and Computer Engineering supervision connect tea-process knowledge with sensing, software, data validation and delivery.

Academic SupervisorS01
Ms. Yasodha Vimukthi
Department of Computer Engineering

Ms. Yasodha Vimukthi

Project Supervisor · Lecturer (Probationary)

Provides project supervision across software architecture, machine learning, data validation and platform delivery.

Academic SupervisorS02
Dr. Isuru Nawinne
Department of Computer Engineering

Dr. Isuru Nawinne

Project Supervisor · Senior Lecturer

Provides systems-engineering guidance across embedded systems, industrial automation, technical validation and project delivery.

Domain supervisionD01
Prof. H.M.G.S.B. Hitinayake
Department of Crop Science · Faculty of Agriculture

Prof. H.M.G.S.B. Hitinayake

Professor · Crop Science Advisor

Advises the project on tea-plantation context, crop-science considerations and the interpretation of process observations alongside factory quality evaluation.

CLOSING SIGNAL

Measure the process.
Understand the profile.
Perfect the leaf.

Spectra Leaf bridges traditional tea-manufacturing expertise with modern digital infrastructure. The current platform improves fermentation visibility through synchronized sensor telemetry and remote factory guidance. Every monitored batch also contributes to a structured quality dataset, the foundation for future automated detection of the fermentation sweet spot.

Explore the repository