ESP32-C6 with Two A02YYUW Sensors: Crashes When Second Sensor Is Enabled

Hello everyone,

I’m using an ESP32-C6 board connected to two A02YYUW ultrasonic distance sensors. When I enable both sensors, my device reboots continuously and I get an error in the logs:
[W][uart.idf:088]: Maximum number of UART components created already. [E][component:119]: Component uart was marked as failed. [E][component:164]: Component uart set Error flag: unspecified ... assert failed: xQueueSemaphoreTake queue.c:1653 (( pxQueue )) Core 0 register dump: ... Rebooting...

My YAML Configuration

esphome:
  name: test

esp32:
  board: esp32-c6-devkitc-1
  framework:
    type: esp-idf
    
logger:

api:

ota:
  - platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

sensor:
  - platform: "a02yyuw"
    name: "Level 1"
    uart_id: uart_1
  - platform: "a02yyuw"
    name: "Level 2"
    uart_id: uart_2

uart:
  - id: uart_1
    tx_pin: GPIO04
    rx_pin: GPIO05
    baud_rate: 9600
  - id: uart_2
    tx_pin: GPIO11 
    rx_pin: GPIO10
    baud_rate: 9600

What I’ve tried:

  • Changing the pins used by the second sensor
  • Disabling one or both sensors in code to see if it’s a pin conflict
  • Checking power supply adequacy

Result: No luck so far. I still get constant reboots anytime the second sensor is active. Both sensors individually seem to work, but not at the same time.

Question:

  • Has anyone successfully run two A02YYUW sensors on an ESP32-C6 at the same time?
  • Do I need special pins, a software serial approach, or is this a hardware limitation?
  • Any suggestions on how to solve the reboot/crash issue?

Thank you in advance for any tips or pointers!

I don’t know your board and how usb serial is implemented, but you could try disabling it:

logger:
  baud_rate: 0

also, try with default uart0 pins:

uart:
  - id: uart_1
    tx_pin: GPIO16
    rx_pin: GPIO17
    baud_rate: 9600

I’ve played with an a02yyuw on a D1 mini and got it working, but never tried 2 at the same time tho.
not sure about the use of quotes behind platform: “” ? it’s probably fine, but not needed.
I had to disconnect the tx pin to the sensor, also deleted the tx_pin line in the code to get it working.
not an expert, just sharing my findings.

Thank you so much, I solved it by adding ‘baud_rate: 0’.