UART serial between defined ports

At the and I will need to send data with an LED and I want to use the serial communication functions because arduino makes the data framing by itself so I won't have to worry about it. The idea is: TX is an LED, RX is a photodiode, between these elements I want UART serial communication, but for now I just wired together the 0 and 1 pins (as transmitter and receiver) in order to play a little bit with the functions and see how it works but I couldn't make it work, that's why I am asking.