Troubles with Failing I2C Sensors

Some of my i2c air speed sensors in a rig I have developed to measure airflow are failing, and I believe it is because of previous damage via incorrect logic voltage. The sensors take 5V power, but run on a 3.3V bus. After using an Arduino Mega and the pull-up resistor method outlined in the setup guide (attached below, page 3) I found that some of my sensors were busted after a couple runs of my rig. By busted I mean that I cannot recognize them using my i2c scanner code on the bus, but am able to recognize good sensors. I went ahead and inserted a level shifter instead, thinking this would solve my problem, but I'm still having random sensors fail. Is it possible that the original configuration damaged the sensors, and even if my current setup it correct, it will cause them to fail eventually? I've attached images of the rig in question, a schematic (containing 2 F200's but the real thing has 36), the data sheet, and the setup guide for the F200 sensors I'm using:

TNS-AS00-C Arduino Setup for F-Series Sensors.pdf (1.3 MB)

F200-Digital-Airflow-Probe-Manual.pdf (1.7 MB)

I appreciate any advice or feedback regarding how to troubleshoot this/the individual sensors!

That is possible if the sensors are very, very, very sensitive.
The Arduino Mega board is the only Arduino board with onboard 10k pullup resistors to 5V.

In the pdf files, a Arduino Uno is shown. A Uno does not have those 10k pullup resistors, only a internal pullup of about 50k or so. That is still not okay, because a Uno needs 3.5V to see SDA and SCL as a 'high'.

You need only one level shifter to create a 3.3V I2C bus. However, a level shifter makes the signal a little weaker.

Can you use a 3.3V Arduino board ? But don't buy a Due.

1 Like

Running at 5V does not mean that the inputs are 5V tolerant. The Mega has pullup resistors to 5V so that level shifters are a must have.

Your bus is quite long with a risk of ringing pulses on all wires. It may help to connect the Arduino to the middle of the bus and have pullup resistors at both ends. Have a thick GND wire and caps at each sensor. Eventually use a flat ribbon cable for the bus and clip each node onto that cable. Have every other pin connected to GND.

If nothing helps split the bus and attach each part to its dedicated controller.

1 Like

Can you place bypass capacitors along your rig, between 5V or 3V3 what ever supply you are using and gnd.
0.1uF every couple of sensors.
The air speed of what are you measuring.
Could you have a static build up that is causing your sensors damage?
Have you measured the Vdc at the end of your string of sensors?

Can you please post a circuit diagram of your project please?
Don't put all the sensors in just a few to indicate a line of them.

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

1 Like

I can try placing bypass capacitors along the rig, on the power and ground lines of the sensors. I also have not measure Vdc at the end of my string of sensors yet. My original post is edited to show a schematic of my system. My only worry is that every time I power up the system more sensors randomly fail, so I can't keep powering it up and down.

I'm unsure of just how sensitive the sensors are. Is there a way to test if they are busted for good? Would I need the 3.3V Arduino if I already have the level shifter? The Mega I have already has a nice screw terminal shield on it.

No, with the level shifter it is okay. The Mega has onboard 10k pullup. The level shifter has 10k pullup on the high side and low side. There is not much room to lower the impedance of the I2C bus. Do you know if the sensors have internal pullup resistors ?

Did you know that you can measure the actual sink current of the I2C bus ? Even for a complex I2C bus with level shifter. The sink current is the current required to pull SDA or SCL low. See: Measuring the total sink current.

Then a possible candidate is the 24V-5V converter.
I'd check its startup behaviour using a scope and; for convenience; only insensitive load

1 Like

After checking it with a scope, it seems that every couple of startups there is some noise upwards of 18V, and the sensors are only rated for up to 15V. Is my best solution another converter?

Most switching regulators have such problems. A lower dummy load may help to always draw the required minimum current.
Or a two step conversion with a linear regulator (7805...) for the final voltage.

Please don't go all the way back and edit old posts, it disrupts the flow of the thread.

Thanks ,,Tom... :grinning: :+1: :coffee: :australia:

You need a crowbar across the supply rails then, a Zener or TVS diode rated suitable (10V?) might be suitable.

BTW with logic signals you are asking for problems if the layout isn't tight - someone's already mentioned using a ribbon cable alternating ground/signal/ground/signal already, or alternatively use twisted pair, with the SCL twisted with GND, SDA with V+ perhaps (assuming each sensor has internal decoupling).

The sheer length of your rig coupled with the loose wiring ("flapping in the breeze"!) could allow interference to get into the bus and make it unreliable, especially if there's mains appliances or wiring nearby.

1 Like

I'll get myself a diode along with some decoupling caps! Do you have a recommendation for the most wire-efficient setup? My current method of daisy-chaining the sensor slaves together uses fewer wires, but obviously has technical drawbacks. With 4 inputs on each sensor and 36 sensors, I'm looking at a pretty hefty ribbon cable or many twisted pair cables.

Could I potentially use something like the image below for every 4 sensors, then I'll have only 9 cables routing back to the Arduino and not 36? Unsure if this will solve my potential problem of interference. The sensors are 4 pin inputs that would pair perfect with the male ends of cables like these.

No, the SDA and SCL need to be far away from each other. That means either separate wires in the air as you have now or for example between GND wires in a cable as DrDiettrich and MarkT already mentioned.

So what you have now is not so bad, but it might pick up electric noise.

Okay, that does make sense. I believe I understand what DrDiettrich and MarkT are recommending but if there was a way to limit the amount of total wires going back to my "control panel" that would be ideal (hence my original daisy chaining method). Could I clip into a ribbon cable at different points with these?

Yes. You only need the cable and matching connectors and a gripper or vice to press the female connectors onto the cable wherever you like. Crimp or solder the sensors to the matching male connectors and clip them on and off the cable as required, easy replacement of defective sensors.

One thing got out of my sight: can you assign a unique I2C address to each sensor?

1 Like

Do you have a star-setup now?
That could quickly become a problem for I2C.
Must keep wire length (capacitance) as short as possible, ideally not more than 3-5m total.
For the inline sensors you have (image), that means sensor-to-sensor (inline) wiring.

Do you have to use a Mega?
An Uno does not have physical pull up resistors, and it's software pull up can be disabled in setup(). So the Uno can become a true 3.3volt I2C master (no level translator needed).

Great! I'll order a set of those now. I can and did assign a unique address to each sensor using a separate script that I wrote! They did originally come with the same base address, so good catch!

With the new setup I plan to implement with ribbon cable and clips, the total length of the I2C bus wiring should not exceed 2.5m. I don't have to use a Mega, I just already happen to have it mounted with a screw terminal shield, so using a level shifter seemed like a better solution. Also, the Mega features 4 interrupt pins (technically 6 but I'm using 2 for I2C) as opposed to the Uno's 2, which would not suffice for my particular project.