Preferred way of interfacing relay coil with active low output from MCU
If the microcontroller and relay run from the same supply voltage, then your top option using a PNP transistor is probably the easiest.  It's just like the typical NPN low side drive, just flipped around.

The optocoupler circuit you show is not good.  Most optos don't have the output current capability to drive a relay, especially relays with low voltage coils that can be run from the same supply as the microcontroller.  Take a look at the CTR (current transfer ratio) of the opto.

However, these digital signals are coming from a microcontroller that can drive them with arbitrary polarity.  Unless these are very special open drain outputs or the like, simply invert the logic in the firmware.  Now you have active high signals, which can drive a low side NPN switch directly.  That also allows for powering the relay from a higher supply voltage, which is a good idea when possible.  I go into more detail on that here.

For completeness, here is a way to drive a relay from a active low digital output, but where the relay coil requires higher voltage than the digital logic:



Again, it is only worth doing this if the digital signal can't be inverted to be high when the relay is supposed to be on, or you are stuck with a open drain output.  This is very rarely the case when the signal is coming straight out of a microcontroller.

Q1 is in the common base configuration.  It acts as a switchable current sink, to voltages higher than the 3.3 V supply.  When the digital output is asserted, the bottom end of R1 is held at ground.  Figure about 700 mV for the B-E drop, so that leaves 2.6 V across R1.  (2.6 V)/(2.4 k&Omega;) = 1.1 mA.  Due to the gain of the transistor, most of that will come from the collector, not the base.

That provides about 1 mA base current for Q2.  The relay I used as example draws 27 mA at 12 V, so this circuit requires Q2 to have a gain of at least 27.  That particular transistor has a minimum guaranteed gain of 100 at both 10 and 100 mA, so there is a comfortable margin.

D1 is not optional.  It gives the kickback current from the coil a place to go that doesn't require creating a high voltage and blowing out Q2.