
▲ 1 r/arduino
ESP32 as a USB to UART
I have a PCB from an old ereader (Kobo Touch) that has some serial connections on the PCB and I want to see them. I found someone that says they have done it, so I know it's possible. I managed to put some pins on the RX and GND role on the PCB and plug then into the ESP32, but I just get garbage on the serial console. See photos of the setup.
I realy don't want to buy an adpter board just for this.
The code:
#define RXD2 18
#define TXD2 17
void setup() {
Serial.begin(115200); // USB (PC)
Serial2.begin(115200, SERIAL_8N1, RXD2, TXD2); // PCB UART
Serial.println("ESP32 STARTED");
}
void loop() {
// From PCB → PC
while (Serial2.available()) {
Serial.write(Serial2.read());
}
From PC → PCB
while (Serial.available()) {
Serial2.write(Serial.read());
}
}#define RXD2 18
#define TXD2 17
void setup() {
Serial.begin(115200); // USB (PC)
Serial2.begin(115200, SERIAL_8N1, RXD2, TXD2); // PCB UART
Serial.println("ESP32 STARTED");
}
void loop() {
// From PCB → PC
while (Serial2.available()) {
Serial.write(Serial2.read());
}
From PC → PCB
while (Serial.available()) {
Serial2.write(Serial.read());
}
}
u/mateus2k2 — 1 day ago