I'm currently handling a project that requires a transformer to step down 230VAC to 6VAC, from there, further scale-down to a voltage that is in the readable range of the microcontroller (as not to damage it due to high voltage input.) The microcontroller will process the read value and display the voltage measured from the AC wall supply, making the whole system function as a voltmeter.
I am thinking of a way to convert the AC sine voltage from the transformer's output to pulsating DC and with the help of 7805 voltage regulator and some capacitors, I'll be able to get a constant 5VDC as the supply for the microcontroller.
The question is: Where will be the pin for the microcontroller/components to connect to as voltage reference/GND? I was thinking that the 'Earth' from the AC wall supply could be used as the common GND but after some practical testing via oscilloscope, the readings are not as expected.
I need some clarification on this.