Relay driver circuit with input referenced to positive

driverinputrelay

I built a standard relay driver circuit as shown in the first schematic here:

enter image description here

It works as expected, but I now realized my input is between the positive terminal instead of ground.

How can I adjust the circuit to handle the input that varies between positive (12V) instead of ground?

Best Answer

Just turn the circuit upside down:

enter image description here

and change the transistor for a PNP one. Eg. BC327. Notice the supply rails, the diode and the transistor symbol.

A voltage near Vcc will turn the relay off.