Q:

high voltage grond

In the following circuit I'm using a Raspberry Pi to power a solenoid.
I want to prevent any current from damaging my Pi in case I connect something wrong (like D2). However, I am unsure whether I could damage my Pi via the ground connection.    
The Pi runs with on 3.3V-5V while the circuit runs on 19V .   
Could I use something like a voltage regulator between the transistor and the ground connection of the Pi to bring the 19V down to 5V. If so, how?

simulate this circuit – Schematic created using CircuitLab

A:

In most circuits you specifically want the grounds to be shared. If you eliminate the 5 volt regulator in your circuit, it will function fine provided the transistor can handle the 19 volt supply and the current drawn by the solenoid. The diode coming off of the processor is overkill but does provide protection from a shorted transistor.
If you wish to completely isolate the solenoid supply so that they do not even share a ground, then you should look at opto isolator designs. 

