Esp32c3 D6 behaviour on start - strange sound

Hi, I’m using a couple of the xiao esp32c3 but right now run into a new situation. In my project I use pin D6 (GPIO21) as an output pin to drive an relay (an ULN2003AN in-between the GPIO and the relay). On the esp32 I run esphome.
I read that here:

For my use case it doesn’t matter if d6 is high for a moment on start up. But besides of being high the board is making a strange high frequency sound at the same moment.
During runtime a high output on d6 is switching the relay as expected and now strange sound.

That leads me to two questions:

  1. what might that sound be
  2. is it "harmful "

Using another pin than d6 would mean building a new PCB, that’s just an option for the worst case…

Thanks a lot for your help,

I noticed a similar problem on a XIAO SAMD when driving a NRF24
i think it may be capacitor noise associated with high current and high frequency

my only sudgestion is to reduce the current and/or frequency

Hmm not quite sure there. The “naked” xio esp32c3 isn’t doing anything unexpected. On my pcb there is just the uln next to the xioa no extra capacitors. Might be some “interaction” with the uln. I can’t hear if the sound comes from he xioa or the uln as they are straight next to each other.

Hi there,
Do you have a Flyback Diode on the relay?
the High reverse current can damage the Xiao.
GL :slight_smile: PJ

Yes, it’s in the uln:

After not really much I could find online, I came to these conclusions:

  • d6 (GPIO21) might be a bad choice, as stated in the link I posted at the beginning
  • there are serial messages on the uart (d6/d7) while boot that might case the observed behaviour
  • one could set the eFuse EFUSE_UART_PRINT_CONTROL to avoid messages on the uart during boot. I didn’t go into that

I did go for d10 instead of d6 and the "problem " is avoided. For my usecase I consider that as a "solution ".

Thanks anyway for looking into my issue