You can easily drive a relay 5 ,12 or 24 volts easily, giving a very small signal and driving a transistor . As known, out from microcontroller is just a few milamps, so is not enough to drive straight a relay that drains around 30 mA.
In the circuit below, transistor base current is 304μA and Ic is 25 mA. Relay is 12v. Signal is 5v .
I made this small circuit on my expansion boards. I try to make it exactly as the schematic for better understanding