Using Arduino as Serial Bridge (TTL to USB) Only Rx works

Hey there,
I’ve seen multiple people use their arduino boards as an USB to Serial bridge by putting the microcontroller in tristate via connecting GND and Reset.

I’d like to do the same with an Arduino UNO R3 (by Elegoo). To test it I’ve got a second Arduino send periodically a msg but it also echoes any incoming msg.

This works great if I connect the Arduino directly to a computer but if I bridge the serial connection via the second Arduino (which is in a tristate) only the periodic msg comes through and echoing doesn’t work anymore.

I can’t explain this behavior at all, my actual intend is to control a ESP8266 via the Arduino IDE Serial monitor but this won’t work either since I excpect the msgs don’t come through to it.

Has anyone encountered such a behaviour?

(It also happens if I switch the Arduinos jobs)
Echo code:

unsigned long msg = 0;
void setup() {
Serial.begin(115200);
}

void loop() {
if (Serial.available() > 0) {
Serial.write(Serial.read());
}
if (millis() > msg) {
msg = millis() + 2000;
Serial.print("A: ");
Serial.println(millis());
}

}

Why Serial.write here instead of Serial.print?

Serial.write(Serial.read());

Hi CrossRoads! Thanks for your answer, I just changed it but the message doesn't get echoed back either.

I just noticed you are putting 5V from the USB connected board into Vin on the 2nd board - that puts 5V into the 2nd board's 5V regulator, which will produce a low voltage to power the board.

Try connecting 5V to 5V instead.

CrossRoads:
I just noticed you are putting 5V from the USB connected board into Vin on the 2nd board - that puts 5V into the 2nd board's 5V regulator, which will produce a low voltage to power the board.

Try connecting 5V to 5V instead.

Assuming the second board isn't connected to some other power source, do what he said.

If it is, disconnect the 5v line entirely (never have a board powered by USB and connected to external 5v via the 5v pin - the power supplies will fight)

Nope, that still didn't fix it. I'm really not worrying about the power supply anyway since my actual goal is to talk to a ESP8266 via the Arduino Serial chip. However I can't get any data through the Arduino bridge in both ways, I can only receive. The echoing doesn't work and I have no idea why :confused:

Strange... I'm not sure what the issue is.

Uh... you do realize that standalone USB-serial adapters are $1-2 each right?
TTL USB2.0 To 6Pin CH340G Converter for STC PRO Instead of CP2102 PL2303 | eBay - no specific endorsement of this vendor (same thing is sold at about the same price by several sellers), but I do endorse that design. They work great, the 3.3v/5v switch does what it says, and it breaks out DTR so you can easily use it to program an arduino.

These are, IMO, the good cheap ones - they've got a switch for 5v vs 3.3v, and use the nearly indestructible CH340G serial chip (notice how nobody here ever posts about blowing their CH340G serial adapter (used on many arduino clones), but we get several posts a week from people who trashed the 16u2 in their official board or faithful clone). They even include free F-to-F dupont jumpers, not that that's what you need to connect it to an Uno.

well I guess I have to find another solution maybe I use the SoftwareSerial library and both arduinos at the same time or something, anyway thanks!

Hi,

It would seam nobody noticed he had RX to RX and TX to TX? Not gona work.

Luc

ltheoret:
Hi,

It would seam nobody noticed he had RX to RX and TX to TX? Not gona work.

Luc

You've responded to a 6 week old thread, but the wiring is correct since it's using the USB-Serial on one board to talk to the processor on the second board.

The issue is probably that the USB-Serial on the second board is not disabled, so there is contention between the USB-Serial Tx (Rx at the Atmega328) drivers on the two boards. The other direction works because the Atmega328 is the sole driver into two USB-Serial Rx pins. Usually this sort of configuration is used to program a second board that doesn't have USB-Serial (like an ESP-01 ESP8266) so the conflict does not arise.