Quote Originally Posted by ERMEGM View Post
This is all new to me as I've been using opto's. Never looked at the datasheet that way as I had never intended to connect it directly.
OK, let's start from the beginning... You said you had some opto that failed you. Optos are sensitive to reverse voltage and forward current must be limited too. Your circuit will be on a car so you must protect your opto. So, please forget about those resistor divider and/or zener and use an opto the proper way:

Name:  Opto.png
Views: 28210
Size:  6.5 KB

The maximum continous current for the PC817 is 60mA. With a 1k resistor it's about 60V continous. Note the 1N4004 to protect the LED from any reverse voltage (spikes can occur). Trust me, do not try to connect your PIC to a vehicule voltage without an opto. At work I maintain our GPS tracking system which has I/O to monitor some things (sorry, don't have time to explain) and some I/O's are tied almost directly to the CPU and guess what? They fail some times!