Relay module Terminal connections

I’ve tried to make a complete circuit of the relay. I’m not 100% sure about the transistor, but that’s what came up on Farnell when I made a search for “S8050”.
Well, I’m actually not 100% sure about anything, but I did the investigation as best I could and it actually seems to make sence, so I guess its allright :slight_smile:

Here you have it:
http://www.wit.dk/Seeedstudio_Relay.pdf

Btw, can anyone tell me the function of diode :question: