{"id":24888616,"url":"https://github.com/mikedx/esp32-c3-oled","last_synced_at":"2026-04-09T08:08:58.884Z","repository":{"id":275178953,"uuid":"924790772","full_name":"MikeDX/ESP32-C3-OLED","owner":"MikeDX","description":"🎄 ESP32 Christmas OLED Animation - Festive animations for SSD1306 displays featuring Santa, snowman, weather effects and more! Built with Arduino/PlatformIO","archived":false,"fork":false,"pushed_at":"2025-05-24T23:27:39.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-24T20:38:09.528Z","etag":null,"topics":["animation","arduino","christmas","embedded","esp32","iot","oled","platformio"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MikeDX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-30T16:54:31.000Z","updated_at":"2025-05-25T09:13:44.000Z","dependencies_parsed_at":"2025-01-31T17:46:59.105Z","dependency_job_id":"5f93b984-3473-4a26-b87d-e70e18603154","html_url":"https://github.com/MikeDX/ESP32-C3-OLED","commit_stats":null,"previous_names":["mikedx/esp32-c3-oled"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MikeDX/ESP32-C3-OLED","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeDX%2FESP32-C3-OLED","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeDX%2FESP32-C3-OLED/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeDX%2FESP32-C3-OLED/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeDX%2FESP32-C3-OLED/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MikeDX","download_url":"https://codeload.github.com/MikeDX/ESP32-C3-OLED/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeDX%2FESP32-C3-OLED/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267007612,"owners_count":24020262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animation","arduino","christmas","embedded","esp32","iot","oled","platformio"],"created_at":"2025-02-01T16:14:11.681Z","updated_at":"2026-04-09T08:08:58.851Z","avatar_url":"https://github.com/MikeDX.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP32-C3 Christmas OLED Animation System\n\nA festive, feature-rich Christmas animation project for ESP32 microcontrollers with SSD1306 OLED displays. This project showcases advanced animation techniques, modular code architecture, and professional embedded systems practices.\n\n## ✨ Features\n\n### 🎄 Animation Scenes\n- **Christmas Tree Scene**: Animated twinkling star, decorated tree, moving snowman\n- **Santa's Sleigh**: Flying Santa with reindeer across the screen\n- **Fireplace Scene**: Flickering flames with presents\n- **Weather Display**: Dynamic weather effects with day/night cycle\n\n### 🌨️ Dynamic Effects\n- **Weather System**: Snow, rain, and clear sky with particle effects\n- **Day/Night Cycle**: Automatic sun/moon transitions\n- **Smooth Animations**: Professional easing and interpolation\n- **Particle System**: Efficient weather particles and effects\n\n### 🛠️ Technical Features\n- **Modular Architecture**: Clean separation of concerns\n- **Memory Monitoring**: Real-time heap usage tracking\n- **Performance Monitoring**: Frame rate and timing analysis\n- **Error Handling**: Comprehensive error reporting and recovery\n- **Configurable Parameters**: Easy customization via config files\n\n## 📋 Hardware Requirements\n\n### 🛒 Ready-to-Use Board (Recommended)\nFor the easiest setup, you can purchase a pre-built ESP32-C3 development board with integrated 0.42\" OLED display:\n\n**ESP32-C3 OLED Development Board**\n- **Where to buy**: [AliExpress - ESP32-C3 OLED Board](https://www.aliexpress.com/item/1005007342383107.html)\n- **Features**: ESP32-C3 supermini with built-in 0.42\" OLED, ceramic antenna, WiFi \u0026 Bluetooth\n- **Advantages**: No wiring required, compact form factor, plug-and-play setup\n\n\u003e 💡 **Note**: While we don't currently have an affiliate partnership, this link helps you find the exact board this project was designed for. Most users discover this repository after purchasing the board!\n\n#### 📋 Detailed Specifications\n- **MCU**: ESP32-C3FN4/FH4 with 4MB Flash\n- **Connectivity**: WiFi \u0026 Bluetooth with ceramic antenna\n- **Display**: 0.42″ OLED with 72×40 pixel animation area\n- **Programming**: USB download support\n- **Power**: USB-C connection\n\n#### ⚠️ **Important Technical Note**\nThis project uses a **72×40 pixel animation area** centered on the display. All the Christmas scenes, animations, and effects are designed for this area. The display driver handles the technical details automatically.\n\nIf you're using a different 0.42″ OLED display and the animations appear off-center, you may need to adjust the `SCREEN_WIDTH` constant in `config.h`.\n\n#### 🔧 **Real User Experiences \u0026 Tips**\nBased on feedback from actual AliExpress buyers, here are important setup notes:\n\n**✅ Working U8g2 Constructors:**\n```cpp\n// Option 1: Direct 72x40 support (recommended)\nU8G2_SH1106_72X40_WISE_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE, 6, 5);\n\n// Option 2: Alternative 72x40 \nU8G2_SSD1306_72X40_ER_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE, 6, 5);\n\n// Option 3: Standard 128x64 with manual offsets\nU8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE, 6, 5);\n// Then use offsets: xOffset = 28-30, yOffset = 12\n```\n\n**⚠️ Common Issues \u0026 Solutions:**\n- **Low brightness**: Set `u8g2.setContrast(255);` for maximum brightness\n- **Poor WiFi**: Antenna is close to display - expected ~20% weaker signal\n- **Arduino IDE**: Select \"ESP32C3 Dev Module\" as board type\n- **Misaligned overlay**: Cosmetic only, doesn't affect functionality\n\n**🔌 Confirmed Pin Layout:**\n- **I2C**: SCL=6, SDA=5 (confirmed by multiple users)\n- **Blue LED**: Pin 8\n- **Boot Button**: Pin 9\n- **Power**: ~200mA @ 5V via USB-C\n\n### 🔧 DIY Component Assembly\nAlternatively, you can build your own setup with individual components:\n\n| Component | Specification | Notes |\n|-----------|---------------|-------|\n| **MCU** | ESP32-C3 (or compatible) | ESP32, ESP32-S2, ESP32-S3 also supported |\n| **Display** | SSD1306 128x64 OLED | I2C interface, 0.42\" to 1.3\" supported |\n| **Power** | 3.3V/5V | Via USB or external supply |\n\n### 🔌 Wiring Diagram (DIY Setup Only)\n\n*Note: If using the integrated AliExpress board, no wiring is needed!*\n\n```\nESP32-C3    \u003c-\u003e    SSD1306 OLED\n--------          --------------\nGPIO6 (SDA)  \u003c-\u003e  SDA\nGPIO5 (SCL)  \u003c-\u003e  SCL\n3.3V         \u003c-\u003e  VCC\nGND          \u003c-\u003e  GND\n```\n\n## 🚀 Quick Start\n\n### Prerequisites\n- [PlatformIO](https://platformio.org/) installed\n- ESP32 board drivers installed\n- USB cable for programming\n\n### Installation\n```bash\n# Clone the repository\ngit clone https://github.com/MikeDX/ESP32-C3-OLED.git\ncd ESP32-C3-OLED\n\n# Open in PlatformIO (VSCode)\ncode .\n\n# Or build/upload via command line\npio run -t upload\npio device monitor -b 115200\n```\n\n### Configuration\nEdit `src/config.h` to customize:\n```cpp\n// Animation timing\nconstexpr unsigned long SCENE_DURATION = 5000;      // Scene change interval\nconstexpr unsigned long ANIMATION_FRAME_DELAY = 50; // Frame rate (20 FPS)\n\n// Feature toggles\nconstexpr bool ENABLE_STAR_ANIMATION = true;\nconstexpr bool ENABLE_WEATHER_EFFECTS = true;\nconstexpr bool ENABLE_DAY_NIGHT_CYCLE = true;\n\n// I2C pins (if different)\nconstexpr uint8_t I2C_SDA_PIN = 6;\nconstexpr uint8_t I2C_SCL_PIN = 5;\n```\n\n## 📁 Project Structure\n\n```\nESP32-C3-OLED/\n├── src/\n│   ├── main.cpp              # Main application with Christmas animations\n│   ├── config.h              # Configuration constants and parameters\n│   ├── animation.h           # Animation system declarations\n│   ├── AnimationManager.h    # Animation classes and utilities\n│   └── DebugUtils.h          # Debug and monitoring utilities\n├── .vscode/                  # VSCode configuration\n├── .pio/                     # PlatformIO build files\n├── platformio.ini            # PlatformIO configuration\n├── .gitignore                # Git ignore rules\n└── README.md                 # This file\n```\n\n## 🔧 Advanced Usage\n\n**📝 Note**: This project is specifically optimized for the AliExpress ESP32-C3 OLED board and uses the `U8G2_SSD1306_128X64_NONAME_F_HW_I2C` constructor with calculated offsets. Based on user reviews, you may get better results with the direct `U8G2_SH1106_72X40_WISE_F_HW_I2C` constructor, but this project's approach works reliably across different board revisions.\n\n### Performance Monitoring\nEnable debug output to see performance metrics:\n```cpp\n// In config.h\nconstexpr bool ENABLE_SERIAL_DEBUG = true;\n```\n\nMonitor output shows:\n- Average frame rate (FPS)\n- Memory usage and leak detection\n- Scene transition timing\n- Error reporting\n\n### Custom Animations\nExtend the system by adding new scenes:\n\n```cpp\n// In main.cpp\nenum Scene {\n    SCENE_CHRISTMAS_TREE = 0,\n    SCENE_SANTA_SLEIGH,\n    SCENE_FIREPLACE,\n    SCENE_WEATHER_DISPLAY,\n    SCENE_YOUR_CUSTOM_SCENE,  // Add here\n    SCENE_COUNT\n};\n\nvoid drawYourCustomScene() {\n    // Your animation code here\n}\n```\n\n### Memory Optimization\nFor constrained environments:\n- Reduce `MAX_PARTICLES` in config.h\n- Disable unused features via feature flags\n- Use PROGMEM for large string constants\n\n## 🐛 Troubleshooting\n\n### Common Issues\n\n| Problem | Cause | Solution |\n|---------|--------|----------|\n| Blank display | Wiring/I2C | Check connections, try different U8g2 constructor |\n| Display too dark | Low contrast | Add `u8g2.setContrast(255);` in setup() |\n| Animations off-center | Wrong display driver | Try `U8G2_SH1106_72X40_WISE_F_HW_I2C` constructor |\n| Poor WiFi signal | Antenna near display | Expected behavior - signal ~20% weaker |\n| Arduino IDE issues | Wrong board selection | Select \"ESP32C3 Dev Module\" |\n| Memory errors | Heap exhaustion | Reduce `MAX_PARTICLES`, enable monitoring |\n| Compilation errors | Missing dependencies | Run `pio lib install` |\n\n### Alternative Firmware Options\nThis board works with multiple firmware options:\n\n**🔸 Arduino IDE**\n```cpp\n// Minimal working example from user reviews\n#include \u003cU8g2lib.h\u003e\n#include \u003cWire.h\u003e\nU8G2_SH1106_72X40_WISE_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE, 6, 5);\n\nvoid setup() {\n  u8g2.begin();\n  u8g2.setContrast(255);\n  u8g2.setFont(u8g2_font_6x10_tf);\n}\n\nvoid loop() {\n  u8g2.clearBuffer();\n  u8g2.drawStr(0, 15, \"Hello OLED\");\n  u8g2.sendBuffer();\n  delay(1000);\n}\n```\n\n**🔸 ESPHome**\n```yaml\ni2c:\n  sda: 5\n  scl: 6\n\ndisplay:\n  - platform: ssd1306_i2c\n    model: \"SH1106 128x64\"  # Use with offset compensation\n    # Actual usable area: 72x40 with offset 28,12\n```\n\n**🔸 Tasmota**\nCompatible with standard Tasmota firmware (confirmed by users).\n\n**🔸 MicroPython**\n```python\nfrom machine import Pin, I2C\nfrom sh1106 import SH1106_I2C\n\nW,H = 72,40\nX0,Y0 = 28,12\ni2c = I2C(0, scl=Pin(6), sda=Pin(5), freq=400000)\noled = SH1106_I2C(X0+W, (Y0+H+7) \u0026 0xf8, i2c, rotate=180)\n```\n\n## 📊 Performance Benchmarks\n\nTypical performance on ESP32-C3:\n- **Frame Rate**: 20 FPS (50ms per frame)\n- **Memory Usage**: ~45KB heap (32 particles)\n- **I2C Frequency**: 400kHz\n- **Animation Smoothness**: 60+ interpolation steps\n\n## 🤝 Contributing\n\nWe welcome contributions! Areas for improvement:\n- Additional animation scenes\n- New particle effects\n- Performance optimizations\n- Hardware support (different displays)\n- Sound integration\n\n### Development Setup\n1. Fork the repository\n2. Create a feature branch\n3. Test on hardware\n4. Submit a pull request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🎯 Future Enhancements\n\n- [ ] WiFi connectivity for remote control\n- [ ] Multiple display support\n- [ ] Sound/music synchronization\n- [ ] Mobile app companion\n- [ ] Real-time weather integration\n- [ ] Custom animation scripting\n\n## 👨‍💻 Author\n\n**MikeDX** - [GitHub Profile](https://github.com/MikeDX)\n\n## 🙏 Acknowledgments\n\n- [U8g2 Library](https://github.com/olikraus/u8g2) for excellent OLED support\n- [PlatformIO](https://platformio.org/) for the development platform\n- ESP32 community for hardware support and documentation\n\n---\n\n*Made with ❤️ for the maker community* ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikedx%2Fesp32-c3-oled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikedx%2Fesp32-c3-oled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikedx%2Fesp32-c3-oled/lists"}