Go Down

### Topic: Atmel Microcontroller with Bipolar ADC  (Read 1 time)previous topic - next topic

#### GolamMostafa

##### Mar 16, 2017, 02:27 pm
1. My upcoming hobby is to build a True RMS Voltmeter.

2. I need to sample both the positive ans negative portions of the Line Volatge.

3. Is there any Atmel MCU that contains bipolar ADC?

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### KeithRB

#2
##### Mar 16, 2017, 04:16 pm
Just use a precision rectifier.

(Or do like an RF bolometer. Use the AC to heat a thermistor and monitor the change in resistance. Now *that* is True RMS.)

#### MasterT

#3
##### Mar 16, 2017, 06:06 pm
You can read negative half wave simply biasing input at Vcc/2 .
https://learn.openenergymonitor.org/electricity-monitoring/ctac/how-to-build-an-arduino-energy-monitor?redirected=true

#### KeithRB

#4
##### Mar 16, 2017, 08:32 pm
You can read negative half wave simply biasing input at Vcc/2 .
https://learn.openenergymonitor.org/electricity-monitoring/ctac/how-to-build-an-arduino-energy-monitor?redirected=true

If he really wants a "True RMS" meter he needs to account for the DC component.

#### GolamMostafa

#5
##### Mar 17, 2017, 04:40 am
If he really wants a "True RMS" meter he needs to account for the DC component.
1. By definition:

TRMS value of alternating wave of arbitrary wave shape

= sqrt ( additions of the squares of samples over 3-5 cycles (at least 10 times
of signal frequency; fulfilling of Nyquist Criterion is not enough in practice) and then divided by sample
interval)

The above formula automatically includes the DC component of the signal. Sampling, squaring, addition,
division, square root, and finally normalisation; all these can be done in a pretty way using bi-polar ADC
(preferably 16-bit) and Microcontroller.

2. As I am not finding my requisite in the Arduino Family, I have decided to hookup ADS7805 (16-bit Bi-

3. I am afraid that my data item (after additions of the squares of the samples) might be greater than
32-bit, which is not supported by ArduinoMEGA.

4. Is there any member of Arduino Family, which supports 40-bit or 56-bit or 64-bit data size?

#### KeithRB

#6
##### Mar 20, 2017, 05:59 pm
Unfortunately, there is no listing of limits.h for every arduino. But the Due uses 32 bit ints. I am assuming the longs will be 64.

#### JohnRob

#7
##### Mar 21, 2017, 01:26 am
I'm going to guess it might not meet your basic goal (I'm thinking this is an exercise in "can I do this"),
but if not there are some RMS to DC converter IC's you could use.

JR

#### GolamMostafa

#8
##### Mar 22, 2017, 10:33 am
I'm going to guess it might not meet your basic goal (I'm thinking this is an exercise in "can I do this"),
but if not there are some RMS to DC converter IC's you could use.

JR

My ultimate target is to measure the RMS value of a distorted wave shape (produces by non-linear semiconductor loads), and then use it for the calculation of effective power factor of the load. As far as I know, the stand alone ICs (RMS to DC) are designed to see pure sine wave (or close to it) for the production of proportional output. There are some mathematical calculations which can be carried out by ArduinoUNO/MEGA/DUE.

Thanks for the feedback.

#9

#### GolamMostafa

#10
##### Mar 22, 2017, 05:26 pm
Google knows a lot more than you:

Yes! Google has response to my inquiry; but, I am too late to submit the question; instead I made a guess which could not spit even a bit of dirt on the dignity of AD636 and others; but, on me. Now, I know that these ICs can very correctly produce proportion DC in response to the excitation of 'complex wave' (ac wave of any shape).

#### KeithRB

#11
##### Mar 22, 2017, 05:45 pm
Not any shape. You are supposed to say that your waveforms will have a crest factor of more than 6. 8^)

It is much funner with the arduino anyway. Next you are going to be asking for an integer square root algorithm!

#### GolamMostafa

#12
##### Mar 23, 2017, 04:42 amLast Edit: Mar 23, 2017, 05:35 am by GolamMostafa
Not any shape. You are supposed to say that your waveforms will have a crest factor of more than 6. 8^)

It is much funner with the arduino anyway. Next you are going to be asking for an integer square root algorithm!
1. (a) Yes! Peak could be as large as 6*200 mV = 1200 mV. But, the region to the left and right
of the peak bounded by the cycle zero-crossings can take up any shape. This is an
example of a complex wave shape.

(b)  When signals of different frequencies are added (Vm1 sin(xwt+y1) +
Vm3sin(3wt+y3)+Vm5sin(5wt+y5)), we come up with a complex wave.

(c)  So, what is incorrect in saying 'any wave shape?'. The data sheet of AD636 has put
restriction on the peak by specifying the crest factor in order to prevent the input
electronics from being over-stressed (perhaps damaged); but, it has not said anything
about the form factor which is a quantitative measure of the irregular geometrical shape
of a signal.

2.   Yes! Your guess is correct. I have been looking for an ATmega32 (ASM based and not C)
algorithm (preferably Babylonian) for computing square-root of a number range : 000000 -
065535 (decimal). The Arduino IDE has the function sqrt(); I should straight use it. Why
am I looking for the ASM version? As you have said - 'Can it be done?'

Crest factor = up to 6 can be accommodated with less than 0.5% additional error (Page-1).
How is it 'more than 6.8' in your post#11?

#### KeithRB

#13
##### Mar 23, 2017, 03:39 pm
That was 6(period)(space)(8 for smiley)

The crest factor has all to do with accuracy, not protecting the hardware.

You, of course have the same issue. You will need to sample at  more than twice the highest harmonic you want to capture.

#### GolamMostafa

#14
##### Mar 23, 2017, 05:21 pm
That was 6(period)(space)(8 for smiley)

The crest factor has all to do with accuracy, not protecting the hardware.

You, of course have the same issue. You will need to sample at  more than twice the highest harmonic you want to capture.
many thanks for cordial conversation.

Go Up