How to check voltage amplitude and frequency? RMS to DC?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to check voltage amplitude and frequency? RMS to DC?

1,616 Views
eduardobuezas
Contributor I

Dear Colleagues: I'm trying to check a 380 volt amplitude and frequency with an MC9S08QG8. My initial idea is to compose a RMS to DC circuit and then send the DC to the microcontroller. The fact is that I couldn't find in my market the AD637 or any similar IC. Do you know which circuit may I use instead of or replacing this IC, or if there is another idea instead of RMS to DC? Any other had this inquiry before? Thanks in advance. Regards. Eduardo

Labels (1)
0 Kudos
2 Replies

972 Views
Encoder1
Contributor III

Hi Eduardo.

You do not need special hardware to either measure mean or RMS voltage/frequency at 50/60Hz with an 8 bit S08 uCU. You need only a resistive divider and the ADC converter with a suitable sample rate to cope with the ADC dynamical range. Better than 1% precision may be achieved either on mean or the RMS measure.

A splitted power supply with a virtual ground at 1/2 Vs may be used or an op-amp based differential amplifier/buffer is required to provide ADC input with a dc offset (0Vin = 1/2 Vref).

Incredibly enough, a trasformer based interface, while more safe for intrinsic insulation, is usually not very precise if you use general purpose low power transformer (1/2-2W). In fact these transformers vary a lot the transformer ratio (3 to 10%)  with temperature and self heating because they are not linear. No matter if they are not loaded. There are also properly designed transformers for measuring purpose but they are uncommon and costly.

RMS measure

I used a 9S08SE8 runnig at 5Vdc / 2MHz busclock. The uCu was able to take 3 series of samples in real time at 1500samples/s, one for the voltage, another for the current, the third for the differential current between the Ac wire pair @ 230Vac. They were a total of 4500 samples for second.

To achieve RMS value 600 current (I, Id) and voltage (V) samples (400ms) were squared and summed in 3x 28bit accumulator, then square rooted to provide a 14bit result with a nice precision and dynamic range. Contemporary they were multiplied (IxV) and summed in a fourth accumulator to provide a real power measure (W). At the end the power factor was derived by performing PF= W/(VxI).

10 bit samples with offset were transformed in 2's complement signed samples and processed in assembler in real time. After the sample campaign which takes 400ms, uCU stops sampling for 8-10ms to process the final square roots, scale conversion, VxI, W, PF and show them on 2x20 LCD display.

The circuit was a mains power analyser running on 230Vac able to measure <1W up to 3000W with 1% precision and was presented in an italian amateur magazine 3 years ago. Here enclosed is the original electrical diagram. The code was 2600B flash, RAM used was <256B.

Mean value

This is much simpler. In this case I used a 9S08SH4 to measure the 3 line voltages of a 3-phases+N 400Vac line. As in the previous design the circuit was self-powered by a 230Vac line of the 3 available. A differential op-amp amplifier provided the input interface for each of the 3 ADC channels. The fourth op-amp in the package was used to generate and manage a virtual ground at 1/2 Vs. The uCU runs at 4MHz bus-clock and takes 3x4800 samples/s i.e. 14,400 samples/s. Each line is separately processed in frames which are as long as 1 semi-period of the incoming voltage (48 samples / 50Hz, 40 samples / 60Hz). The 10 bit binary offset samples in the frames are converted to 9 bit absolute value samples and summed in their frame accumulators. When the frame is full it is averaged with the previous frames in a "trend averager" which approximates a peak rectifier with a definite attack/release TC. No diode nor real RC are present. There are no dead times and the process is completely real-time to provide an adequately fast alarm in case of overvoltage-undervoltage.

The matematics involved is still in assembler but much easier than in the RMS routines. Precision is still some 1% with readily available, low cost components. No trimmers or adjustments are required.

The circuit is an overvoltage-undervoltage front end safety switch. An excerpt of the circuit's diagram is provided.

The code was <1100B flash, RAM usage <120B including 64B stack.

0 Kudos

971 Views
santiago_lopez
NXP Employee
NXP Employee

Hi Eduardo,

Maybe a good idea would be use a Transformer or a voltage divider using two resistances to lower the voltage to levels that can be handled by the microcontroller. Once in the proper levels, the microcontroller's ADC can be used to determine the signal amplitude and frequency provided that the signal frequency is lower than the ADC maximum sampling frequency.

Saludos

0 Kudos