# AC - AC Adapter and Arduino for Measuring AC Voltage

**URL:** <https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082>\
**Category:** Getting Started\
**Created:** [12 September 2017 18:41 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082 "2017-09-12T18:41:21Z")\
**Posts on this page:** 18\
**Page:** 3

<div class="post-metadata">

**Author:** ![GeorgeB](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/georgeb/32/5024_2.png) [@GeorgeB](https://community.openenergymonitor.org/u/GeorgeB)\
**Post date:** [23 September 2017 13:20 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/41 "2017-09-23T13:20:16Z")

</div>

> [@Robert.Wall](#):
>
> I think you need to learn a bit more about electrical engineering, if you’re going to carry on questioning what I’ve told you a good many times now.

Fair comment but until I know otherwise I will say that Ikea **is** producing a true reflection of supply voltage. I am not an Electrical Engineer so I don’t know how it’s working but it’s following the daily 10V regular dip we see here.  
When I have more time I will try to plot OEM v Ikea v Energy Monitor to back up my assessment.

---

<div class="post-metadata">

**Author:** ![Robert.Wall](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/robert.wall/32/38246_2.png) [@Robert.Wall](https://community.openenergymonitor.org/u/Robert.Wall)\
**Post date:** [23 September 2017 13:26 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/42 "2017-09-23T13:26:45Z")

</div>

You are fully entitled to do that, but the responsibility is yours, not mine, nor OEM’s, nor Megni’s, should someone else follow your example and find that they get poor results, which is the best case scenario, or damage their equipment or themselves, or cause any harm to themselves or others.

---

<div class="post-metadata">

**Author:** ![GeorgeB](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/georgeb/32/5024_2.png) [@GeorgeB](https://community.openenergymonitor.org/u/GeorgeB)\
**Post date:** [24 September 2017 21:47 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/43 "2017-09-24T21:47:14Z")

</div>

Data for the last hour for the Ikea, OEM and a Commercial Smart Meter

 ![Ikea v OEM AC Adaptors](https://community.openenergymonitor.org/uploads/default/original/2X/9/975c3ddfe48aaaaffd565eb85f3f016f03b419d6.png)

 ![Commercial Smart Meter App](https://community.openenergymonitor.org/uploads/default/original/2X/0/0067740095137b699b8a6f30673f2313c4b8bcd7.png)

Not watched the videos that were sent to me via PM, but I will asap, thanks.

---

<div class="post-metadata">

**Author:** ![Greebo](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/greebo/32/4556_2.png) [@Greebo](https://community.openenergymonitor.org/u/Greebo)\
**Post date:** [25 September 2017 04:45 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/44 "2017-09-25T04:45:24Z")

</div>

> [@GeorgeB](#):
>
> Fair comment but until I know otherwise I will say that Ikea is producing a true reflection of supply voltage

Here’s something to consider.

Lets assume your electronic transformer is indeed producing a high frequency switched “sine wave” approximation of the mains voltage as per Figure 3 in the link sent by Robert above:

> [@Robert.Wall](#):
>
> Worth looking at: [http://sound.whsites.net/lamps/elect-trans.html](http://sound.whsites.net/lamps/elect-trans.html)

The way emonTX works is to sample the instantaneous voltage and current multiple times per AC “cycle” (each AC cycle happens 60 times per second for 60 Hz AC). if the sample is taken at the exact point in time when the electronic transformer is oscillating through 0V (as an example), the “real power” it calculates will be 0W, regardless of the current flowing. This will cause your “real” power" measurement to be even less accurate than calculating “apparent power” (ie. not using a voltage source).

You are concentrating on the RMS voltage, which by its very nature is an average and is only a very small part of the equation here.

---

<div class="post-metadata">

**Author:** ![GeorgeB](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/georgeb/32/5024_2.png) [@GeorgeB](https://community.openenergymonitor.org/u/GeorgeB)\
**Post date:** [25 September 2017 05:19 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/45 "2017-09-25T05:19:57Z")

</div>

> [@Greebo](#):
>
> You are concentrating on the RMS voltage, which by its very nature is an average and is only a very small part of the equation here.

I am now slowly starting to understand the different elements that make up the “emon” system.  
And I’m sure you are right that it would be almost as accurate just to say supply voltage is “fixed” at 240V rather than rely on the Ikea adaptor for this “variable”.  
I have watched the linear PS and SMPS videos, twice, but to be honest I can’t say it made things much clearer.

Does anyone know of a **basic** video that might make all this apparent / real power and instantaneous current / voltage clearer in my mind.

---

<div class="post-metadata">

**Author:** ![dBC](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/d/5f9b8f/32.png) [@dBC](https://community.openenergymonitor.org/u/dBC)\
**Post date:** [25 September 2017 05:45 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/46 "2017-09-25T05:45:12Z")

</div>

> [@Greebo](#):
>
> You are concentrating on the RMS voltage, which by its very nature is an average and is only a very small part of the equation here.

Indeed! I third that. I’m not surprised George sees a good Vrms correlation between the input and output voltages on these things. As far as I can tell, there’s no real regulation. The amplitude of the mains/primary swing seems to directly impact the amplitude of the secondary/output swing. For kicks I plugged an Osram ET-Redback into a variac and put a 20W bulb on its output. The variac knob appeared to be a very effective (if impractical) dimmer.

I then hooked the output of the ET to my scope (still driving the 20W incandescent bulb). You can see those big yellow blobs occurring every half line cycle (10 msecs) and when you zoom in on them, you can see a square wave at about 75kHz.

George, at best you might be able to deduce Vrms of the line voltage from the output, but as Robert and Greebo have pointed out, if you want to measure real power, you need the voltage signal to be an accurate scaled down version of the AC mains voltage signal, and it’s clearly a million miles from that.

If you’re only interested in measuring apparent power, then the mains voltage you deduce from the ET output might be more accurate than just a hardcoded 240V.

 ![osram1](https://community.openenergymonitor.org/uploads/default/original/2X/7/719a91d41291de18e164824363018c233bbd8ff7.jpg) ![osram2](https://community.openenergymonitor.org/uploads/default/original/2X/d/dd8a40ab41512887f35b02957bfc55e7c8e2bb4b.jpg)

---

<div class="post-metadata">

**Author:** ![Greebo](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/greebo/32/4556_2.png) [@Greebo](https://community.openenergymonitor.org/u/Greebo)\
**Post date:** [25 September 2017 05:45 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/47 "2017-09-25T05:45:53Z")

</div>

Have another read of this Learn page:  
[https://learn.openenergymonitor.org/electricity-monitoring/ac-power-theory/introduction](https://learn.openenergymonitor.org/electricity-monitoring/ac-power-theory/introduction)

Looking at diagram 1 and 2, imagine those Red lines NOT being the nice smooth sine waves in the picture, but instead being a “chopped up” sine wave (switched mode) as per dBC’s post above, where the average just looks like the sine wave. EmonTX is sampling the values of voltage and current at discrete intervals and you can’t know if the voltage at that interval is the “correct” value (if it was a smooth sine wave), or not, because it is NOT a nice smooth sine wave but in fact a chopped up approximation of one.

---

<div class="post-metadata">

**Author:** ![GeorgeB](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/georgeb/32/5024_2.png) [@GeorgeB](https://community.openenergymonitor.org/u/GeorgeB)\
**Post date:** [25 September 2017 06:41 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/48 "2017-09-25T06:41:36Z")

</div>

Thanks @Robert.Wall @Greebo and @dBC it’s starting to make more sense.

In my defence, as per the title thread, I set out to see if I could safely “measure” AC voltage from an adaptor I already owned. The answer appears to be **yes** but this “measure” coupled with CT readings **will not** provide accurate power usage figures. Which ultimately is the intended goal and the OEM adaptor is the best known system currently available, coupled with the CT’s.

I’m tempted to buy additional OEM adaptors but I think I will wait until the CT’s arrive and until I understand a lot more of the theory behind all this.

---

<div class="post-metadata">

**Author:** ![Greebo](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/greebo/32/4556_2.png) [@Greebo](https://community.openenergymonitor.org/u/Greebo)\
**Post date:** [25 September 2017 07:39 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/49 "2017-09-25T07:39:05Z")

</div>

> [@GeorgeB](#):
>
> In my defence, as per the title thread, I set out to see if I could safely “measure” AC voltage from an adaptor I already owned.

In our defence, you never actually explained what you wanted to “measure”. 😉

You are posting to the Open Energy Monitor forums, where “measure” regarding AC voltage specifically means seeing as close as possible to the true (but scaled down) AC waveform, nothing to do with the Vrms value (although it is included in the data sent to emoncms).

It is most important to realise that the Vrms value is not used inside the emonTX when calculating the power consumption. This line from the Learn page I linked to above is most critical (my emphasis):

> [@https://learn.openenergymonitor.org/electricity-monitoring/ac-power-theory/introduction](#):
>
> The yellow line is power at a given time (at any given instant it’s called instantaneous power) which is equal to the product of the voltage and current at a given time

This is why you need accurate representations of both the voltage and current waveforms

---

<div class="post-metadata">

**Author:** ![GeorgeB](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/georgeb/32/5024_2.png) [@GeorgeB](https://community.openenergymonitor.org/u/GeorgeB)\
**Post date:** [25 September 2017 07:40 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/50 "2017-09-25T07:40:56Z")

</div>

> [@Greebo](#):
>
> You are posting to the Open Energy Monitor forums

In the Getting Started section 🙂

---

<div class="post-metadata">

**Author:** ![GeorgeB](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/georgeb/32/5024_2.png) [@GeorgeB](https://community.openenergymonitor.org/u/GeorgeB)\
**Post date:** [25 September 2017 07:42 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/51 "2017-09-25T07:42:15Z")

</div>

> [@Greebo](#):
>
> although it is included in the data sent to emoncms

What purpose does this serve?

---

<div class="post-metadata">

**Author:** ![Greebo](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/greebo/32/4556_2.png) [@Greebo](https://community.openenergymonitor.org/u/Greebo)\
**Post date:** [25 September 2017 10:59 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/52 "2017-09-25T10:59:27Z")

</div>

Some people like to know… If you’re calculating it, why not record it?  
Maybe its interesting to see how your supply voltage varies for a certain use case?

---

<div class="post-metadata">

**Author:** ![Robert.Wall](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/robert.wall/32/38246_2.png) [@Robert.Wall](https://community.openenergymonitor.org/u/Robert.Wall)\
**Post date:** [25 September 2017 11:07 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/53 "2017-09-25T11:07:50Z")

</div>

Thanks @dBC for those pictures. They are pretty close to what I expected to see. And to you and @Greebo for helping with the explanations.

---

<div class="post-metadata">

**Author:** ![GeorgeB](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/georgeb/32/5024_2.png) [@GeorgeB](https://community.openenergymonitor.org/u/GeorgeB)\
**Post date:** [25 September 2017 11:16 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/54 "2017-09-25T11:16:10Z")

</div>

One further question:

Shop for OEM adaptor states (emphasis is mine):

_“Used to give AC voltage sample **to measure the AC RMS voltage** which in turn can be used to calculate real power, power factor, frequency and detect power flow direction.”_

Is the description a little misleading for beginners like me?

---

<div class="post-metadata">

**Author:** ![Greebo](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/greebo/32/4556_2.png) [@Greebo](https://community.openenergymonitor.org/u/Greebo)\
**Post date:** [25 September 2017 11:29 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/55 "2017-09-25T11:29:38Z")

</div>

Perhaps better wording could be …to measure the AC voltage waveform… but that may be even more confusing to beginners, most of whom will have at least heard of “RMS voltage” even if they don’t know what it means 🙂

---

<div class="post-metadata">

**Author:** ![Robert.Wall](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/robert.wall/32/38246_2.png) [@Robert.Wall](https://community.openenergymonitor.org/u/Robert.Wall)\
**Post date:** [25 September 2017 11:51 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/56 "2017-09-25T11:51:02Z")

</div>

It doesn’t actually say that the adapter measures the rms voltage, only that the adapter is used to give a voltage sample, and it is the voltage sample that is used to obtain a measure of the rms value. The same sample could be used to measure the peak, the peak-peak, the average (should be zero), the rectified average and the various factors that we use to relate those terms. And that’s without mentioning the relationship between current and voltage, which is where real, imaginary and apparent power and _their_ relationships come in.

For those who are at the bottom of the learning curve, even @Greebo’s version could be shortened to “to measure the AC voltage”.  
The real problem with the shop wording is, the rms voltage is **not** used to calculate real power, nor the direction of power flow (but the waveform at any instant **is** ).

---

<div class="post-metadata">

**Author:** ![GeorgeB](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/georgeb/32/5024_2.png) [@GeorgeB](https://community.openenergymonitor.org/u/GeorgeB)\
**Post date:** [25 September 2017 12:07 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/57 "2017-09-25T12:07:22Z")

</div>

> [@Robert.Wall](#):
>
> The real problem with the shop wording is, the rms voltage is not used to calculate real power, nor the direction of power flow (but the waveform at any instant is).

@glyn.hudson  
That was my real point, despite my emphasis on RMS. As a beginner I looked through the docs and the shop offerings and then asked myself do I already have one of these “very special adaptors”. From the very basic, read wrong, description in the shop the answer was yes. Which turns out to be a resounding no and I’m pleased I bought the OEM adaptor.

---

<div class="post-metadata">

**Author:** ![Robert.Wall](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/robert.wall/32/38246_2.png) [@Robert.Wall](https://community.openenergymonitor.org/u/Robert.Wall)\
**Post date:** [25 September 2017 12:23 UTC](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082/58 "2017-09-25T12:23:22Z")

</div>

I’ve already sent a PM to @Gwil about this.

[Previous page](https://community.openenergymonitor.org/t/ac-ac-adapter-and-arduino-for-measuring-ac-voltage/5082.md?page=2)
