AC - AC Adapter and Arduino for Measuring AC Voltage

You’re right, I can’t read it. You needed a very low angled light to give bright edges and to throw shadows.

What sort of a lamp is it, tungsten halogen filament?

@Robert.Wall spent ages stripping the lamp down to see what type of bulb it has. Ikea bulb made in China but the short reference number isn’t found on Google.

Basically it’s this svetnova.ru which I believe is halogen and they are normally AC.

Swapped out the 0.1 μF for the 100 μF and have removed my " / 2" hack from the sketch. Serial Monitor now shows the following (ignore apparent power).

Apparent power: 25.74 W	 Supply voltage: 257.37 V
Apparent power: 24.95 W	 Supply voltage: 249.48 V
Apparent power: 23.40 W	 Supply voltage: 234.01 V
Apparent power: 24.95 W	 Supply voltage: 249.51 V
Apparent power: 22.53 W	 Supply voltage: 225.26 V
Apparent power: 23.01 W	 Supply voltage: 230.15 V
Apparent power: 22.17 W	 Supply voltage: 221.70 V
Apparent power: 22.99 W	 Supply voltage: 229.92 V
Apparent power: 24.36 W	 Supply voltage: 243.61 V
Apparent power: 26.03 W	 Supply voltage: 260.32 V
Apparent power: 21.81 W	 Supply voltage: 218.10 V
Apparent power: 26.30 W	 Supply voltage: 263.02 V
Apparent power: 24.55 W	 Supply voltage: 245.53 V
Apparent power: 22.06 W	 Supply voltage: 220.64 V
Apparent power: 24.06 W	 Supply voltage: 240.61 V
Apparent power: 21.94 W	 Supply voltage: 219.44 V
Apparent power: 28.44 W	 Supply voltage: 284.43 V
Apparent power: 26.36 W	 Supply voltage: 263.62 V

So something like mains voltage. I used a low 212 value for calibration similar to the FP AD 3515 but only because it made the numbers look more reasonable.

Hmm…
I wonder whether, if you seriously need an accurate measurement of mains voltage, it’s time to invest in an a.c. adapter that’s known to work and for which we have calibration data?

But I wouldn’t expect it to be jumping around quite so much - 220 to 260. Either you have a very soft supply, or you had a particularly heavy load on the same ring main that was switching on and off.
If your transformer is 11.5 V on full load (which seems a reasonable assumption, but not necessarily correct) and the regulation is 25% (the same comment), then the no-load voltage will be 14.375 V. Assuming that is at 240 V, and with the 11:1 divider, the calibration constant will be 158. If the voltage is 11.5 V on no load, then the constant is 126.5. A constant of 212 means the transformer is giving you something like 19 V, and at that voltage, you should change R1 to a higher value (say 120 kΩ or 150 kΩ) so as not to ‘clip’ the waveform when the instantaneous voltage goes outside the power rail voltages.

If it helps with calibration the value going into the analogue port is almost exactly 2V (DC) and stable. When I connect up the meter it starts around 2.35V (DC) and gradually drops to the 2V. Is this the effect of the capacitor charging up? Or shouldn’t there be any DC values in the circuit if it’s the correct type of adaptor?

We don’t have any heavy loads on any ring mains.

We actually have an off the shelf smart meter and the supply voltage is pretty stable. Over the last 24 hours the minimum was 229.2V and the maximum was 243.7V. These values are 1 minute averages of the supply voltage so some of the readings could have been higher or lower than this range.

The standing (quiescent) d.c. level on the mid-point should be half the d.c. supply voltage that you’re using. That’s half of 3.3 V for an emonTx, and half of 5 V for an Arduino (or most Arduinos).

One question that I forgot to ask about your transformer: what does it weigh? If it’s a copper and iron isolating transformer, and it runs a 20 or 25 W lamp, it has to be 20 - 25 VA minimum. One of those will weigh at least ½ kg (I’m looking at the RS catalogue and a 20 VA weighs 0.55 kg and that’s without a casing around it). I have a 12 VA one that weighs just under 400 g, and a 50 VA is 1 kg - so weight is not directly proportional to the rating but it’s a good guide. If yours weighs substantially less than 500 g, it’s got to be an “electronic” lighting transformer that is in essence a switched mode power supply with an a.c. output, and one of those is totally unsuitable for what you’re trying to do.

1 Like

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.