Different issues "Energy measurement device" (Power-jack vs USB # 5V-reference # INA219)

Hello

I am advancing in my project for an "energy measurement device" (for IT & TN grid), using some of my equipment. I also take up my old post here as reference: https://forum.arduino.cc/t/sensors-acs712-max417-shows-strange-values/672753/2

Now I come to some questions:

  1. 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.

  2. 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...).

  3. 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])?

I include my sketch and a picture from my test.



(in Fritzing I found no 230V-sockets/plugs, so I used those green connectors; also there was no RAC15-12SK, so I used the IRM-10-5)

Steve

Your screen and SD reader are not connected to power on that daft drawing!

Please provide a proper schematic.

Just assume there are :slight_smile:
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").

I will make NO assumptions!

please be pleased

  • Sensor output: 1V / Amp

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

analogReference() - Arduino Reference

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.

yes. A4/A5 are SDA/SCL. on UNO from revision 3 they are twice presented
on Mega they are digital pins 20/21

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.

Thank kolaha. But does it than still mean, I can only attach 2 such devices, since the Arduino has 2x those connections?

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.

no. read more about i2c protocol

Well, turns out that is completely wrong.

No, you can connect a lot more, just because you can only have 1 wire on each pin hole, connect them to a breadboard* and you can have loads.

*or solder them to a peice of stripboard etc.

Then please correct me. I have also the MW IRM-10-5 which gives 230V->5V, if that is a better option.

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 :grin:) 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.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.