Toggling a high-power relay with a Microcontroller
The IRF530 transistor is rated at 10A.  It is more than adequate for controlling a load of ~0.1A (2.2W / 24V).*

The diode D1 is required to protect the transistor from the reverse voltage generated by the collapsing magnetic field of the relay coil when you turn it off. I would recommend using something more substantial like 1N4002 or higher. That diode will handle quite a lot of power (for a few milliseconds) and I would be afraid that 1N4148 is rather wimpy for that application.

Remember to use a logic-rated ("sensitive gate") FET or you won't be able to control a 24V load from a 5V microcontroller output.


I have a handy Ohm's Law calculator online here: http://www.rcrowley.com/eirp.htm


I used it to calculate the current from your statement that the coil voltage rating is 24V, and the spec sheet you referenced says that the coil wants 2.2W