Arduino not sending serial data

Hey guys!

I'm just trying to set up a wireless serial communication via IR. I generate a 38kHz signal on pin 9. The IR-LED is connected to pin 9 with it's anode and the kathode of the LED is connected to the TX pin of the Arduino.

Now the problem is that the Arduino doesn't seem to be sending data if I power it from batteries. It only sends serial data when I connect it to the computer and open up a terminal. I'm not quite sure why because I don't use something like this:

<code>

if(Serial.available()){

yada yada

}

</code>

So I'd expect it sending data regardless of having a USB connection to the computer. Does anybody know why it doesn't send data when it's disconnected from the computer?

 

Thanks

Pictures

Im sure the other people here on LMR would agree with me when i say we need pictures to help solve the problem.
Take a clear picture of your setup. edit your post and include the Picture so we can see whats what and try and help. 
more explicit code might help.

Tom 

What baudrate did you use?

What baudrate did you use? For IR communication at 38kHz a maximum of 2400Baud is possible.