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?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?)3) do you know some examples that might help me to start?4) what type of ir sensor will work for thisand how do i connect it to the atmega?

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.