9vac to 4n35 to ardunio

optocoupler/phototransistor http://www.vishay.com/docs/83717/83717.pdf