AC - AC Adapter and Arduino for Measuring AC Voltage

as moderator could you please move my user category up because it say’s I have got to wait 9 hours before I can post again.

Thanks
George

Weighing the Ikea adaptor with an Ikea scale it is approximately 95g.

I believe the Ideal Power adaptors are around 250g.

Could you please provide the workings for say the 158 constant of 14.375V no load as both constants you calculated are about 1.5 to 2.0% different to my calcs.

Edit: Just 8 hours now before I can post to the Discourse forum again.
Edit: Just 4 hours now.

You are a “Basic User” - and I didn’t think that restriction applied to you.

It is very clearly NOT a true transformer, which is what I suspected all along. So I’m afraid it can’t be used to measure the mains voltage. It will in all likelihood give a constant output irrespective of the mains voltage.

A page with all the theory for calculating the calibration coefficients is in the ‘Learn’ section. I was guessing and rounding numbers because there was no point in being accurate as you didn’t have any reliable information about your transformer (which turns out to be not a transformer after all - at least, not one operating at 50 Hz!).

Thanks @Robert.Wall I have now ordered the 9V adaptor from OEM. More out of curiosity than anything else.

May I ask what AC - AC adapters are commonly used for around the home? I believe some telecoms equipment use AC but none that I have.

I was just wondering if these adapters are common place around the world as I have never seen an AC - AC adapter.

They are not nearly as common as the d.c. regulated or unregulated sort. I have/had one that came with a router (I think - this was a long time ago), but that’s the only one I’ve had apart from OEM ones.

1 Like

12V domestic halogen lamps (MR16 downlights for example, or many of the table lamps sold by Ikea) often run off 12V AC and almost exclusively now, use an electronic “transformer” (like this: https://www.bunnings.com.au/hpm-12v-downlight-transformer_p4390263). The first generation used Iron core transformers but they were prone to overheating, which combined with being chucked in a roof space sitting on paper faced gyprock under fibreglass insulation made them a significant fire hazard (at least here in Australia).

Needless to say, these electronic transformers are totally useless for monitoring voltage as required by an emonTx

1 Like

@Robert.Wall once again you go above and beyond on the help for fellow OEM users - keep up the good work :slight_smile:

2 Likes

Thank you, sir.

Although you can never please all of the people all of the time, it’s nice to know that at least someone appreciates my efforts once in a while.

2 Likes

Yes that’s where I got my AC - AC adapter from but as you say they are not suitable for monitoring voltage.
Seems like the correct adapters are quite rare and a big majority of households simply don’t have them.

If you were to take your lighting “transformer” apart, what I think you’d find is a rectifier providing a d.c. supply at possibly 300 V or so, and that would feed an oscillator designed around a ferrite transformer, quite likely working somewhere in the 20 - 25 kHz region so as to be above the normal hearing range and high enough to be able to use a very small (and light) magnetic core, but low enough to keep the losses under control, and there would be a high current, low voltage secondary winding that feeds the lamp. The lamp won’t mind that frequency, and there will be almost zero flicker as the filament won’t cool significantly between alternate half cycles.

And again I’m guessing, but the reason you could not read an open-circuit voltage was because it detected the lamp wasn’t there, and shut down to save energy.

Because we want a faithful replica of the mains wave, that clearly won’t fit with our requirements.

They are not that rare, but not easy to source, and a better, cheaper and legal way to get a safe representation of the mains wave would be nice. A small current transformer fed by a multiplier resistor has been suggested, but until an enterprising individual or firm can enclose one in a suitable housing and obtain the necessary certifications for all the countries where it might be used, that’s only a viable solution for personal use by a home constructor.
(And then, the emonTx would always need a separate 5 V d.c. supply, meaning two power outlets are required - unless one unit incorporated both this and a 5 V d.c supply).

I assume you are aware that there are “complete Energy monitoring systems” available for less than the price of these adapters. That’s why in an earlier post I said I was ordering an OEM adapter more out of curiosity.

@Robert.Wall my OEM AC-AC adapter arrived today, thanks @glyn.hudson

I note you state they should give 11.6V ±3% on no-load for 240V.
Mine is actually reading approx 10.9V at approx 234V supply so it’s about there taking into account tolerances on all the meters involved.

But I have either built the circuit wrong or I am missing a calibration somewhere because the Vrms is around 568V. I thought I had seen a calibration value for the OEM adapter on the site but I need to look again so at the moment I have the default sketch value at 234.26.

Below is the transition from off to on with a 2s loop:

Vrms: 1.75
Vrms: 1.74
Vrms: 1.71
Vrms: 1.72
Vrms: 568.76
Vrms: 571.29
Vrms: 571.41
Vrms: 568.46
Vrms: 568.55
Vrms: 568.58
Vrms: 568.63
Vrms: 571.08
Vrms: 568.58
Vrms: 568.40
Vrms: 568.51
Vrms: 568.38
Vrms: 568.45
Vrms: 568.61
Vrms: 568.58
Vrms: 568.58
Vrms: 571.13
Vrms: 571.07
Vrms: 568.69
Vrms: 568.50
Vrms: 570.91
Vrms: 571.06
Vrms: 568.51
Vrms: 568.52
Vrms: 571.39
Vrms: 571.03
Vrms: 571.15
Vrms: 568.44
Vrms: 568.52
Vrms: 570.99
Vrms: 571.21
Vrms: 568.73
Vrms: 568.50
Vrms: 568.58
Vrms: 568.66
Vrms: 568.37
Vrms: 568.61
Vrms: 571.00
Vrms: 568.77
Vrms: 568.69
Vrms: 568.67
Vrms: 568.61
Vrms: 568.65
Vrms: 571.17
Vrms: 568.66
Vrms: 570.89
Vrms: 568.60
Vrms: 571.22

Meanwhile I’ll keep checking the docs etc.

And a pretty stable set of readings now that it’s been on for a while:

Vrms: 568.39
Vrms: 568.46
Vrms: 568.35
Vrms: 568.37
Vrms: 568.28
Vrms: 568.53
Vrms: 568.40
Vrms: 568.42
Vrms: 568.40
Vrms: 568.40
Vrms: 568.34
Vrms: 568.49
Vrms: 568.44
Vrms: 568.43
Vrms: 568.40
Vrms: 568.41
Vrms: 568.51

Edit: found the calibration figures at Learn | OpenEnergyMonitor will test with these.

@Robert.Wall checking the Arduino’s voltage for 3.3V and 5V shows 3.3V and 5.07V with my meter so little or no margin of error / calibration there.

I’m now sure that my original Ikea adaptor is AC - AC because it’s ‘clearly’ marked secondary as 11.5 ~ and with a load, i.e. lamp switched on, I get an AC reading and no DC reading from the meter.

It’s just that it doesn’t operate without a load. The AC values range from 6 to 8V with the lamp connected.
If the AC adapter could be hooked up to a stable load would it be possible to work out mains voltage?

No joy with the sketch and the OEM, performs like the Ikea but more stable and Vrms nothing like the real values.

@Robert.Wall I had R1 and R2 the wrong way round, can’t understand how it didn’t blow the ADC.

OEM working fine and it appears the Ikea works too. More to follow on the Ikea when I have checked some wiring.

@Robert.Wall after I had got the OEM running I thought I would check the Ikea.

When I was wiring up the Ikea I noticed Serial Monitor kicking out values around 270V before I had connected all the wires.

I had AC hooked up to R2 but no AC for R1. With a calibration figure of 200 these are the figures I am getting. Pretty stable, but I would say no as stable as the OEM. When I disconnect power the value immediately drops to 40V and within 18s it’s down to about 1V as the capacitor discharges. Does this give you any more clues what the Ikea AC - AC is when the circuit works without AC connected to R1?

Vrms: 235.46
Vrms: 235.28
Vrms: 235.31
Vrms: 234.99
Vrms: 235.33
Vrms: 235.81
Vrms: 235.53
Vrms: 235.69
Vrms: 235.22
Vrms: 235.83
Vrms: 235.49
Vrms: 234.41
Vrms: 235.10
Vrms: 235.14
Vrms: 236.07
Vrms: 236.70
Vrms: 235.61
Vrms: 235.26
Vrms: 235.29
Vrms: 234.68

The weight of the Ikea power supply, and the fact that it gives no output without a load connected makes me almost certain that it is indeed a high frequency switched mode device. Without access to more test instruments, I’d guess that the output is probably not a sine wave, but probably closer to a square wave, and I’d stand by my guess that the frequency is a little above the upper limit of hearing - in the 20 kHz - 30 kHz area.

Actually during further tests today I did read 0.6V AC with no load. Not quite the 10.9V from the OEM without load but some value nonetheless.

I’ll post below a longer record of OFF - ON - OFF (1s loops in Serial Monitor).
Do the Vrms figures suggest supplyVoltage is available from the Ikea or they are just appearing from nowhere?

Vrms: 1.05
Vrms: 1.04
Vrms: 1.19
Vrms: 0.91
Vrms: 1.09
Vrms: 1.39
Vrms: 1.07
Vrms: 1.01
Vrms: 1.00
Vrms: 1.11
Vrms: 1.20
Vrms: 1.03
Vrms: 0.93
Vrms: 1.10
Vrms: 1.17
Vrms: 231.06
Vrms: 238.39
Vrms: 239.76
Vrms: 239.85
Vrms: 239.87
Vrms: 239.49
Vrms: 239.61
Vrms: 239.42
Vrms: 238.80
Vrms: 239.36
Vrms: 238.80
Vrms: 238.96
Vrms: 239.54
Vrms: 239.60
Vrms: 238.20
Vrms: 239.13
Vrms: 234.82
Vrms: 239.37
Vrms: 239.07
Vrms: 239.25
Vrms: 239.29
Vrms: 238.60
Vrms: 239.77
Vrms: 238.69
Vrms: 238.93
Vrms: 238.68
Vrms: 239.70
Vrms: 239.23
Vrms: 239.47
Vrms: 239.32
Vrms: 48.41
Vrms: 20.58
Vrms: 24.97
Vrms: 18.82
Vrms: 12.71
Vrms: 12.28
Vrms: 11.83
Vrms: 9.75
Vrms: 8.28
Vrms: 8.14
Vrms: 7.51
Vrms: 6.81
Vrms: 6.54
Vrms: 5.93
Vrms: 4.97
Vrms: 4.64
Vrms: 4.32
Vrms: 3.82
Vrms: 2.57
Vrms: 1.50
Vrms: 1.32
Vrms: 1.31
Vrms: 1.21
Vrms: 1.14
Vrms: 1.23
Vrms: 0.99
Vrms: 1.67
Vrms: 0.92
Vrms: 1.13
Vrms: 1.20
Vrms: 0.79
Vrms: 1.01
Vrms: 0.79
Vrms: 1.23
Vrms: 0.97
Vrms: 0.81

They are not appearing from nowhere, but I have serious reservations about the “Vrms” part. I think there are good reasons to suspect that the output voltage of the Ikea device is regulated, meaning that it will be sensibly constant over a range of input voltages. If you want to measure the rms value of the mains voltage, it is essential that the Arduino receives an exact replica in every respect of the mains wave, save that it is reduced in amplitude, but by a constant proportion.

[Edit]
Worth looking at: http://sound.whsites.net/lamps/elect-trans.html
Figure 2 this is probably something like you have.

Thanks @Robert.Wall I read the Electronic transformer article and some other stuff but even Vrms is pushing my limits, never mind sine waves and the like.

What I do have are a few more details about the Ikea and a link to buy new ones, but not for a price worth considering.
Image lifted from Ebay and full zoom available from a fairy lights stockist at http://www.ebay.co.uk/itm/IKEA-FAIRY-LIGHT-TRANSFORMER-AC-ADAPTER-IN-WHITE-KBA1200200L-9166/253151853053

I checked numerous sites for KBA1200200L but it didn’t advance my knowledge in a life changing way.

Fundamentally is there any reason that an electronic AC - AC transformer couldn’t be used in lieu of the OEM product?