I would like to implement some 24V I/O via a pic. I am having trouble deciding what type of protection is best. I have used standard 4n27 opto's with 1.3 Vf and 60mA If. This works with a 390 ohm input resistor, but what if the input voltage jumps up to say around 45V. I would like the input to come on between 18 and 45V, with 22-30 being normal and anything above 45 would be considered out of the design criteria for the system. So, with 45V, I get a 820 ohm resistor with a 3 W capability needed which even if i knew where to get one, would get very hot. Is there an easy way to do this??? what happens if I put a zener between the input and ground, say a 27V one. Would a TVS work also, ( I could then account for a reversed Input).. Thanks for any Ideas.