I am making a circuit for a button to be far away from the circuit, about 50 meters round-trip. I have went decided to use an optocoupler to protect the uP from the worst of the outside environment and hopefully just get a blown optocoupler rather than a fried uP. The optoucoupler will be driven by a constant current IC to 10mA.
I have made a minimal schematic of both configuration.
What would be the difference in choosing high or low side configs? I am not particular in which offers better response time since a mechanical button can only be pressed very few times per second (but I am keen to know which one offers better response time). I am more concerned about which configuration is less susceptible to failure such as ESD from let's say a worse one, lightning. I went ahead and placed a TVS diode which should clamp at around 40 volts, the highest the CC IC can handle. I should probably increase it a bit more to make sure not to conduct so that the LED won't turn on.