Arduino electric fence

The link you gave:
http://danyk.cz/ohrad_en.html

Shows a 220nF capacitor. May I ask why you are using a 220uF capacitor, 1000 times as large? That is going to tend to wear your relay contacts away. The 220nF capacitor is supposed to resonate with the primary winding, 220uF is far too large. It also needs to be a nonpolar capacitor.