I want to have a device measuring the power consumption in a 230V grid, and the Arduino Mega shall be powered by the 230V. Here I use a RAC15-12SK to supply 12V to the power jacket of the Arduino. I read somewhere (cannot find the link in a hurry), that if the Arduino gets the power from the socket, the USB-power will automatically shut off and only data transfer is allowed. I measure also the current of the 12V-jacket (with the ACS712 (the MAX471 does somehow not work [damaged?]) and a multimeter in series) to see the self-consumption of the Arduino and components, and when no USB is attached it is now 110mA. When I attach the USB it drops to 10mA or so.
Question: It seams the USB takes over the supply, or am I wrong? Should it be not turned off? This "disturbs" my work, since when I am coding (i.e. 12V and USB are connected), I am not getting the right current-values measured.
The 5V reference I use in the "V_out_DC025 = (Read_DC025 * V_5V) / 1024.0;" is not 5V. An "internal" reference is suggested here, but I find many descriptions and I am confused which (for the MEGA-board) and how to use it (AREF, 1.1V, 2.56V...).
In my original post it is also suggested to change the ACS712 with the INA219. I am confused about the wiring here https://learn.adafruit.com/adafruit-ina219-current-sensor-breakout/wiring. In the on picture it is connected to SDA/SCL, in the picture below is is connected to analogue-pins!? What is correct? And if it is connected to SDA/SCL, does it mean I can only connect 2 such sensors to my Mega-board (pin SDA/SCL and pin 20/21 [also mentioned to be SDA/SCL])?
Just assume there are
The 5V is connected to the upper and lower part of the Breadboard. I assume that all horizontal lines (5V, GND) are connected. Sorry if I used a wrong board, but this is just a sketch for me to hold the overview (it is nothing I would "publish").
if current is 50mA output be 0,05V
5V / 1024 = 0,0048828125 V/p
0,05V / 0,0048828125 V/p = 10,24 points
so, 'analogRead(A0);' shows 10. not very noticeable value
Using the internal references volts might be a bit better than using input supply voltages.
Consider. If one supply is 5.1 volts and the other supply is 4.9 volts. When the programming is all done and all the number are correct for the 5.1V in and then the V's are switched to 4.9V, the thing messes up.
when monitoring power in three phase systems I found current clamps the simplest method. However, I was monitoring currents up to 100amps aand required a non-intrusive method of sensing current.
a typical overnight plot could be
Your diagram is blurry, too low a resolution to be usable.
Not sure what the purpose of the 12 V power supply is - the Mega and all the other logic devices operate on 5 V so you need a 5 V supply to power them; I can't see a 5 v power supply.
I want to power the Arduino. Not with USB, but it shall be powered directly from the 230V input what it shall measure - therefore I use the 230V->12V. I use the 12V-jacket because I read that is better than using a direct connection into the Arduino via the Vin/5V.
That would indeed be the better option. You use it to power all the devices which require 5 V, and the Mega 2560 itself.
The only concern relates to the need to disconnect the 5 V (but not the ground of course ) from the "5V" pin whenever you connect the Arduino to a PC via USB.
Unless you need 12 V for something else, there is no reason to use a 12 V supply.