กลับไปหน้ารวมไฟล์
temp-and-humidity-monitor-with-graphs-and-battery-monitor-cd011a-en.md

This project is a high-performance evolution of environmental sensing. It captures temperature and humidity data, maintains a 24-hour rotating history, and visualizes the results as live graphs on a crystal-clear OLED screen—all while monitoring its own power levels to prevent data loss due to battery failure.

Environmental Data Logging & Memory Optimization Overview

The OLED Graphing Monitor is a masterclass in Embedded Resource Management. Storing 24 hours of data (96 samples at 15-minute intervals) would quickly consume the limited RAM of an Arduino Pro Mini. This project demonstrates how to use the EEPROM (Electrically Erasable Programmable Read-Only Memory) as a "Circular Buffer" to store historical data without using up execution memory, ensuring the system remains stable over days and weeks of operation.

Hardware Infrastructure & The Analytical Tier

  • Arduino Pro Mini (3.3V/8MHz): The ultra-compact brain. The 3.3V version is used to match the native voltage of the OLED and the LiPo battery, eliminating the need for power-wasting voltage regulators.
  • DHT11 Sensor: Provides the primary environmental telemetry. It is polled every 15 minutes to generate the history data and every 2 seconds for the "Real-Time" dashboard.
  • SSD1306 OLED (128x64): The high-resolution interface. It displays current values, Min/Max records, and the graphical history views.
  • TP4056 Charger & LiPo Battery: Provides a portable, rechargeable power source. A 1000mAh battery allows the system to remain untethered for extended periods.
  • Internal Voltage Divider: Using 1M and 330k resistors, the system monitors its own battery level. Since the Arduino's INTERNAL reference is 1.1V, the divider brings the 4.2V battery signal down to a safe, readable range.

Technological Logic and The Graphing Engine

The softare logic balances high-frequency interaction with long-term storage:

  1. The Circular EEPROM Buffer: To save RAM, temperature and humidity values are stored directly into the EEPROM. A pointer histPointer keeps track of the "current" slot (0-95), overwriting the oldest data exactly every 24 hours.
  2. The Graphing Scalar: To draw a graph on a 64-pixel high screen, the code finds the Lowest and Highest values in the 24-hour history. It then "Maps" those values so the graph always fits the screen perfectly, regardless of whether the temperature range is small or large.
  3. Power Management vs Precision: Standard Sleep modes stop the internal timers, making it hard to track 15-minute intervals accurately. This project keeps the processor awake but implements a Screensaver Mode—dimming or moving the display content to prevent OLED "Burn-in" and reduce power consumption.
  4. The Screen Hierarchy: Using tactile switches, the user can cycle through four distinct views: Real-time Data, Temperature Graph, Humidity Graph, and Power Status.

Why This Project is Important

Mastering data logging and visualization is essential for Scientific Instrumentation. It teaches you how to turn raw numbers into meaningful trends. By implementing EEPROM Storage and Automatic Scaling, you build a device that is more than just a sensor; it is a professional logger capable of surviving power cycles and providing actionable insights into the environment of your home, lab, or garden.

ข้อมูล Frontmatter ดั้งเดิม

title: "Temp and Humidity Monitor with Graphs and Battery Monitor"
description: "Engineer an advanced environmental monitoring system that logs 24 hours of sensor data, generates real-time graphs on an OLED display, and manages battery longevity."
author: "paulsb"
category: "Sensors & Environment"
tags:
  - "Environmental Monitoring"
  - "Data Logging"
  - "OLED"
  - "EEPROM"
  - "Sensors"
views: 0
likes: 17048
price: 299
difficulty: "Hard"
components:
  - "1x Arduino Pro Mini 328 - 3.3V/8MHz"
  - "1x DHT11 Temperature Humidity Sensor Module"
  - "1x AZDelivery I2C 0.96-inch OLED Display SSD1306"
  - "1x 3.7V 1000mAh Lithium Rechargeable Battery"
  - "1x TP4056 Lipo Charger Module"
  - "2x Tactile Switch"
  - "1x 1M ohm Resistor"
  - "1x 330k ohm Resistor"
  - "1x Hook Up wire"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles: []
documentationLinks: []
passwordHash: "4421d6c99848e9a1c76fbed87d2169b51a13134f589afec91191c23342f07074"
encryptedPayload: "U2FsdGVkX18wBpNEgj0QhVmnxMFKi0G0qPvTGYQnPAL8TUOey85N7A4r3vHDk6NhUlkLULuDit7dxYHd7NTnNiYserCwbR0NcCEgOCwZSE4="
seoDescription: "Temperature and Humidity Monitor project with 24-hour history, OLED graphs, and advanced battery management for long-term data collection."
videoLinks: []
heroImage: "https://projects.arduinocontent.cc/c147d4fd-16c3-4847-8d3d-c276d598bad7.png"
lang: "en"