I noticed that the AC line frequency varies in span of 0.4 Hz and period of several minutes, so that I wanted to examine the long term variation of AC line frequency and voltage. This is a project to build the line voltage frequency monitor. It is not a completed instrument but a simple measurement adapter that designed to be embedded in some measurement system with PC or microcontroller.
Figure 1 shows the schematic of the built line voltage frequency monitor. It does not need any external power, because it is powered from the AC line being measured. The measurement circuit consumes only several mA, so that the power supply consists of reactance dropper, aka capacitive power supply, often used for low power applications. The reactance dropper is a kind of shunt regurator that does not use a resistance but a reactance for dropper element. It can drop the voltage with no energy loss at the dropper element.
C1 in the schematic is the dropper capacitor and its capacitance is selected to set the current, determined by Vin/Xc, higher than the load current. D1 and D2 are for half-wave rectification, not full-wave rectification in typical case, because it needs to fix the ground potential to AC line for voltage measurement. The half-wave rectification requires a value of dropper capacitor two times larger than full-wave rectification. The zener diode D1 is a shunt element to limit the output voltage and the exceeded current is bypassed through the zener diode. R1 is a protection resistor to limit the surge current on power-on. C1 will need to be discharged with a high resistance to avoid electric shock if no discharge path is exist when input is disconnected.
U2 is a Microchip ATtiny45 microcontroller. The input voltage is divided with resistors and input to the ADC without buffer amplifier. It will not a problem, because the source impedance becomes about 2.5 kΩ from Thevenin's theorem. In order to eliminate the calibration, 1% high precision components are used for reference voltage (LDO) and voltage divider (Ra/Rb/Rc).
Measurement data is transmitted as serial data in constant interval. The serial interface is isolated with a opto-isolator U3 for using non-isolated power supply. When the destination is a microcontroller, attach the opto-isolator output to UART RXD with a pull-up resistor in several kΩ.
Input waveform is sampled in 9.6 ksps. The value of sampling frequency is determined to make a timing of software implemented serial transmission for lack of UART in ATtiny45.
The AC line frequency is measured in triggers at every zero-crossings of A-D value. The range of variation of AC line frequency is usually ±200 mHz from nominal value and it needs to be measured in resolution of several mHz at least. The resolution of frequency measurement in direct counting method is 1/Tg Hz, where Tg is the gate time to count the triggers. When it measures the frequency in interval of 5 seconds, the resolution becomes 200 mHz. It is not sufficient at all.
For low frequency measurement, the reciprocal method is usually used. It measures the trigger cycle time T and then calculates the frequency by f = 1/T. The frequency resolution of the reciprocal method is t/T² Hz, where t is the time resolution of cycle time T. In this project, t is 1/9.6k and the resolution becomes 200 mHz at 50 Hz of input frequency. It is still not sufficient. However the real implementation of reciprocal method measures number of cycles ncyc as input frequency and the resolution becomes t/T²/ncyc Hz. In this project, it is measured in interval of 5 seconds and the resolution becomes about 1 mHz at 50 Hz, 1.25 mHz at 60 Hz.
The voltage is obtained in 'Root of Mean of Square' for true RMS measurement. The resolution of on-chip ADC is only 10-bit and the theoretical resolution is 400 mV. However the resolution of 100 mV is achived by meaning process and dithering effect due to input noize.
The output serial format is N81 4800 bps and the measured values are sent in CSV format as follows:
<Time>,<Voltage>,<Frequency>[CRLF] Example: 0:00:00,100.4,50.068 0:00:05,100.7,50.073 0:00:10,100.7,50.073 0:00:15,100.6,50.068 0:00:20,100.5,50.062