Eletric dog fence and Arduino

In general, when hacking a piece of gear to do something it wasn’t originally designed for, you should take some precautions to protect what you are interfacing to. optoisolators are particularly good for that. Then you KNOW that your arduino won’t be getting a big voltage spike shoved down it’s throat. Plus, it doesn’t care what voltage your arduino is running at. Basically, you replace the LED with the opto’s LED and the phototransistor side of the opto runs straight into the arduino input. Make sure you use internal pull-ups (set input mode, then output a HIGH). Your arduino will see a low when the LED would have lit up and a high the rest of the time. Look for one with NPN or darlington output. Sometimes called optocouplers. Some good optos to use are 4N27, 4N35, H11D1.