ESP32-C6 not working with Grove Sensor

I have am trying to get a Grove Ultrasonic Ranger to work with a Xiao ESP32-C6. I’m using the example given in the Ultrasonic Ranger Wiki. The serial data only reports “0” inches/cm. I’ve tried different bases, the Grove Expansion Board and a Grove Base. Same results. I’ve then tried using a Xiao Seeeduino and it works fine on both bases.

The only way I got it to work, was to change the data pin from 7 to 0 (using the other Grove Jack) on both the Expansion Board and Grove Base.

Is there something I’m missing in using the ESP32-C6 that doesn’t like using D7?

you talking about this?

on this device you are going to want to use D0 grove port and use D0 as the control pin in the code

you probably dont want to use D7… as 6&7 is for serial UART port and may cause confusion

you really dont want to use the top two grove ports, because they are both IIC ports and are connected internally to the screen and RTC… so it is not going to work because of cross talk with the hardware

on this device… theoredically any pin can work… the upper left port is D0

also here the IIC ports are connected internally… so you can only use one or the other but not both at the same time… if you are not using other IIC devices on this bus… and also D7 UART can be used… but i say avoid that one too if possable

as you can see… the third pin (white wire) is NC Not Connected to anything… so make sure whatever port you use… the outboard pin (Yellow Wire) is the pin which will send and recieve the signal

1 Like

Hi there,

I would only add this: Sometimes the GPIO pin number needs to be used instead of the logical pin(D7) try that with the Xiao side and What BSP are you using? some are buggy on Serial port pins support.

HTH
GL :slight_smile: PJ :v:

@cgwaltney recommends are spot on as well any pin should work. :+1:

1 Like

agreed… i just finished writing a paper about it on the discord server

not elegant work… but maybe insightful

I tried on both of the Grove boards that you pictured. Both act the same when using the ESP32-C6. I too suspected the UART wasn’t playing nicely so I tried moving to a different output pin (D0 in my case, was the only one that worked). I just found it odd that the Seeduino (SAMD) had no such issues using D7. I have a feeling that there’s something going on with the pin-muxing in the ESP that is at fault, but I’m not an computer engineer, which is

Hi there,

Can you post up the code , so we may look ? Use the code tags above “</>” paste it in there. :+1:

HTH
GL :slight_smile: PJ :v:


try going to D0 and in the code set pin to 00
and/or try going to D7 and in the code set pin to 17

take a look at that discord link i posted where I talk about the difference between Board Pins or Physical Pins and Chip Pins/GPIO or Logical Pins

Bonus points if you can tell me what D9 would be…