Help with UART on ESP32-C6-DevKitC-1

I’m working on a project using a ESP32-C6-DevKitC-1 with UART. The final goal will be to connect a WL-134 RFID reader, but for now I just want to get UART working!

My current setup:
I have an Arduino UNO, which sends out a text via UART every second. The configuration is:

Code
void setup() {
  Serial.begin(9600);  // Start UART communication at 9600 baud
}

void loop() {
  Serial.println("Hello from Arduino!");  // Send a message
  delay(1000);  // Wait for 1 second before sending the next message
}

This message should by read by my ESP32. As the Arduino works on 5V and the ESP32 works on 3.3V I have built a voltage divider using a 10kΩ and a 20kΩ resistor. Both boards are powered via USB from my laptop, and I have connected the grounds. The configuration on the ESP32 is:

Code
esphome:
  name: esp32-project
    friendly_name: ESP32 Project

esp32:
  board: esp32-c6-devkitc-1
  flash_size: 8MB
  variant: esp32c6
  framework:
    type: esp-idf
    version: 5.3.1
    platform_version: 6.9.0

uart:
  - rx_pin: GPIO4
    baud_rate: 9600
    id: myuart1
    debug:

logger:
  level: DEBUG

api:
  encryption:
    key: "*****"

ota:
  - platform: esphome
    password: "*****"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.1.131
    gateway: 192.168.1.1
    subnet: 255.255.255.0
  power_save_mode: none
  ap:
    ssid: "*****"
    password: "*****"

captive_portal:
    

The LED on the Arduino blinks every second, so I currently assume that this part works as expected. But unfortunately, I don’t see anything in the logs from the ESP32.

Does anyone have an idea what I did wrong or how I could fix this?

EDIT: Here is a quick schematic of what I did:

Try rx with GPIO17
and turn off serial logging

logger:
  baud_rate: 0

also enable dummy_receiver on uart debug:

  debug:
    direction: BOTH
    dummy_receiver: true
    after:
      delimiter: "\n"
    sequence:
      - lambda: UARTDebug::log_string(direction, bytes);

Thank you for the suggestions!
I have just tried everything you mentioned, and didn’t see a difference.

So you got nothing on log from uart debug?
Neither warnings when you compile?

Bad connection on breadboard?

Correct, I don’t get anything from uart debug in the logs.
Here are the logs from installing the config via OTA:

Logs
[16:37:56][I][app:100]: ESPHome version 2024.12.2 compiled on Jan 21 2025, 16:37:27
[16:37:56][C][wifi:600]: WiFi:
[16:37:56][C][wifi:428]:   Local MAC: *****
[16:37:56][C][wifi:433]:   SSID: [redacted]
[16:37:56][C][wifi:436]:   IP Address: 192.168.1.*
[16:37:56][C][wifi:439]:   BSSID: [redacted]
[16:37:56][C][wifi:441]:   Hostname: 'catdoor'
[16:37:56][C][wifi:443]:   Signal strength: -64 dB ▂▄▆█
[16:37:56][C][wifi:447]:   Channel: 6
[16:37:56][C][wifi:448]:   Subnet: 255.255.255.0
[16:37:56][C][wifi:449]:   Gateway: 192.168.1.1
[16:37:56][C][wifi:450]:   DNS1: 0.0.0.0
[16:37:56][C][wifi:451]:   DNS2: 0.0.0.0
[16:37:56][C][logger:185]: Logger:
[16:37:56][C][logger:186]:   Level: DEBUG
[16:37:56][C][logger:188]:   Log Baud Rate: 0
[16:37:56][C][logger:189]:   Hardware UART: UART0
[16:37:56][C][uart.idf:159]: UART Bus 0:
[16:37:56][C][uart.idf:161]:   RX Pin: GPIO17
[16:37:56][C][uart.idf:163]:   RX Buffer Size: 256
[16:37:56][C][uart.idf:165]:   Baud Rate: 9600 baud
[16:37:56][C][uart.idf:166]:   Data Bits: 8
[16:37:56][C][uart.idf:167]:   Parity: NONE
[16:37:56][C][uart.idf:168]:   Stop bits: 1
[16:37:56][C][captive_portal:089]: Captive Portal:
[16:37:56][C][mdns:116]: mDNS:
[16:37:56][C][mdns:117]:   Hostname: catdoor
[16:37:56][C][esphome.ota:073]: Over-The-Air updates:
[16:37:56][C][esphome.ota:074]:   Address: 192.168.1.*:3232
[16:37:56][C][esphome.ota:075]:   Version: 2
[16:37:56][C][esphome.ota:078]:   Password configured
[16:37:56][C][safe_mode:018]: Safe Mode:
[16:37:56][C][safe_mode:019]:   Boot considered successful after 60 seconds
[16:37:56][C][safe_mode:021]:   Invoke after 10 boot attempts
[16:37:56][C][safe_mode:022]:   Remain in safe mode for 300 seconds
[16:37:56][C][api:140]: API Server:
[16:37:56][C][api:141]:   Address: 192.168.1.*:6053
[16:37:56][C][api:143]:   Using noise encryption: YES
[16:37:56][D][api:103]: Accepted 192.168.1.*
[16:37:56][D][api.connection:1446]: Home Assistant 2025.1.2 (192.168.1.*): Connected successfully
[16:38:52][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[16:38:52][D][esp32.preferences:114]: Saving 1 preferences to flash...
[16:38:52][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed

I don’t think it’s a bad connection on the breadboard, as I have tried multiple GPIO pins, and I have also exchanged the whole ESP32 board.

That log doesn’t mention anything about uart debug… -but I’m not sure if it generally does it.
I don’t see any reason why it would not receive. If you have multimeter, connect arduino side tx wire to 5V and measure that you get 3.3V on Esp side.

Hello,

but this on an UNO does not initialize the communication via the USB serial, the one that goes to your pc.
So you are not sending anything to ESP.

You need something like:

#include<SoftwareSerial.h>
SoftwareSerial SUART(0, 1); //SRX = 0, STX = 1

void setup() 
{
  Serial.begin(9600);
  SUART.begin(9600);
}

void loop() 
{
  SUART.println("Hello UNO-2!");
  delay(1000);
}

this above is untested.
Please see this documents: https://docs.arduino.cc/learn/communication/uart/
UNO does not have serial1 so you have to declare pins for the UART.
I believe that with your code you are sending everything to serial over usb

While the Arduino is not sending I measure 5.13V on the TX pin and 3.41V on the RX of the ESP32.

I just tried it and added a SoftwareSerial, but this didn’t help either.

Hello,

i add more I tried with @Karosm suggestion with debug, thanks Karosm I always learn from you.
And it works:
image

Code for arduino:

#include<SoftwareSerial.h>
SoftwareSerial SUART(0, 1); //SRX = 7, STX = 8

void setup() 
{
  Serial.begin(9600);
  SUART.begin(9600);
}

void loop() 
{
  Serial.println("Hello UNO-2!");
  Serial.println("USB");
  delay(1000);
}

code for ESP

uart:
  - rx_pin: GPIO3
    tx_pin: GPIO1
    baud_rate: 9600
    id: myuart1
    debug:
      direction: BOTH
      dummy_receiver: true
      after:
        delimiter: "\n"
      sequence:
        - lambda: UARTDebug::log_string(direction, bytes);

logger:
  baud_rate: 0

Sorry I don’t have unused ESP32 but it should just work as well.

First code was not correct:

SUART.println

is not correct

you should use

serial.println("text")

I used both Serial.println and SUART.println to be safe

In your case it seems to work, what was your setup? What ESP board did you use?

It does, if usb is connected to serial monitor.
But here it doesn’t have importance anyway.
You can’t make softwareserial instance with hardwareserial pins.

esp8266 wemod1 mini.

Does anyone here have experience with the ESP32-C6-DevKitC-1 board, potentially in combination with UART?

I‘m might buy a different ESP board for this project, doesn‘t have to be the C6

I was just helping yesterday one guy with 2 UART connections.

Are you sure you have debug configured correctly?

Wroom32 would take out 99% of odds…

Add more:

Arduino TX > ESP RX via voltage divider as you did 10kOhm and 20 kOhm

Arduino GND > Esp GND
Arduinon 5V > Esp 5V

that’s it

Not good idea if Esp is already powered .

First of all, thank you very much for all the feedback! I really appreciate it.

Good to see that the combination of ESPHome/ESP32-C6/UART seems to be working. My config is very similar, so I still don’t understand why my setup isn’t working.

I have set it up exactly as you suggested, with logger: baud_rate: 0 and uart: debug: as in your previous post. Just doublechecked it.

I just changed the setup so the ESP32 sends to the Arduino and this works as expected, without even bothering about the different voltage. Might there be a problem with my voltage divider?

A different thought: Could there be an issue with the framework version I used? I selected this with a bit of trial-and-error.

esp32:
  board: esp32-c6-devkitc-1
  flash_size: 8MB
  variant: esp32c6
  framework:
    type: esp-idf
    version: 5.3.1
    platform_version: 6.9.0

As previously mentioned my goal is to connect a WL-134 RFID reader to the ESP32, the arduino is only used for debugging. I just realized that the WL-134 also has a 3.3V TX next to the 5V TX. I will solder this up tonight and try communication without the voltage divider.