Skip to content

Latest commit

 

History

42 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cocoa Monitor — IoT Fermentation & Drying System

A complete, simplified IoT monitoring system for tracking cocoa bean fermentation and drying using ESP8266 and ESP32 microcontrollers.

Overview

Cocoa Monitor logs environmental data and internal fermentation temperatures to a Google Sheet, enabling real-time fermentation tracking across multiple sensor nodes.

Fermentation Phase

  • TEMP Node: Bean mass temperature profile (3× DS18B20 probes)

Drying Phase

  • GREENHOUSE Node: Inside drying environment (DHT11)
  • OUTSIDE Node: Outside reference environment (DHT11)

All nodes upload to a single Google Sheet via a shared Google Apps Script backend.


Quick Start

Hardware

  • 3× ESP32 Dev Boards
  • 3× DS18B20 temperature probes (TEMP)
  • 2× DHT11 sensors (GREENHOUSE, OUTSIDE)
  • WiFi network (SSID: xxxxxxxxxxxxx)

Installation

  1. Flash firmware from /firmware to each board (see guide)
  2. Deploy Apps Script from /apps-script to Google Apps Script
  3. Verify uploads within 5–10 minutes (data appears in Google Sheet)

See docs/COCOA_MONITOR_SIMPLIFIED_GUIDE.md for complete setup instructions.


File Structure

cocoa-monitor/
├── firmware/                      # Arduino sketches (ready to flash)
│   ├── TEMP_DS18B20x3.ino         # NodeMCU ESP8266 (fermentation temps)
│   ├── GREENHOUSE_DHT11.ino       # ESP32 (inside greenhouse)
│   └── OUTSIDE_DHT11.ino          # ESP32 (outside environment)
├── apps-script/
│   └── AppScript_Simplified.gs    # Google Apps Script backend
├── docs/
│   └── COCOA_MONITOR_SIMPLIFIED_GUIDE.md  # Complete installation guide
└── README.md                      # This file

Key Features

4 Independent Nodes — Fermentation environment + temps + drying (indoor/outdoor)
Real-Time Logging — Automatic uploads every 5–30 minutes
NTP Time Sync — Accurate UTC-4 (Trinidad) timestamps
Error Handling — WiFi reconnection, sensor fault detection, fallback timestamps
Simplified Code — All bloat removed, lean & focused


System Architecture

Internet
   ▲
   │ HTTPS GET (Apps Script)
   │
┌──────────────────────────────┐
│   Google Sheets              │
│  (3 worksheets)              │
│  • TEMPERATURE               │
│  • GREENHOUSE                │
│  • OUTSIDE                   │
└──────────────────────────────┘
     ▲         ▲         ▲
     │         │         │
   [TEMP]    [GHSE]    [OUTSIDE]
  DS18B20x3  DHT11     DHT11
  ESP32   ESP32     ESP32

Configuration

All nodes share the same WiFi and Apps Script URL:

WiFi SSID:       your info
WiFi Password:   your info
Timezone:        UTC-4 (Trinidad)
Apps Script URL: https://script.google.com/macros/s/your info/exec

Modify in each sketch before flashing.


Google Sheet Details

Sheet ID: your info

Worksheets created automatically:

  • TEMPERATURE — Timestamp, T1_Top_C, T2_Middle_C, T3_Bottom_C, Average_C
  • GREENHOUSE — Timestamp, Temp_C, Humidity_%
  • OUTSIDE — Timestamp, Temp_C, Humidity_%

Troubleshooting

Device won't connect to WiFi

  • Verify SSID and password match in sketch
  • Check WiFi range and signal strength

DS18B20 reads -127°C

  • Verify 4.7kΩ pull-up resistor between D2 and 3.3V
  • Run address-scan sketch to get probe hex addresses
  • Paste correct addresses into TEMP_DS18B20x3.ino

Data not appearing in Google Sheet

  • Check serial monitor (115200 baud) for HTTP error codes
  • Verify Apps Script URL is correct
  • Ensure NTP time sync completes (wait 30 sec after boot)

Apps Script errors

  • Do NOT create a new deployment after edits — edit in place
  • Use "Manage Deployments" to refresh the existing URL
  • Check Apps Script Execution Log for debug messages

See docs/COCOA_MONITOR_SIMPLIFIED_GUIDE.md for more troubleshooting.


Upload Intervals

Node Interval Purpose
TEMP 60 min Fermentation heat curve
GREENHOUSE 60 min Drying progress (indoor)
OUTSIDE 60 min Drying reference (outdoor)

Libraries Required

For ESP32 (GREENHOUSE, OUTSIDE):

  • WiFi (built-in)
  • HTTPClient (built-in)
  • DHT sensor library by Adafruit

Install via Arduino IDE Sketch → Include Library → Manage Libraries.


Next Steps

  1. Read the guidedocs/COCOA_MONITOR_SIMPLIFIED_GUIDE.md
  2. Flash firmware to your 3 boards
  3. Deploy Apps Script to Google Apps Script
  4. Monitor uploads via serial monitor (115200 baud)
  5. Create charts in Google Sheets to visualize fermentation data

License

MIT License — see LICENSE file for details.


Notes

  • Remove test code before deployment — ensure READ_INTERVAL and UPLOAD_INTERVAL are production values
  • Backup your Google Sheet — no version control, edits are permanent
  • Check sensor baselines — DS18B20 probes are ±0.5°C accurate; no calibration needed

Last Updated: July 2026
Version: 1.0 (Simplified)


For questions or issues, refer to the complete guide in docs/.

About

Simplified IoT fermentation & drying monitoring system

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages