I want to make a mains voltage sensor for a power meter project. Since space is an issue, I looked for an alternative to a full size mains transformer. Is possible to use a voltage dropping capacitor to lower the mains voltage to about 12v and then feed it in a 1:1 small transformer for separation ?
Not a legal or safe way to do that.
Reason why is at 60HZ a .22uF capacitor will allow 10mA to flow into a short circuit, plus the capacitor needs to have a voltage rating 3 times the line voltage, and be a high quality Mylar film or polypropylene to be safe, but the voltage tracking will be very non-linear.
So how do you know what load your smaller transformer is as a reactive circuit? (the capacitor in series with the transformer primary).
The best and safest and legal way to do this is to buy a transformer rated for the line voltage with an output 1/10th to 1/20th the line voltage (if using 1/20th line value you can use a tiny thread of software to multiply the results x 2.).
The transformer output is converted to DC peak value with a rectifier and capacitor. 70.7% of that value is your RMS value. Add a 10K 1 watt resistor across this capacitor to act as a minimal load, and to bleed off the charge if not in use.
Use a 1 or 2 watt potentiometer to adjust the output so your AC volt-meter is tracking the line voltage fairly close. It will work ok over a 50% change in voltage, but at low line voltages both designs would start to become non-linear, with a reading lower then is actually on the AC line.
NOTE: Seriously consider adding a properly rated fuse to the transformer primary, regardless of the design. If anything goes wrong, as in a short circuit or severe over current the fuse will pop and stop any chance of a fire.
I have done this to convert a small 110 volt transformers to 240 volt. I selected the capasitor by trial and error. 0.1uf to 0.2 uf depending on the manufacturer of the transformer, there were two, same physical size. I checked the voltages, mains = 240 transformer = 110 capasitor = 300. Are we getting close to a resonant circuit? I measured the transformer inductance and plugged values into an online resonance calculator. 200Hz. This is a cheap and cheerful fix. I have never seen it used for a transformer.