Your circuit is very dangerous as it has DC voltage of 280V AC. It is better if you use a 230V AC to 9V DC transformer and then rectify the 9V AC to get DC unregulated and then use a potential divider to scale down that DC to 0 - 5V DC range and feed it to adc pin. Any change in 230V AC will also result in change in 0 - 5V DC.
Aha, nice! that's what i thought it will be.
can you post a circuit schematic of your suggested circuit? cuz that will be handy.
plus, if the input AC rms voltage exceeded the nominal 230v rms input voltage of the transformer to a value say 300v... what will happen?
I will use a voltage divider of 15k and 100k which can limit the current to a good low value and the voltage will be good too.
Vout = 0.15 Vin
so if Vin was 9v (as your transformer gets 230v to 9v): Vout = 0.15*9 = 1.35v which is a fairly low voltage.
and if Vin got up to 12v it will be 0.15*12 = 1.8v.
so the rms value will be calculated as follows: 230/1.35 = 170 which is a compensating factor or so...
1.35 * 170 = 230v rms
1.8 * 170 = 306v rms
^ is that a good way to calculate stuff?
I will connect a rectifier bridge (will have 2 diodes drop voltage = 1.4v) and thus I will get the peak voltage of the secondary windings of the transformer.
if the secondary windings' voltage is 9v (rms right?) when 230v is input... 9v*1.414 = 12.17v peak.
this Vpeak is gonna be fed into ADC pin so should I base my calculations to deal with peak voltage THEN multiply it by sqrt(2) to get RMS (sinewave only here)?
is there a way to make the calculation suitable for ANY AC signal other than just sinewave?