wvmarle:
Of course - didn't think about that. That resistor has to deal with the heat.
The power rating of the resistor depends on the actual voltages and how long it lasts. I was expecting you see spikes, so short pulses only. Then it's no problem.
The value of the resistor is not very critical. It is mainly based on being as big as possible, supplying just enough current to the opto at 12V input for it to pull down the output signal. So that's what you should test as well: the lowest voltage that you want to detect.
Dear Marle,
Thank-you very much, your answer helped wonderfully.
I've ordered some larger resistors, and am currently using 6 * 33K Ohm 0.25w resistors in the meantime, in parallel, to properly disperse the heat generated.
I can use this technique to tell if a telephone line has been connected or disconnected to one or two wires using an arduino now.
I will have to keep the arduinos ground separate to the line's, otherwise it will introduce a certain degree of "earth contact" when I am testing the line from the other end.
For this, I will design it to be remotely carried & battery powered only.
Thank-you, again.