Table of Contents

Pocket Meteo Logger

Name: Duca Andrei-Rares
Group: 331CA

Introduction

Pocket Meteo Logger (PML) is a hand-held, battery-powered micro-station that continuously measures local weather and air-quality parameters – temperature, relative humidity, barometric pressure, equivalent VOC / CO₂ level and particulate-matter concentration.

The device offers three core services:

  • Live feedback – numeric values, trend arrows and status icons are displayed on a 0.96″ OLED screen, offering instant readings without needing a phone or laptop.
  • Context-aware alerts – a tiny buzzer and two RGB status LEDs signal critical changes in air quality or environmental conditions.
  • Long-term logging – every minute, fresh samples are time-stamped; the data are either cached to a micro-SD card (offline trips) or, when Wi-Fi is available, pushed to a Google Sheets cloud spreadsheet for later analysis.

The project started from hiking and cycling needs: a reliable field barometer, an AQI indicator and a silent logger that do not depend on a phone’s battery. Because PML is fully open-source, hikers, air-quality hobbyists or students can reuse both hardware and firmware to build their own variants — adding extra sensors, changing alert rules or integrating it into larger IoT systems.

Powered by a single Li-Po cell, PML fits in a shirt pocket, survives multiple days on one charge and re-charges via USB. Three tactile buttons let the user browse current values and the last-hour history directly on the OLED display, without any external device.

General Description

Pocket Meteo Logger is designed as a compact, battery-powered weather station you can carry anywhere. It wakes up every minute, collects environmental data from onboard sensors, displays the results on a tiny OLED screen, stores the readings locally or uploads them online — and then quietly returns to sleep to preserve energy.
The system is built from a clear split of hardware modules (sensors, display, storage, alerts) and software components (data collection, user interface, alerts, power handling), each focused on a specific role. Together, they create a responsive, energy-efficient logger that offers both real-time monitoring and offline browsing, with minimal user interaction.

Hardware modules

Module Role
ESP32 Dev Board Main microcontroller with built-in Wi-Fi; handles all processing, sensor communication, sleep logic, and cloud sync
BME680 combo-sensor All-in-one sensor for temperature, humidity, pressure, and air quality (VOC) via I²C
0.96″ OLED Display Ultra-low-power screen for showing live values and recent history even when asleep
MicroSD Card Slot Used for saving CSV logs when Wi-Fi is unavailable or as offline backup
Buzzer & RGB LED Provide alert sounds and color-coded warnings for high pollution or temperature levels
Tactile Buttons Allow user to navigate data, view logs, or set alert thresholds
Power System Includes Li-Po battery, USB-C charging via MCP73832, and voltage regulators for sensors

Software modules

Module Role
Sensor Drivers Low-level communication with sensors (I²C and UART), returning calibrated readings
Sampling Scheduler Wakes up the device once per minute and starts the data collection sequence
Data Logger Stores samples locally (CSV on SD) or sends them to Google Sheets via HTTPS when Wi-Fi is present
Alert Engine Monitors values and triggers buzzer/LED alerts when readings exceed set thresholds
Display Manager Handles screen updates, rendering current values and past samples efficiently
UI Handler Reads and debounces button presses; manages menu navigation and selection via a state machine
Power Manager Controls sleep/wake transitions, turns off unused peripherals to save battery

How they interact

Block diagram:

Hardware Design

Component List:

Pin Usage

1. Power Supply and Voltage Stabilization

LiPo Battery (3.7V, 500mAh) → 3.3V Voltage Regulator Module

3.3V Voltage Regulator Module → ESP32

2. BME680 Sensor

3. OLED Display

4. MicroSD Module

5. Alert LEDs

6. Buzzer for Sound Alerts

7. Touch Buttons (for Navigation)

8. TP4056 Charging Module for LiPo Battery

9. 5V Boost Converter (for OLED and Sensor)

10. Breadboard and Connection Wires

Ensure all components are correctly connected and logically arranged on the breadboard:

Images

Simulation Results

The validation of the Pocket Meteo Logger system was performed using both the Serial Monitor (debug interface) and the physical feedback from the hardware components.

The system was verified successfully in both modes: local display and cloud logging.

Through the Serial Monitor (USB connection to laptop), the following were observed:

On the physical device:

Software Design

Software Status

Library Choices and Motivation

Library Purpose
Adafruit_BME680 Simplifies interaction with the BME680 sensor via I²C and handles calibration logic internally.
Adafruit_GFX + Adafruit_SSD1306 Used to control the 0.96″ OLED display, providing graphics primitives and text rendering.
WiFi.h Built-in ESP32 library for managing Wi-Fi connections.
HTTPClient.h Enables HTTP POST operations for pushing data to Google Sheets.
FS.h, SD.h Handle SD card file operations (read, write, append) using the SPI interface.
Wire.h, SPI.h Standard I²C and SPI communication support for sensor and storage modules.

Innovation and Novelty

The Pocket Meteo Logger stands out by combining low-power environmental sensing with dual-mode data access — both local and cloud-based — in a fully self-contained, portable system. Unlike typical sensor boards that require tethering to a computer or smartphone, this project offers:

This design encourages users to rely on the device independently during field trips, while still benefiting from remote data access when returning to Wi-Fi zones. The blend of real-time display, onboard storage, and opportunistic cloud sync makes the project unique and practical.

Project Architecture

The project is structured into distinct software modules, each responsible for a critical task, and they interact based on a precise, low-power runtime cycle. Below is a summary of how these modules cooperate within the firmware:

1. Initialization Phase (“setup()”):

2. Main Execution Loop (“loop()”):

3. Module Interaction:

Module Triggered By Output / Action
“tryConnectWiFi()” Called regularly in loop Attempts to connect to Wi-Fi every 4 minutes. Updates connection state.
“performReading()” Timer (every 30s) Collects fresh values from the sensor.
“sendDataToGoogleSheets()” Only if Wi-Fi is active Sends reading to Google Sheets via HTTP POST.
“appendToSD()” After every reading Saves current reading as a new line in data.txt.
“display.printf()” After reading or history nav Displays current or historical reading on the OLED.
Buzzer & LEDs After threshold check Triggers audio/visual alerts if needed.

4. Power and Efficiency:

Sensor Calibration

To ensure accurate, stable, and energy-efficient measurements, the firmware performs several calibration-related operations for both sensor input and user interaction:

BME680 Sensor Calibration

The BME680 sensor includes internal calibration for temperature, humidity, and pressure. However, certain steps were taken to further ensure reliable operation:

The sensor uses factory calibration coefficients. No external adjustments were needed.

Oversampling was set to `8x` for temperature and `4x` for pressure to improve accuracy while maintaining power efficiency.

The sensor was allowed to stabilize for several seconds after boot to avoid inaccurate early readings.

Oversampling set to `2x` provides a good tradeoff between noise reduction and sampling speed.

A burn-in phase was performed during initial power-on (~5–10 minutes) to let the sensor reach a stable baseline.

Gas heater settings were chosen as `320°C for 150 ms`, a commonly recommended configuration for general air quality monitoring.

Calculated using the barometric formula and a reference sea-level pressure of `1013.25 hPa`.

For local deployments, this value can be adjusted manually in code.

The sensor’s internal IIR filter was set to `Size 3` to smooth out short-term fluctuations and reduce noise in the readings.

All readings were validated by comparing output with a trusted online weather API and a commercial indoor weather station.

Button Input Calibration (Debouncing)

To ensure smooth and responsive interaction via physical buttons, software debouncing was implemented:

Debouncing is critical to avoid interpreting a single button press as multiple inputs, which could break navigation logic or mode switching.

Display Validation

The OLED display refreshes every 30 seconds in live mode and immediately when browsing the history. To ensure clarity:

Optimizations and Lab Feature Justification

Throughout the development of Pocket Meteo Logger, several optimizations were implemented to improve responsiveness, memory usage, and energy efficiency. These were guided by embedded systems best practices and reinforced by concepts learned in lab sessions.

Code-Level Optimizations

The firmware was split into logical modules (WiFi handler, sensor reader, display manager, SD logger), making the code more maintainable and easier to debug or extend.

Except for sensor reads and OLED refresh, the code avoids long blocking delays. Delays used for debouncing are minimal and only applied when user input is detected.

Instead of using String concatenation heavily, “String.printf()” and pre-sized buffers were used to format sensor values efficiently for display and storage.

OLED is only refreshed when values change (every 30 seconds in live mode or on navigation input in history mode). This reduces I²C bus traffic and extends display lifespan.

Hardware-Level Optimizations

The OLED and BME680 were chosen specifically for their ultra-low power consumption in idle/sleep modes.

Buttons were configured with “INPUT_PULLUP”, reducing the need for external components and avoiding floating states.

The codebase is already structured in a way that allows integration of ESP32’s deep sleep, where wake-up would occur either on timer or button press — this was not finalized for Milestone 3, but planned for future work.

Lab Concept Usage Justification

Used to interface both the BME680 sensor and the OLED display, showcasing mastery of multi-device I²C bus sharing.

Utilized for microSD storage access, demonstrating correct SPI peripheral configuration and file system interaction using the FS and SD libraries.

Buttons were read via GPIO with debouncing logic, inspired by interrupt handling labs.

The user interface (UI handler) is implemented as a state machine with transitions between live mode and history browsing — similar to the FSM examples studied during labs.

These design decisions allowed the device to remain responsive, accurate, and power-aware while maintaining a clean software architecture and lab-aligned implementation.

Demo Video

The video shows:

Conclusions

The Pocket Meteo Logger proved to be a successful and rewarding project that combined both hardware and software components into a functional and reliable embedded system. It managed to accurately read environmental data such as temperature, humidity, pressure, and air quality, display live values on the OLED screen, store logs on a microSD card, and upload measurements to Google Sheets when Wi-Fi was available. The logic for alerts and user interaction through buttons worked as intended, making the device easy to use and responsive even in offline mode.

I really enjoyed working on this project, especially solving real-world problems like limited power, network instability, and sensor calibration. It helped me better understand the challenges of embedded system development and gave me confidence to explore more advanced IoT applications in the future.

Download

GitHub Page

Bibliography/ Resources