Here is a fairly complete application note that may have a lot in common with your project. RMS measurements of mains voltage and current, transformerless power supply, etc.
Here is a fairly complete application note that may have a lot in common with your project. RMS measurements of mains voltage and current, transformerless power supply, etc.