Skip to content

desiFish/EPaper-Display-NTP-Clock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

81 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 Minimalistic E-Paper NTP-RTC Clock πŸ•’

Status License GitHub Issues Release

🚨 IMPORTANT: Please read the [Notes & Warnings] section carefully before proceeding with this project. It contains crucial safety information about battery configuration, charging, and sensor placement.

🎯 System Specifications
πŸ–₯️ Core Components
🧠 Microcontroller Xiao ESP32 C6 (Compatible with most ESP32 boards)
πŸ“Ί Display Waveshare 3.52" BiColor (Black and White) E-paper (360x240)
πŸ”‹ Power Source LiFePO4 6000mAh 3.2V
⚑ Power Specifications
Operating Voltage ~3.2V
Sleep Duration ~60 seconds
Battery Thresholds πŸ“ˆ High: 3.4V
πŸ“‰ Low: 2.9V
πŸ”Œ Communication
I2C Speed 400kHz (Fast Mode)
NTP Server asia.pool.ntp.org
Time Offset 19800 (India, UTC+5:30)

πŸ› οΈ Hardware Components πŸ”© Parts List

Component Specifications Details

Xiao ESP32 C6
β€’ MCU: ESP32-C6 RISC-V
β€’ Clock: 160MHz
β€’ RAM: 512KB SRAM
β€’ Flash: 4MB
β€’ WiFi: 2.4GHz (WiFi6)
β€’ Bluetooth: BLE 5.0
β€’ Size: 21x17.8mm
β€’ Deep Sleep: ~16Β΅A (when powered via BAT pins)
Note: Deep sleep current specified when battery connected to BAT pins

Waveshare 3.52" E-Paper
β€’ Resolution: 360x240
β€’ Colors: BiColor
β€’ Refresh: 1.5 secs
Display unit with low power consumption

BH1750
β€’ I2C Address: 0x23
β€’ Mode: ONE_TIME_HIGH_RES
β€’ Precision: 1-65535 lux
Ambient light sensor for night mode

DS3231
β€’ Accuracy: Β±2ppm
β€’ Temperature comp.
β€’ Battery backup
Real-time clock for timekeeping

IFR32650 LiFePO4
β€’ Model: IFR32650
β€’ Capacity: 6000mAh
β€’ Voltage: 3.2V nominal
β€’ Chemistry: LiFePO4
β€’ Cycle Life: >2000 cycles
β€’ Size: 32x65mm
β€’ Max Discharge: 2C
β€’ Temperature Range: -20Β°C to 60Β°C
β€’ Self-discharge: 3% per month
High-capacity, safe chemistry battery with long cycle life and stable voltage output

TP5000
β€’ Input: 5V USB
β€’ Output: 3.2V
β€’ Current: Up to 2A
Battery charging module

USB-C Breakout
β€’ USB 2.0 Compatible
β€’ 5V Input
β€’ Data lines available
Power input and debugging interface

πŸ’« Key Features ✨

⚑️
Power Efficient
πŸŒ™
Night Mode
πŸ”„
Auto Update
πŸ“Š
Battery Monitor
~60s Deep Sleep Light Sensor Based Periodic NTP Sync Voltage Tracking

πŸ“ˆ System Architecture πŸ”„

graph TD
    A[Wake Up] --> B{Check Light}
    B -->|Dark| C[Sleep Mode]
    B -->|Light| D[Update Display]
    D --> E{Battery OK?}
    E -->|Yes| F[Update Time]
    F --> G[Update Display]
    G --> H[Deep Sleep]
Loading

πŸš€ Quick Start 🎯

Prerequisites
Required Libraries:
  - Check header section inside .ino file
  - OEM Display Libraries (Included in src)
Installation Steps
  1. Clone repository
  2. Configure WiFi:
const char *ssid = "Your_SSID";
const char *password = "Your_PASSWORD";
  1. Update pins in src/epdif.h
  2. Upload code

πŸ”‹ Battery Performance ⚑

πŸ“Š Battery Life Analysis - Test #1 (With ESP32 C3)
Start Date End Date Runtime Status
June 6, 2024 November 1, 2024 4 months 27 days βœ… Completed
Performance Metrics
πŸ”‹ Initial Voltage: 3.6V
πŸ“‰ Final Voltage: ~2.84V
🌑️ Temperature Range: 17-38°C

πŸ“Š Battery Life Analysis - Test #2 (With ESP32 C3)
Start Date End Date Runtime Status
November 1, 2024 April 2, 2025 5 months 2 days βœ… Completed
Performance Metrics
πŸ”‹ Initial Voltage: 3.6V
πŸ“‰ Final Voltage: 2.79V
🌑️ Temperature Range: 15-36°C

πŸ“Š Battery Life Analysis - Test #1 (With ESP32 C6)
Start Date End Date Runtime Status
April 6, 2025 TBD TBD TBD
Performance Metrics
πŸ”‹ Initial Voltage: 3.54V
πŸ“‰ Final Voltage: TBD
🌑️ Temperature Range: TBD

πŸ“Έ Gallery πŸ–ΌοΈ


Front 1

Side 1

Back

Front 2

Inside 1

Inside 2

New UI

ESP32 C3 & C6

New Sleep UI

Inside 4

Inside 5

Inside 6

βš™οΈ Development πŸ”§

Build Requirements
  • πŸ’» Arduino IDE 2.3.x or newer (tested)
  • πŸ“¦ ESP32 Board Support Package
  • πŸ”§ USB-C cable for programming
  • πŸ“š Required libraries (see Prerequisites)
Debug Tips
  • πŸ” Serial Monitor: 115200 baud
  • πŸ“Š Test points available for voltage monitoring (just lift the cover)

🌐 Connectivity πŸ“‘

  • πŸ“‘ WiFi6 2.4GHz
  • πŸ•’ NTP synchronization
  • πŸ’€ Auto sleep when dark

πŸŒ™ Deep Sleep Implementation with DS3231 RTC

⚠️ Important Note: No single source provided a complete working solution for deep sleep with DS3231 RTC. This implementation combines key elements from multiple references to create a reliable solution.

The project implements an efficient deep sleep mode using the DS3231 RTC's external alarm feature. This approach significantly reduces power consumption while maintaining accurate timekeeping.

How it Works

  1. The DS3231 RTC SQW pin is connected to GPIO7 (MTDO) (RTC GPIO)
  2. The RTC alarm triggers a signal on the SQW pin
  3. ESP32-C6 wakes up from deep sleep on the falling edge

Key Implementation Points

  • Wake-up Source: esp_sleep_enable_ext0_wakeup(GPIO_NUM_7, 0)
  • Wake Up Interval: 60 seconds (configurable)
  • Current Consumption: ~16Β΅A in deep sleep (for XIAO ESP32C6 only)

References

These sources were combined to create a working implementation:

  1. ESP32 Wake-Up Using DS3231 RTC - Basic RTC alarm setup
  2. XIAO ESP32C6 Deep Sleep Guide - ESP32-C6 specific wake-up configuration
  3. ESP32 External Wake-Up Implementation - External wake-up pin handling

⚠️ Important Notes & Warnings 🚨

πŸ”„ DS3231 Battery Safety ⚑


Most DS3231 modules are sold with CR2032 or similar cells which are not rechargeable. If you are using a non-rechargeable cell then **REMOVE** either the resistor or the diode marked in the above image.

πŸ”Œ TP5000 Charging Configuration ⚑


There are some misinformation over internet regarding the charging mode of TP5000. If you are going to use LiFePO4 cell with TP5000 then **DO NOT** short the above marked area with caption F.

πŸ”‹ Battery Configuration Safety πŸ›‘οΈ

Power Management Considerations

  • ⚑ Current Draw: This project's extremely low current consumption (well below rated cell capacity) makes the cell configuration safer
  • πŸ›‘οΈ Protection: Always use proper BMS protection for your cells
  • πŸ“ BMS Setup: Due to limited 1S LiFePO4 BMS availability:
    • Using 4.2V BMS for 2.5V cutoff protection (Low Discharge Cutoff)
    • TP5000 connected directly to the cell for proper 3.6V charging
    • This is a temporary solution until better 1S LFP BMS options become available

USB Charging Safety

  • ⚑ USB Connection Warning: Disconnect battery when connecting USB to ESP32C6 (Use a switch to cutt-off battery)
    • XIAO modules are designed for LiPo/Li-ion batteries (4.2V charging)
    • Not compatible with LFP battery charging (3.6V required)
    • Connect USB-C module output to TP5000 input
    • Detailed schematics will be provided later
    • Simple setup despite complex explanation

Voltage Compatibility

  • βœ… Operating Range:
    • All components work perfectly with LFP's lower voltage
    • Tested operational down to 2.8V
    • No impact on battery life or performance
    • LFP cells maintain stable 3.2V for extended periods
    • 6+ months of testing
    • Components designed for wide voltage range operation

Enclosure Design

  • πŸ’¨ Ventilation Requirements:
    • Proper air vents are crucial
    • Ensures accurate sensor readings
    • Prevents heat buildup

⚠️ Please consider these points carefully before replicating this setup. Battery safety is crucial!


πŸ“œ License πŸ“ƒ

GNU General Public License v3.0

This project is licensed under the GNU GPL v3.0 - see below for details:

  • βœ… Commercial use
  • βœ… Modification
  • βœ… Distribution
  • βœ… Patent use
  • βœ… Private use

Limitations

  • ⚠️ Liability
  • ⚠️ Warranty
  • ℹ️ License and copyright notice required
  • ℹ️ State changes
  • ℹ️ Disclose source
  • ℹ️ Same license

Read full license

🀝 Contributing πŸ‘₯

We welcome contributions! Here's how you can help:

  1. πŸ” Fork the repository
  2. 🌿 Create your feature branch (git checkout -b feature/AmazingFeature)
  3. πŸ’Ύ Commit your changes (git commit -m 'Add some AmazingFeature')
  4. πŸš€ Push to the branch (git push origin feature/AmazingFeature)
  5. πŸ“ Open a Pull Request

Pull Request Guidelines

  • βœ… Clear description of changes
  • βœ… Test your changes thoroughly
  • βœ… Update documentation if needed
  • βœ… Follow existing code style
  • βœ… Add comments where necessary

Made with ❀️ and ♻️ materials by 🌍 Earth-conscious developer