Best way to measure 230VAC
The Vishay IL300 is an analog optocoupler with excellent linearity (0.01 % servo). It contains 2 identical photodiodes, one of which you use in a feedback loop.  



Obviously \$V_{CC}\$ and \$GND\$ on the left hand side (power of U1 and the optocoupler's pin 3) are different and isolated from \$V_{CC}\$ and \$GND\$ at the right.  


  Note: Servo linearity means that neither LED nor photo-diode need to have a linear characteristic (they don't), but that they can achieve this linearity by using them in a feedback system like the one shown in the schematic. The conditions for such linearity are good matching between photo-diodes and a good matching of the current transfer function between LED and either photo-diode.