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

Make tea oxidation visible, repeatable and ready to learn from.

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
03Complete product film

From leaf to intelligence.

Follow the complete Spectra Leaf journey from fermentation sensing to connected, operator-ready insight.

FilmComplete storyDuration30 secondsPlaybackScroll controlled
  1. 01
    OBSERVERead the fermentation process.

    Temperature, gas and colour become a live picture of the changing tea leaf.

  2. 02
    CONNECTCarry every signal forward.

    ESP32 telemetry moves securely from the production floor into the cloud.

  3. 03
    DECIDETurn process data into action.

    The dashboard gives operators timely context for a more consistent batch.

Keep scrolling to move through the film
PRODUCT FILM / COMPLETESCROLL TO START
02Key objectives

A deliberate path from observation to automation.

Four connected capabilities create value now while preparing the system for future intelligence.

01

Digitization

Replace subjective manual monitoring with measurable sensor data.

02

Real-Time Guidance

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

03

Data Harvesting

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

04

Future Automation

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

03Key features

One platform connecting the leaf, the edge and the cloud.

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

CAPABILITY / 01

Six synchronized inputs

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

ONE TIMELINEBATCH LINKED
CAPABILITY / 02

Shared live batch control

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

START + STOPAUTO REFRESH
CAPABILITY / 03

Resilient camera edge

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

ESP32-CAMWI-FI RECONNECT
CAPABILITY / 04

Serverless cloud pipeline

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

DEVICE SHADOWDYNAMODB
CAPABILITY / 05

Role-aware access

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

COGNITOWEB + MOBILE
CAPABILITY / 06

Quality-ready evidence

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

BATCH HISTORYMODEL READY
04Solution architecture

One signal path. Three engineered layers.

The architecture carries context from the fermentation trough to a secure remote interface.

01 / EDGE

Capture at the tea bed

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

TemperatureHumidityVisionMQ137TGS2620TGS822
02 / CLOUD

Synchronize and store

AWS services validate telemetry, preserve batch history and keep the shared fermentation state consistent.

IoT CoreDevice ShadowLambdaAPI GatewayDynamoDB
03 / INTERFACE

Guide the factory team

Authenticated web and mobile interfaces turn the same backend state into role-appropriate controls and insight.

Officer mobileFactory dashboardCognitoLive state
LIVE DATA PATH
MQTT / TLS · REST API · SHARED DEVICE STATE
IMPLEMENTATION REGISTER05 CONNECTED RESPONSIBILITIES
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

Six physical channels read the changing leaf bed.

The device combines temperature, humidity, imaging and three complementary gas-response sensors around an ESP32-CAM edge node.

Spectra Leaf hardware design integrating controller boards, a display, pumps and a sample chamberHARDWARE DESIGN / EDGE NODE 01
MAIN CONTROLLER

ESP32-CAM edge controller

The ESP32-CAM coordinates synchronized sensing, adds OV2640 visual context and publishes batch-linked telemetry over secure Wi-Fi. Device Shadow commands keep the physical node aligned with fermentation sessions.

OV2640 CAMERA2.4 GHz WI-FIMQTT/TLSEDGE CAPTURE
HARDWARE COMPONENTS

One synchronized sensor array, six distinct signals.

Stainless steel DS18B20 temperature probe with a wired 1-Wire connection
DS18B20 / 1-WIRE
CHANNEL 01 / 06DS18B20 / 1-WIRE
LEAF-BED THERMAL

Temperature probe

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

WHY WE USE IT

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
DHT22 digital relative humidity sensor
DHT22 / AM2302
CHANNEL 02 / 06DHT22 / AM2302
CHAMBER CLIMATE

Humidity sensor

A calibrated capacitive channel measures relative humidity around the leaf bed so moisture conditions can be compared across batches.

WHY WE USE IT

Humidity explains how much moisture the surrounding air can still accept, helping the team interpret temperature and gas changes in the correct chamber conditions.

READSRelative humidityOUTPUT%RH · DIGITAL
ESP32-CAM edge module with an OV2640 camera
ESP32-CAM / OV2640
CHANNEL 03 / 06ESP32-CAM / OV2640
VISUAL CONTEXT

Vision edge module

The Wi-Fi camera module captures chamber imagery and coordinates sensor data with the batch and device identity used by the cloud platform.

WHY WE USE IT

Images preserve visual evidence of leaf spread and colour while the ESP32-CAM also provides the connected edge controller in one compact module.

READSLeaf-bed framesOUTPUT2 MP · WI-FI
Winsen MQ137 semiconductor ammonia gas sensor
WINSEN MQ137
CHANNEL 04 / 06WINSEN MQ137
NH₃ / AMINE RESPONSE

Ammonia response sensor

The MQ137 supplies an analog response sensitive to ammonia and organic amines. Spectra Leaf follows its calibrated trend during oxidation.

WHY WE USE IT

Its ammonia and amine sensitivity adds a targeted chemical-response channel that the broader organic-vapor sensors do not provide on their own.

READSNH₃ responseOUTPUTANALOG · ADC
Figaro TGS2620 organic solvent vapor sensor
FIGARO TGS2620
CHANNEL 05 / 06FIGARO TGS2620
ALCOHOL / VOC RESPONSE

Organic-vapor sensor

A low-power metal-oxide channel responds strongly to alcohol and organic solvent vapors, adding a volatile-compound profile to each batch.

WHY WE USE IT

Alcohol and volatile-organic response helps reveal changes in the aroma-producing chemistry that cannot be inferred from temperature and humidity alone.

READSOrganic vaporsOUTPUTANALOG · ADC
Red Figaro TGS822 organic solvent vapor sensor
FIGARO TGS822
CHANNEL 06 / 06FIGARO TGS822
SOLVENT RESPONSE

Solvent-vapor sensor

The TGS822 adds a complementary organic-solvent response, helping the system compare the shape and timing of volatile changes.

WHY WE USE IT

A second broad vapor channel provides a different response pattern, improving comparison and reducing reliance on a single gas-sensor signal.

READSSolvent vaporsOUTPUTANALOG · ADC

Measurement note Gas channels are stored as response signals until chamber calibration maps them to concentration. This avoids presenting raw ADC values as ppm.

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
Spectra Leaf V1.0 custom PCB with labelled ESP32, sensor, display, relay and power connections
Spectra Leaf V1.0 · Team-designed control PCB
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

LIVE EDGE SIMULATIONDEMONSTRATION VALUES
Leaf temperature27.2 °CRelative humidity53.0 %RHMQ137 responseADC 1860TGS2620 responseADC 1672TGS822 responseADC 1548ESP32-CAMFRAME READY
DEVICE STATE RUNNING MQTT CONNECTED
06Cloud infrastructure

A serverless path from the tea bed to every authorized screen.

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.

SECURE REST SURFACE

Dashboard endpoints

POST/api/fermentation/control
GET/api/batches
GET/api/batches/{batchId}/telemetry
POST/api/batches/{batchId}/quality
telemetry.payload.json
{
  "device_id": "SL-EDGE-01",
  "batch_id": "SLF-024",
  "timestamp": "2026-07-24T10:30:00Z",
  "temperature_c": 27.8,
  "gas_response": 342,
  "colour_stage": 0.68,
  "state": "RUNNING"
}
07Software platform

A calm interface for a live industrial process.

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

The system guides today while building evidence for tomorrow.

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

First build the evidence. Then build the model.

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

FUTURE WORK · NOT YET DEPLOYED
MODEL FEATURES
Rate of temperature rise
VOC trend slope
Colour change rate
Elapsed fermentation time
Combined sensor signatures
Historical batch similarity
Good Leaf Percentage labels
FUTURE MODELMulti-sensor time-series classification
POSSIBLE OUTPUTS
Under-fermented
Approaching optimum
Sweet spot reached
Over-fermentation risk
10Role-based platform

One operation. The right view for every decision.

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
Field-ready monitoring
11Testing + CI/CD

Confidence is engineered at every boundary.

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
Security validation scope includes SRP authentication, no plaintext password transmission, JWT authorization, token refresh and intermittent Wi-Fi session handling. Hardware scope includes watchdog behaviour and Device Shadow resynchronization.
13Future roadmap

From a focused prototype to a factory intelligence layer.

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

Engineering meets factory and crop knowledge.

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.

Domain and academic guidance

Domain supervision

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

Crop ScienceD01
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.

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.

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