I am trying to control a 12 VDC Bosch Automotive relay with an RPi. I am using a separate 12 VDC power supply to trigger the relay. The RPi is using GPIO18 which is connected to a 1k resistor, which is connected to the base of a 2N2222 transistor whose collector is connected to the relay output and emitter connected to the 12 VDC power supply negative lead.
I am not sure if the correct grounding of the RPI would be past the transistor to the 12 VDC PS? See line with "?" in below diagram. I have read in multiple posts that RPi GPIO does not need grounding, and then have been told it could not work without grounding (but mine actually does). I would love clarification and correction of my schematic if I have it wrong.