Optoisolators are often encouraged for isolating signals controlling higher voltage loads. The typical example is a low-voltage microcontroller controlling a motor or solenoid operating at a higher voltage. In this hypothetical scenario, the power supply for the microcontroller and the power supply for the high voltage load are entirely separate. In a lot of real cases, though, the microcontroller is actually being powered by the same power supply, just via a voltage regulation circuit. So this is my question:
Let's say there's a single 10 V power supply. One subcircuit regulates the 10V down to 5V that powers a microcontroller. The microcontroller sends a signal that controls a solenoid operating directly from the 10V supply. Does putting an optoisolator between the microcontroller and the solenoid control circuit serve any purpose or is it pointless because, ultimately, the two power supplies are connected anyway?