RS232 with Opto-Isolation
I had to once interface an high voltage circuit to PC, The uC had to communicate thru RS232--Comm port--Serial Port.The circuit derives power from PC but does not load the PC supply. Any voltage above 5V applied to the PC connectors may lead to damage of motherboard in PC. Old PCs were more vulnerable but PCs today maybe a bit rugged at the Ports. Due to internal current limits and clamping.
The VCC, VDD and Agnd are derived from PC no other power needs to be applied on PC side of opto. On uC side of opto the uC power supply lines +5 and gnd has to be used. There is no copper link between the two sides and depending on opto a 1KV isolation is possible if PCB is well designed. The PCB should show the visual isolation above and components should be laid on separate areas of PCB to prevent creepage.
The LEDs are to indicate the port activity Rx and Tx, they are not required once testing is over. The circuit can be simpler, but this worked for me and it is not tested at very-high buad rates.
The levels of RS232 are not TTL like 0-5 we have both polarities +10 and -10. The circuit has to change that to drive the Opto Leds. Read more about serial port here.
And some RS232 software. here.

