I have some questions regarding the project in the title, lets say that i have 2 x 50$ robot electronic boards whit atmega168 and i want to use an 5w ir led on one of the board to communicate with the other one.
the ir led is : http://www.ebay.co.uk/itm/5W-Infrared-IR-LED-850nm-80-Lens-Night-Vision-IR-Camera-/230700709233?pt=LH_DefaultDomain_0&hash=item35b6d57571
Not sure why you would want a 5W LED for IR comms?
A regular IR LED is a bit above 150mW, so a 5W IR LED would reach less than 6 times of what the 150mW will.
That is, if it was a ~950nmLED, but the 5W device is a wavelength much better for light on a night cam and it will not perform as well as a regular T1-3/4 (5mm diameter) IR LED at 950nm.
The 5W device is very wide angle, so will have little enegy in any single point compared to a more narrow device.
so my questions:
1) how do i connect the big 5w led on the microcontroler so that i can create an specific pattern of emitting light and not damaging the atmega?
You don't, if you want it to work optimally.
2) by using this led and an ir sensor on the remote atmega can i create and recive an patern of some sort.(can i use a ir protocol to do this?)
Only at a short distance - make a cluster of the right wavelength LEDs instead.
If you want both to be able to send and receive, you need two instances of everything of course.
3) do you know some examples that might help me to start?
Plenty, but first you need to specify what you want to achieve, in terms of distances and angles (sideways as well as up/down).
Did you consider either "TV-receivers" or IrDA?
4) what type of ir sensor will work for thisand how do i connect it to the atmega?
For IR comms, a longer wavelength is much better as mentioned, but if you need large range and/or don't always have line-of-sight between them, radio is a far better option.