Can't write to serial immediately from PC to Arduino nano via pl2303 usb to ttl converter Goal:

I am trying to send some characters to Arduino through serial from PC via a Prolific PL2303 USB to TTL converter(Chinese clone).

I have wrote a simple sketch(attached bellow) which should light up the LED if 'n' is found or should switch the LED off if 'f' is found from serial.

What's Happening:

I opened up the serial monitor. Send a character(say 'n' which should light up the LED). But nothing happened though the RX/TX LEDs flashed. Then I re opened the serial monitor. And just after re opening the serial monitor LED light up! Every time when I issue a character from serial monitor nothing happens. But just after re opening the monitor character is sent.

H/W Connection:


Arduino Vin -> LiPo positive rail(+11V)
Arduino GND -> LiPo negative rail(GND)
Prolific GND -> Arduino GND
Prolific RX -> Arduino TX
Prolific TX -> Arduino RX


Arduino Sketch:

int led = 13;

void setup() {
  // put your setup code here, to run once:
  pinMode(led, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  if(Serial.available() &gt; 0){
    char bytesReceived = Serial.read();
    Serial.println(bytesReceived);

    if(bytesReceived == 'n'){
      digitalWrite(led, HIGH);  
    }
    else if(bytesReceived == 'f'){
      digitalWrite(led, LOW);  
    }
  }
}


Additional Notes:


Platform Windows 10
Installed Prolific PL2303 driver from here
This code is working using USB cable provided with Arduino.(I need longer cable)


Can't understand why this strange thing is happening. Any kind of help will be appreciated.

Thanks!
I have experienced similar behavior with clone chips. What worked for me is using ferrite choked USB cables similar to these; as you referenced as well, I observed that the problem occurs with either longer cable, or with cables without ferrite chokes on them. This might have to do with the PCB or the cheap chips being prone to electromagnetic interference.