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:
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?
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.
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
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.
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.
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.