adding a second flow meter

Hillo everyone I am needing to have two air flow sensors for my system I have a code up and running for at least one but am not sure how to go about setting it up for two. So it needs ports for SDA and SCL. That should not be to much of an issue probably just run the wire or something. Any way I will attach my current code to this email. There is a second set of separate code that is used to get pressure readings. Any help would be great.

flowSensorI2CB.ino (1.38 KB)

So it needs ports for SDA and SCL.

There is only one set of pins for that purpose. Fortunately, that is all you need, IF you can set the address of the flow sensors.

Okay sweet good to know :). Next question then how do you setup for two. Its been awhile since I have done any programming so not quite sure how to go about doing this. I have the code attached and have it working for one. But am not sure how to alter the code so that it will work for two. Please let me know what you can on this matter and refer to attached code for what I already have.

Next question then how do you setup for two.

The second one needs to have a different address. You define which device on the bus you want to talk to by specifying it's address.

Okay so in the first code I have the address of the first one as 0x49 so do I just set the second one as

Wire.requestFrom(0x47, 2); or do I need to do more than that?

do I need to do more than that?

You need to know the address of the second sensor. How did you know the address of the first one ?

Okay so checked into it looks like both devices have same address. How do I get around this since they both use SDA and SLC ports?

SCL is only from master to slave in your application.
Run SCL thru 2 gates of 74HC125 or comparable 3.3V device if needed, and only enable one gate or the other, so only one part or the other sees the clock.
Can't do the same with SDA as the slave needs to be able to drive SDA back to the master.

If I do this would I still be able to get readings from both devices at the same time?

"at the same time"
Well, one first, then the other. But fast enough to appear to be at the same time.