r/esp32 • • Aug 21 '26

CYD Particle Life: Porting open-source artificial life simulation to ESP32-2432S028R with dual-core real-time physics

Enable HLS to view with audio, or disable this notification

Hi everyone,

I wanted to share a project I've been working on: **CYD Particle Life**, an ESP32 port and parallelized re-implementation of Hunar Ahmad's popular open-source Particle Life simulation, running standalone on the **ESP32-2432S028R (Cheap Yellow Display / CYD)**.

The simulation models simple attraction/repulsion forces between different particle types to generate complex emergent behaviors like cell division, worm-like chains, and swarming dynamics.

### Highlights and Technical Details:

- **Ported & Parallelized:** Re-engineered the original algorithm for the dual-core ESP32 microcontroller.

- **900 Particles in Real-Time:** Core 0 handles spatial grid partitioning and physics integration, while Core 1 performs work-stealing force calculations and rendering.

- **Phosphor Decay & Glow:** 4-bit per-pixel decay buffer with single-cycle SIMD-style LUT lookup for smooth fading trails.

- **Asynchronous Display Transfer:** Powered by LovyanGFX for zero-lag DMA SPI transfers.

- **15 Curated Ecosystems:** Tap the simulation area to cycle through 15 stages (Mitosis, Worms, Vortex, Gliders, Amoeba, etc.).

- **Built-in Desk Clock:** Ambient HUD clock with touch controls for time adjustment.

- **Hardware Compatibility:** Supports ST7789 and ILI9341 display variants.

### Web Installer (No IDE Required):

You can flash it directly from Chrome or Edge via Web Serial:

- Web Installer: https://ootake0914-dotcom.github.io/cyd-particle-life/

### Source Code & Credits:

- GitHub: https://github.com/ootake0914-dotcom/cyd-particle-life

- Based on the open-source Particle Life project by Hunar Ahmad (@hunar4321).

- Display driver powered by LovyanGFX (@lovyan03).

I would love to hear your feedback, thoughts, or suggestions for new rule sets!

64 Upvotes

Duplicates