
SoulCage直译叫灵魂牢笼,核心概念是把一块带屏幕的小型微控制器做成吊坠,屏幕循环播放被困住的灵魂动画——光点在笼子般的网格里游走、碰撞、闪烁。整个东西挂在脖子上像赛博朋克饰品,实际上是跑着自定义动画逻辑的ESP32-S3开发板。项目覆盖微控制器选型、屏幕驱动、电源管理、3D打印外壳设计以及资源受限下的流畅动画。
选主控时最初考虑ATtiny85但RAM只有512字节,连一帧128x128 RGB565都存不下;STM32F103性能够用但开发环境复杂且无内置WiFi蓝牙。最终锁定ESP32-S3,理由包括双核240MHz Xtensa LX7算力充足,实测128x128分辨率下TFT_eSPI局部刷新帧率稳定30fps以上;512KB SRAM加8MB PSRAM可缓存多帧动画并做双缓冲;GPIO丰富;Arduino IDE支持完善;WROOM模组18x25.5mm去掉排针后可直接焊在定制PCB上,厚度压到10mm以内。注意必须选带PSRAM的型号,作者一开始用N4版本4MB Flash无PSRAM,动画帧缓存不够只能降到64x64。
屏幕选1.28寸240x240的GC9A01驱动圆屏,4线SPI接口。交互用一个SPDT滑动开关负责电源通断加电容触摸焊盘负责交互,触摸焊盘用ESP32-S3内置电容触摸功能,在PCB上画8mm直径铜箔引到GPIO14,覆盖2mm亚克力外壳时阈值设40左右稳定。电源用3.7V 150mAh锂电,屏幕亮度50%动画持续约2.5小时,休眠模式亮度10%、帧率5fps可延长到6小时。充电用TP4056芯片,必须把PROG引脚电阻换成2K把充电电流降到500mA左右。
TFT_eSPI配置陷阱:引脚定义在User_Setup.h里,配置GC9A01_DRIVER、240x240分辨率、MOSI 11/SCLK 12/CS 10/DC 8/RST 9/BL 7、SPI_FREQUENCY 80000000,80MHz是GC9A01极限,100MHz会白屏。动画帧用Processing预生成240x240 RGB565帧序列,30帧约3.4MB,用mklittlefs打包后通过ESP32 Sketch Data Upload插件上传,读取时用LittleFS,缓冲区用uint16_t buffer[57600]保证16位对齐。
PCB为直径32mm圆形,天线净空区不能铺铜走线,电源走线至少0.5mm宽,触摸焊盘周围加接地保护环且不盖阻焊层。外壳用SLA光固化透明树脂打印,分前盖、中框、后盖三部分,前盖屏幕窗口留1mm台阶,中框内壁留0.5mm间隙。焊接顺序先小元件后模组最后屏幕,FPC排线0.5mm间距要用热风枪250°C加焊膏。常见问题:白屏降SPI频率、花屏重焊FPC、触摸误触发加10nF电容并做动态基线跟踪。功耗实测:全速80mA续航1.9小时,亮度10% 15fps为20mA续航7.5小时,深度睡眠0.01mA可达625天。
本文来源:http://www.lpqz.cn/news/110819
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。
SoulCage literally means "soul cage". The core concept is to turn a small microcontroller with a screen into a pendant whose screen loops an animation of a trapped soul — points of light wandering, colliding and flickering inside a cage-like grid. Worn around the neck it looks like a cyberpunk accessory, but in reality it is an ESP32-S3 development board running custom animation logic. The project covers microcontroller selection, screen driving, power management, 3D-printed enclosure design, and smooth animation under resource constraints.
For the main chip, the ATtiny85 was first considered but its RAM is only 512 bytes — not even enough for a single 128x128 RGB565 frame; the STM32F103 has adequate performance but a complex development environment and no built-in Wi-Fi or Bluetooth. The final choice was the ESP32-S3, for reasons including ample dual-core 240MHz Xtensa LX7 computing power, with measured TFT_eSPI partial-refresh frame rates stably above 30fps at 128x128 resolution; 512KB SRAM plus 8MB PSRAM to cache multiple animation frames and support double buffering; abundant GPIOs; mature Arduino IDE support; and the WROOM module measuring 18x25.5mm, which after removing the pin headers can be soldered directly onto a custom PCB, keeping the thickness under 10mm. Note that you must choose a model with PSRAM — the author initially used the N4 version with 4MB Flash and no PSRAM, and the animation frame buffer was insufficient, forcing a drop to 64x64.
For the screen, a 1.28-inch 240x240 round display driven by the GC9A01 was chosen, with a 4-wire SPI interface. Interaction uses an SPDT slide switch for power on/off plus a capacitive touch pad; the touch pad uses the ESP32-S3's built-in capacitive touch function, with an 8mm-diameter copper foil drawn on the PCB and routed to GPIO14, and with a 2mm acrylic cover the threshold is set around 40 for stability. Power comes from a 3.7V 150mAh lithium battery; at 50% screen brightness the animation runs for about 2.5 hours, while sleep mode at 10% brightness and 5fps extends this to 6 hours. Charging uses the TP4056 chip, and you must replace the PROG-pin resistor with 2K to reduce the charging current to around 500mA.
TFT_eSPI configuration pitfalls: pins are defined in User_Setup.h, configuring GC9A01_DRIVER, 240x240 resolution, MOSI 11/SCLK 12/CS 10/DC 8/RST 9/BL 7 and SPI_FREQUENCY 80000000; 80MHz is the GC9A01's limit and 100MHz causes a white screen. Animation frames are pre-generated as a 240x240 RGB565 frame sequence with Processing — 30 frames are about 3.4MB — packed with mklittlefs and uploaded via the ESP32 Sketch Data Upload plugin; at runtime they are read with LittleFS, and the buffer uses uint16_t buffer[57600] to guarantee 16-bit alignment.
The PCB is a 32mm-diameter circle; no copper pouring or routing is allowed in the antenna clearance area, power traces must be at least 0.5mm wide, and a grounded guard ring is added around the touch pad without solder-mask coverage. The enclosure is printed with SLA photopolymerisable transparent resin in three parts — front cover, middle frame and back cover — with a 1mm step at the screen window of the front cover and a 0.5mm gap on the inner wall of the middle frame. Soldering order is small components first, then the module, and the screen last; the 0.5mm-pitch FPC ribbon requires a hot-air gun at 250°C with solder paste. Common problems: for a white screen, lower the SPI frequency; for a garbled screen, reflow the FPC; for false touch triggers, add a 10nF capacitor and implement dynamic baseline tracking. Measured power consumption: 80mA at full speed gives 1.9 hours of runtime, 20mA at 10% brightness and 15fps gives 7.5 hours, and deep sleep at 0.01mA can last up to 625 days.
本文来源:http://www.lpqz.cn/news/110819
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。