Connecting UART A02YYUW ultrasonic sensor to Adafruit ESP32 Feather V2

Hi. This is my first Arduino project.

I am looking for some guidance on connecting a UART A02YYUW ultrasonic distance sensor to an ESP32 Feather V2, and which pins I should be using for the TX and RX.

I am a little confused between the pinouts shown on the Adafruit diagram versus the ESP32-PICO-MINI datasheet.

I have found various examples using different ESP32 varients, but nothing specific to this board, or the Feather V2.

Any help is appreciated.

Adafruit Feather V2

ESP32 datasheet

U02YYUW Ultrasonic

First, tell us what software you are going to use. Are you going to write it all yourself? If so, use any serial port you want to. If you are using someone else’s software, it will tell you what serial port to use.

If you are confused about diagrams, please show them and note your confusion. What is different between what you have found and your board?

Use the Adafruit pinout. Any example you find is easily adapted to the Adafruit. In the code will liely be defines for each pin, just check against the Adafruit to see if it matches ad if not change it to what wil work.
The TX/RX are clearly marked on the Adafruit diagram

It will be Arduino IDE, my own programming.

Documentation from expressif shows pins 30 and 31 for RX and TX (also used as GPIO3 and GPIO1 respectively). The Adafruit diagram shows RX and TX as GPIO7 and GPIO8; I can't locate specific pin numbers for these.

Thanks, thats what I figured, but I couldn't make sense of it against the expressif documentation.

There are lot's of esp32's made by many companies. The only pin out that matters is the specific one for that one board, the espressif docs are just for boards made by them.

That makes senses. Thank you for the explanation.

It's clearly shown in the datasheet. However, pin numbers are totally irrelevant as they are not used in any Arduino code. You should either use the GPIO number or the provided alias such as RX/TX, SDA/SCL etc

Thanks

I can see where the confusion comes from. The Adafruit documentation is referring to the GPIO numbers as pin numbers, that is wrong, they are not the same.

While we are talking about pin/gpio, is there a .h file that contains the names and alias's for esp32. I think I have seen one for Arduino but not esp32.

There is one for each ESP32 variant that the board package supports including all the Adafruit boards.

@sweet_baby_james AH, indeed. I must never have looked inside the variant folder before. Very handy.


clicking Go to Definition will create the Read Only tab with the .h file