Community
OpenEnergyMonitor

Community

Arduino Due Calibrating Voltage sense +/- 0.1 at first, now +/- 0.3 what does it mean?

I am using an Arduino Due with an AC-AC 9v adapter for the voltage sense, project is based on: https://boredomprojects.net/index.php/projects/home-energy-monitor
except that I am not on 3 phase power, I am in the US. So I am using the official emonlib.

The first few minutes that it ran it was +/- 0.1volts with:
emon1.voltage(0, 161.9, 1.7);

I then walked away for about an hour, when I came back the voltage was fluctuating +/- 0.3 and I had to increase the 161.9 to 162.3 to have an accurate voltage.

I am not sure what this means, as far as I why did I lose some accuracy, and why did I have to increase the calibration number when it was very stable previously.

While I am Calibrating the Arduino Due I have it connected to my PCs USB port via micro usb cable, so this is also what is powering the Arduino Due.

Once I have it calibrated I plan to power it with a 5V micro USB power adapter. model F06US0500100A:
https://fccid.io/png.php?id=3234170&page=21

Any help Dialing it in so that I lose as little accuracy as possible is appreciated. One thought I had was what if my computers 5v from the USB is not great? does the Arduino Due buffer it good? I know it has to reduce the 5v to 3.3v.

EDIT: just tried a different USB cable as well as a USB3 port instead of USB2, this had no effect, so I am going to guess that the difference in accuracy that I now have has to do with the AC-AC adapter, possibly it lost some accuracy once it warmed up?

My dso150 oscilloscope shows the Frequency hopping between 60Hz and ~63.76Hz ish

Does that mean this AC-AC adapter is misbehaving? A good AC-AC adapter should maintain 60Hz correct?

My P3 kill a watt shows that the frequency of the mains power is a rock solid 60Hz

EDIT: I changed the dso150 from 0.5v Div and 5ms to 1V and 10ms and now its jumping between 60Hz and 61Hz so maybe this oscilloscope just isnt that perfect. The more ms I set it to the more stable the Hz appears to be.

I get the impression that you might be expecting far better accuracy than the equipment you’re using is capable of. Have you carefully read the specification for your DSO - and read between the lines to infer the importance of the bits they leave out?

Also, look in ‘Learn’ and read about the factors that affect the accuracy of the measurement - the numbers are particular to the emonTx, but almost everything there will apply to your project too - there’s little that’s fundamentally different between the emonTx
and an Arduino with Boredom’s front end. And while you’re there, look at the article about meters and their accuracy.

I recommend using the 5VDC barrel jack power input with a linear i.e. not switching mode, power supply. That way, there’ll be no switching mode power supply noise getting injected into your Due.

You may be more correct than you realize.
Your computer’s SMPS may be “injecting” noise into your Due.

1 Like

I’d say your spot on there, Robert. To wit, the DSO150 specs:

Vertical

    Number of Channel: 1
    Analog Bandwidth: 0 - 200KHz
    Sensitivity: 5mV/Div - 20V/Div
    Sensitivity error: < 5%
    Resolution: 12-bit
    Input Impedance: 1M ohm
    Maximum Input voltage: 50Vpk
    Coupling: DC, AC, GND

Horizontal

    Max Real-time Sampling Rate: 1Msps
    Timebase: 10us/Div - 500s/Div
    Record Length: 1024

Trigger

    Trigger Modes: Auto, Normal, Single
    Trigger Types: Rising/falling edge
    Trigger Position: 1/2 of buffer size fixed

Display

    2.4-inch color TFT LCD with 320 x 240 resolution

Power Supply

    9V DC (8 - 10V acceptable)
    Supply Current: 120mA @ 9V

Physical

    Dimension: 115mm X 75mm X 22mm
    Weight: 100 gram (not including cables and power supply)

Ref: https://jyetech.com/dso-150-shell-oscilloscope/ (jyetech is the kit “manufacturer”)

The kit is really little more than an instructional aid on what a 'scope is and how it works.
(I say “kit” in the sense the item is available as a DIY kit)
(You ought to hear Dave at EEVBlog rant about them. He definitely doesn’t like them!)

1 Like

Thanks guys, I was seeing the +/- 0.1 volts initially in the serial output of the sketch, which later jumped to +/- 0.3 volts, thats when i hooked up the oscilloscope to see if it showed any clues.

I am going to see if I have a linear 5vdc power supply. I wonder if I have a 5vd connected to the barrel jack power and a usb cable connected from the programming port to my computer, if the Due will use the 5vd for power while I am using the usb jack to calibrating with the serial monitor.

What I understand is that the Due is supposed to automatically select a source for power and im not sure how it goes about doing that.

I wonder if 5V would work at the barrel jack? This documentation is telling me to use a power supply between 7 and 12 volts at the barrel jack.

I just found this info: https://www.arduino.cc/en/Guide/ArduinoDue#toc12

The board can take power from the USB connectors or the DC plug. If using the DC connector, supply a voltage between 7V and 12V.

It’s not hard to come by a circuit diagram, there’s an on-board regulator that feeds the 5 V, the input to it is the barrel jack. If they say a minimum of 7 V, there’s probably a good reason for that. (Hint: the data sheet curves for the regulator show a minimum of 1.7 V between input and output.)

There’s a second regulator generating the 3.3.V from the 5 V.

1 Like

Ok Thanks! So I will take a look in the shop for a 7 or 7.5V power source. Anything larger would just cause more heat and less current available.

Now if I can find a way to be certain if some of my power adapters are switching or linear. Some of the smaller ones are likely switching, and some of them even say so.

However on my larger power adapters I am not sure how to be certain if it is a linear or switching power adapter. Is there any way to know without breaking open the power adapter?

Edit: I have some spare ATX power supplies, however they only have 3.3, 5, and 12v. Not the ideal 7v for the barrel jack.

I was thinking maybe I could supply the 5v directly to the 5v pin bypassing the first regulator, however I am not sure that this is a good idea, also a full ATX power supply just to power the Due does not seem that great either.

Google?
Generally, a power supply’s physical size is roughly proportional to the power rating, but linear are generally a few times larger and heavier than switched-mode for the same output power. It’s not a hard and fast rule, more a general guide.

I have in my hand a 90 W switched-mode: it’s 3" × 6" × ¾" thick. A linear one rated at 90 W would probably be about 4 times the volume. (Look at the size of a 90 VA transformer! - the first one I looked at is about 3½" × 3½" × 3½", and that’s without any electronics and heat sink.)

1 Like

I searched high and low for a 7 or 7.5V Regulated Linear power adapter. I could only find ones that are 9v:

https://www.jameco.com/z/GPU410900500WDOO-4-5-Watt-AC-to-DC-Regulated-Linear-Wall-Adapter-9-Volt-0-5-Amps_1953647.html

The Arduino due will accept 7-12v so the above adapter should work, but if anyone knows where I could purchase a 7 or 7.5v Regulated linear power adapter then please let me know :slight_smile:

Also the Arduino due takes a 2.1mm power jack so if I were to buy it I will have to cut the 2.5mm end off of the jameco and put a 2.1mm end on the adapter, which is no big deal.

Correct. I had 5 Volts in mind, but that’s the input to the regulator, not the Due itself. :sunglasses:

1 Like

Those are very likely to be switching mode PSUs too. :frowning_face:

I wondered about that too, so I connected a 12VDC PSU to my Due.
After runing for about 20 minutes, I couldn’t tell any difference in board temp bewtween
powering it via the Native/Programming ports and the barrel jack at 12 Volts.
Time to find the IR thermometer. :wink:

Awesome! let me know what you find out and is your 12v supply a regulated linear supply?

EDIT: in addition to my 11 CT clamps I am also running my w5500 ethernet shield off of the 3.3v rail which would create more heat on the Due’s voltage regulators, i have read that the w5500 draws around 130ma at most but I need to test and measure its consumption for myself.

I am thinking a seperate 3.3v supply for the w5500 might be a good idea, and I found one in my box of power adapters, but if its not necessary then ide rather not.

edit2: found the info: https://shop.wiznet.eu/w5500.html
typ. Power Consumption 132 mA

May not be a need for one. From https://store.arduino.cc/usa/due

Microcontroller AT91SAM3X8E
Operating Voltage 3.3V
Input Voltage (recommended) 7-12V
Input Voltage (limits) 6-16V
Digital I/O Pins 54 (of which 12 provide PWM output)
Analog Input Pins 12
Analog Output Pins 2 (DAC)
Total DC Output Current on all I/O lines 130 mA
DC Current for 3.3V Pin 800 mA
DC Current for 5V Pin 800 mA
1 Like

The 12 V PSU is of the SMPS type. The output is regulated. Capacity is 2.0 Amps.

I powered the Due via its Native USB port.
After 15 mins, the CPU measured 85° F, the regulator, 78° F.

Changed the power input from USB to the barrel jack. (disconnected the USB cable)
15 mins later, the results were similar. CPU 86° F, regulator 79° F.

Sketch is a test that makes one million ADC conversions,
then calculates the average time per conversion.

1 Like

Awesome! appreciate that info, very useful. Think I will go ahead and purchase a power adapter then.

My Raspberry pi 4 (not part of this project) runs at about 49 degree after adding a small heatink, previously it was around 59-60, so it was about a 10c drop. i might do the same to the arduino due if I have any extra heatsinks laying around that are small enough.

Edit: Wait I just realized you gave me the temps in Fahrenheit, thats plenty cool :slight_smile:

thumbsup

Figured since both of us are in the US…

29.4 for the CPU and 27.1 for the regulator.

I hadn’t shut it down, so I picked up the gun, punched the button for degrees C and pulled the trigger.