/iot-sourdough-starter-monitor

Tracking the fermentation of sourdough starter over the cloud.

Primary LanguageC++GNU General Public License v3.0GPL-3.0

IoT Sourdough Starter Monitor

Internet connected smart lid for sourdough starter. Tracks fermentation with distance, temperature, and humidity sensors, and publishes data to the cloud for further data logging and analysis.

Interested in more details? Read the full story on justinmklam.com!


Sourdough starter monitor (left), web application to view the logged data (right).


Three modes of operation: Max rise and time, graph, stats for nerds.


Selecting, viewing, and downloading data for a given feeding session.

Hardware

  • NodeMCU ESP8266 (aka NodeMCU 1.0 ESP-12E)
  • DHT22 Temperature and humidity sensor
  • VL6180X Time of flight distance sensor
  • SSD1306 Monochrome 128x32 I2C OLED display


3D printed enclosure (designed in Fusion 360).


PCB schematic and layout (designed in KiCad).


Assembled PCB.

Software

AWS is used as the cloud backend. Data flow is as follows:

  • ESP8266 sends sensor data over MQTT
  • Kinesis Firehose receives data
  • Lambda function puts data from Firehose to S3 on data receive event
  • Web app queries S3 data via Athena

Getting Started

PlatformIO

This project is built using PlatformIO v5.1.0. To build:

# Build
pio run

# Build and upload
pio run -t upload

To view the serial monitor:

pio device monitor -b 115200

To run the tests:

# Run tests on device
pio test

# Run tests locally
pio test -e native

Heroku

To deploy the web app to Heroku:

git subtree push --prefix webapp heroku master

AWS IoT Certificates

Convert the certificates from AWS to .der files, then place them in data/ (within the project directory).

openssl x509 -in xxx-certificate.pem.crt -out cert.der -outform DER
openssl rsa -in xxx-private.pem.key -out private.der -outform DER
openssl x509 -in AmazonRootCA1.pem -out ca.der -outform DER

Use the following command to upload the files to the SPIFFS filesystem:

pio run -t uploadfs

Alternatively, you may use the arduino-esp8266fs-plugin to upload the files.