Arduino serial transmission problem

I want to transmit sensor output via Tx/Rx pin. Here is the code:

void setup() {
  Serial.begin(115200); 
}
void loop() 
{
  Serial.println(analogRead(A1));
}

So, it is supposed to transmit the data as soon as the device is powered on, but it doesn't.
When I upload the code, Tx LED goes ON (even when the serial monitor is not opened), which shows that it is transmitting. If I press RESET, then also LED is ON.
If plug it out and then plug it in again, the LED is supposed to turn ON (or start transmitting) automatically. But it doesn't. It only turns ON when I start the serial monitor.
I tried with Mega too, and got same result.
In short, my arduino is not transmitting data via UART, automatically. What could be the problem?

ad a delay in there so it doesnt loop so fast :slight_smile:

void setup() {
  Serial.begin(115200); 
}
void loop() 
{
  Serial.println(analogRead(A1));
delay(10);
}

upload the code. open the serial monitor (make sure you have the right COM port) and the Arduino will auto reset when you open serial monitor so it should go.

thanx, but I do not want to open a serial monitor because I want to use the microcontroller of UNO in another circuit I designed. So I want it to transmit automatically when I power my device.

whenever you start the arduino (or press reset) it will start (or restart) the code.