Int value servo control and program flow

I am using an opto-coupler. 5vac rectified -> DC -> opto-coupler. This mapped to pin D2 of the Arduino. Im at a bit of a loss as to how the pullup resistor would play into the scheme. The rectifying bridge may verywell result in 120hz however it is isolated and is only used for the opto-coupler signaling.

The original circuit used a 2n2222 transistor but that wasnt an ideal setup for obvious reasons. The author reduced the 220AC to 12DC and used a voltage divider to further lower the input voltage to accomodate the 2n2222. I however adopted the 2n2222 for controlling the relays on the PCB.

This setup was from an example I got from Electronic Clinic. There may be better ways to measure AC current but it seemed like the simplest to build when I started this project. I am completely open to suggestions for a better method.