Using Transistor on Ardupilot Pixracer Pro

Hey, I want to control an electromagnet with pixracer. I will use S8050 NPN transistor(I gave the data sheet below). How should I wire and which resistor should I use I prepared a chart. I added it below. Can you please control it? Is it correct? Thanks.

I shared this post but nobody saw it. anyone help

The current at the output can reach around 15 mA; check processor specifications.

Place a diode in parallel with the relay coil (anode to positive).