RISC-V LED controller

Background & Concept

There is an excellent RISC-V microcontroller for sale: the ESP32 C3. I’ve bought mine from M5Stack: the M5Stamp C3, and I am absolutely in love with it. There are posts on hackaday that go more in depth, but the essence is you’re getting a Wi-Fi, Bluetooth, USB-C microcontroller in a tiny package for $6.

After browsing through and flashing some examples, I thought of using it for my LED strips instead of the Xtensa-based ESP32s that are running now. The software stack that’s running now to control the LEDs is also far from perfect with nodered or home assistant sending custom messages over MQTT that basically trigger routines on the ESP32.

WLED and ESPHome

At the time of writing, https://install.wled.me/ was not working for the relatively young ESP32C3. With the help of some kind internet strangers, I’ve found a working ESPHome configuration. It involves adding some platform options to the yaml used to configure ESPHome:

  platformio_options:
    board_build.flash_mode: dio
    platform_packages:
      - framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.1
    platform:
      - https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream

And for WLED, also specifying some extra parameters:

light:
  - platform: neopixelbus
    id: ws2812
    type: GRB
    variant: WS2812
    method: ESP32_RMT_1
    num_leds: 150
    pin: GPIO7

And after flashing with docker run --rm -v "${PWD}":/config --device=/dev/ttyACM0 -it esphome/esphome run esp32-led-config.yaml it was ready to be added in Home Assistant, where colors and effects can be configured. No more MQTT or NodeRED needed. Thank you ESPHome.

Printed Circuit Board

Another microcontroller, another PCB! With the previous PCB, I took a lot of space for extra connectors that I didn’t need, so I wanted it a bit more minimal now: only the bare necessary connections. Slowly getting used to Autodesk’s Eagle, I thought I’d go for a round PCB this time:

led controller

Conclusion

The ESP32 C3 is super cool!

Some resources crossed along the way