https://github.com/desifish/epaper-display-ntp-clock
E-Paper Display based efficient NTP Clock
https://github.com/desifish/epaper-display-ntp-clock
32650 arduino arduino-ide bh1750 bms clock ds3231 e-paper e-paperdisplay esp32 lifepo4 lifepo4-battery ntp smart-clock temperature-sensor tp5000 usbc waveshare-epaper xiao-esp32-c3 xiao-esp32c6
Last synced: 3 months ago
JSON representation
E-Paper Display based efficient NTP Clock
- Host: GitHub
- URL: https://github.com/desifish/epaper-display-ntp-clock
- Owner: desiFish
- License: gpl-3.0
- Created: 2024-06-07T07:11:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-05T13:47:09.000Z (3 months ago)
- Last Synced: 2025-04-05T14:22:38.503Z (3 months ago)
- Topics: 32650, arduino, arduino-ide, bh1750, bms, clock, ds3231, e-paper, e-paperdisplay, esp32, lifepo4, lifepo4-battery, ntp, smart-clock, temperature-sensor, tp5000, usbc, waveshare-epaper, xiao-esp32-c3, xiao-esp32c6
- Language: C++
- Homepage: https://iotthings.pythonanywhere.com/
- Size: 22.1 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> ๐จ **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 ๐
```mermaid
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]
```## ๐ Quick Start ๐ฏ
Prerequisites
```yaml
Required Libraries:
- Check header section inside .ino file
- OEM Display Libraries (Included in src)
```Installation Steps
1. Clone repository
2. Configure WiFi:
```cpp
const char *ssid = "Your_SSID";
const char *password = "Your_PASSWORD";
```
3. Update pins in `src/epdif.h`
4. 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](https://randomnerdtutorials.com/esp32-wake-up-deep-sleep-external-alarms-ds3231/) - Basic RTC alarm setup
2. [XIAO ESP32C6 Deep Sleep Guide](https://wiki.seeedstudio.com/xiao_esp32c6_getting_started/#demo1-deep-sleep-with-external-wake-up) - ESP32-C6 specific wake-up configuration
3. [ESP32 External Wake-Up Implementation](https://randomnerdtutorials.com/esp32-external-wake-up-deep-sleep/) - 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](/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