ACS 712 sensor error in measuring current

knightridar:
The INA219 can only be used up to a maximum of 4 sensors because of the way it's setup and it uses the SDA and SCL ports on the arduino.

Not true.
You can use as many of these as you need on the same bus, if you solder a wire to one address field.
You can then use that wire as chip select.

A 30A sensor (30A bidirectional = 60Amp) has a resolution of ~13.5 steps per Amp, or one step per 75mA.
Just enough for one decimal place.
Leo..

Sorry lost you there...

Up to 4 boards may be connected. Addressing is as follows:
Board 0: Address = 0x40 Offset = binary 00000 (no jumpers required)
Board 1: Address = 0x41 Offset = binary 00001 (bridge A0 as in the photo above)
Board 2: Address = 0x44 Offset = binary 00100 (bridge A1)
Board 3: Address = 0x45 Offset = binary 00101 (bridge A0 & A1)

What do you mean by bus?
What is chip select?

Thanks.

knightridar:
What do you mean by bus?

What is chip select?

  1. I2C is a bus. Many devices can connect to the same two wires, as long as they have a unique address.

  2. Selecting one chip, and ignoring others.

The INA219 has four user selectable addresses (the solder links).
So normally up to four of these modules can be connected to the same bus.

But... if you control one of those solder links with an Arduino pin, you can change the address with software.
Talk to one module two modules, and ignore the others (that have been set to a different address).
Leo..

Thanks I was reading up on it here:

If I am not mistaken, only 1 device at a time can talk to the I2C bus?
Want to know because I need to turn the relays on/off simultaneously.

Also even if i can change the address,
I need to measure the current going out to 8 solenoids simultaneously.

So are you saying I can connect 8 modules and give them all different addresses?
I was confused with the 2 modules comment.
If I use two and assign different addresses via the pin, then I can get 8 different addresses?
Will they be unique?

Only issue is if I change them via the pin on an Arduino I won't be able to detect current simultaneously for 8 relays. That connection is a fixed hardware interface on the INA219 is it not?

Hi,

Want to know because I need to turn the relays on/off simultaneously.

I need to measure the current going out to 8 solenoids simultaneously.

Input simultaneously is not possible, only very fast scanning of the inputs on the I2C bus.

Output yes, you can turn all outputs off simultaneously with direct port addressing.

How quick do you need the response to be?

int TOn = 1000; //Adjust delay time in milliseconds to turn relay on/off[color=#222222][/color]
int TOff = 200;

I don't think your relays are going to last long being operated at 1/(1 + 0.2) = 0.83Hz
With a duty cycle of 1000/(1000+200) = 83%

What is the application?

Tom... :slight_smile:

knightridar:
I need to measure the current going out to 8 solenoids simultaneously.

So are you saying I can connect 8 modules and give them all different addresses?
I was confused with the 2 modules comment.

Everything in a single core processor happens after each other.
Don't know what you are going to measure,
but the INA219 can only measure loads <26volt and grounded to the Arduino.
Be careful with PWM-ed loads. They will give false readings, since current will be 0% or 100% at different times.

Since you have four addresses available, you can connect modules in pairs.
e.g. address 0x40 and 0x41 active, and the other sets on 0x44 and 0x45.
Leo..

@Tom,

I don't need to make the cycle times that fast.
I was just trying to make them fast to speed up my testing process and times.

Goal is to do cyclic testing of solenoids.

I was thinking of using solid state relays. I did find one:

Problem was I wasn't sure about what I kind of DC loads it's capable of taking.

With the current relays it's written on top of them with respect to what amperage and dc/ac voltage they can take in.
Current relay part no. Songle SRD-05VDC-SL-C

http://pub.ucpros.com/download/27115-Songle-Relay-Datasheet.pdf?osCsid=t5nucvvbbtp4q2keq2qj15bqd6

My solenoids' voltage range is 12-24V, and a few at run at 115V AC..

@Wawa,

If I end up using that sensor then I will pair the modules,
but I would have preferred to measure 8 separate currents.

Thanks.

knightridar:
Goal is to do cyclic testing of solenoids.

Problem was I wasn't sure about what I kind of DC loads it's capable of taking.

With the current relays it's written on top of them with respect to what amperage and dc/ac voltage they can take in.

My solenoids' voltage range is 12-24V, and a few at run at 115V AC..

If I end up using that sensor then I will pair the modules,
but I would have preferred to measure 8 separate currents.

The current of the actual coil?

Those relays are AC only. This is in the specs list:
"Load voltage range: 75 to 264VAC (50/60Hz)"

Just measure coil resistance. With ohms law you can calculate DC coil current.
Tricky with AC, because of coil inductance. Need to measure AC voltage too.

The INA219 can't do mains connected 115volt AC, and 24volt is borderline.
Seems you need to go back to the ACS712 (5A version).

measure 1, measure 2, switch to the next set, measure 3, measure 4, switch to the next set, etc..
Leo..

What does the picture below mean in terms of the DC voltage it can support?
These relays are pretty common in a lot of the modules being sold (i.e. single relay, 2,4,6,8)

I am supplying load to 24V solenoids right now.

Perhaps the documentation I provided is inaccurate?

5v relay.PNG

5v relay.PNG