Data Corruption from Sensors with Long Wires

Click For Summary

Discussion Overview

The discussion revolves around concerns regarding data integrity when using long wires to connect temperature sensors to an Arduino board. Participants explore the implications of wire length on data transmission, particularly focusing on two specific sensors: the MLX90614 and the SainSmart Max6675. The conversation includes technical considerations related to communication protocols, voltage drop, and environmental factors affecting sensor performance.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning
  • Experimental/applied

Main Points Raised

  • Some participants suggest that using 24 AWG wire for a 5-foot connection should not cause significant voltage drop or data corruption, citing specific calculations related to the MLX90614 sensor.
  • Concerns are raised about the impact of temperature on wire resistance and the need to avoid exceeding certain temperature thresholds.
  • There is a discussion about the communication methods of the sensors, with the MLX90614 using PWM or SMBus and the SainSmart Max6675 using SPI, leading to questions about the suitability of each for long-distance connections.
  • Some participants highlight the importance of noise in digital communications and suggest that significant noise could lead to confusion in data transmission.
  • One participant mentions that I2C might be a better choice for connecting multiple sensors due to its slower data rate, while others note the challenges of using SPI over longer distances.
  • Technical issues related to signal integrity, such as reflections and crosstalk, are discussed, with suggestions for mitigating these issues through the use of termination resistors and low-pass filters.
  • Participants express uncertainty about the best practices for using Cat5e cables in this context and whether it is feasible to transmit data from the Arduino to a computer using such cables.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to take regarding sensor connections over long wires. Multiple competing views are presented about the suitability of I2C versus SPI, the impact of wire length on data integrity, and the effectiveness of various mitigation strategies for potential issues.

Contextual Notes

Participants mention various assumptions, such as the type of wire used and environmental conditions, which may affect the performance of the sensors. There are also unresolved questions regarding the practical implementation of suggested solutions, such as the use of termination resistors and the feasibility of using Cat5e cables.

Who May Find This Useful

This discussion may be useful for hobbyists and engineers working with Arduino projects involving temperature sensors, particularly those concerned with data transmission over longer distances and the technical challenges associated with it.

EternusVia
Messages
92
Reaction score
10
Hi all,

Hopefully this is the right subforum. I have a question related to Arduino sensors.

Q:Generally, when do you need to be worried about losing data from having long wires from your sensor to your Arduino board?

Details:For example, I've been looking at two sensors.

Sensor 1: MLX90614
Sensor 2: SainSmart Max6675

I need to monitor the temperature of 12 objects. It would be nice to have one Arduino board with wires leading to the temperature sensor. But I'm worried that I might have data corruption / decay over the long wires. The length needed will probably be around 5 - 10 feet.
 
Engineering news on Phys.org
Well I think you should have no problem with it for various reasons. Assuming you are working with 24 AWG wire, based on your first sensor criteria the MLX90614 that has a load of 3 or 5 V (they have two different versions) @ 50 mA the voltage drop on a wire of 5 feet will be 6.596 mV with an error of 0.13 % that is nearly nothing, data taken here http://www.bulkwire.com/wireresistance.asp. Also the temperature will have an impact on the resistance of the wire so be careful exceeding the temperature over 100° F. Finally I recommend to you using a Cat5e cable so you can have everything organized without any doubt of data corruption and in addition to this LAN connected networks have Cat5e way more long than yours and doesn't have any problem with data corruption or something like that unless your cable exceeds the 300 ft. Hope this helps you.
 
Arnaldy Jr. said:
Well I think you should have no problem with it for various reasons. Assuming you are working with 24 AWG wire, based on your first sensor criteria the MLX90614 that has a load of 3 or 5 V (they have two different versions) @ 50 mA the voltage drop on a wire of 5 feet will be 6.596 mV with an error of 0.13 % that is nearly nothing, data taken here http://www.bulkwire.com/wireresistance.asp. Also the temperature will have an impact on the resistance of the wire so be careful exceeding the temperature over 100° F. Finally I recommend to you using a Cat5e cable so you can have everything organized without any doubt of data corruption and in addition to this LAN connected networks have Cat5e way more long than yours and doesn't have any problem with data corruption or something like that unless your cable exceeds the 300 ft. Hope this helps you.

That's very helpful!

So, let me see if I understand. Data is transmitted via... voltage? And the longer the wire we have, the more voltage is dropped due to wire resistance, which is what we call data corruption. Is that correct?

You also say to be careful with operating temperatures. The sensor itself can go above 100° F, correct? But the wiring can't?

Finally, I'm not sure how to use a Cat5e cable in this case. That's an Ethernet cable, right? For my application, I will have an arduino, sensors, a couple of LEDs, and probably an LCD screen. The arduino will trip the red LEDs when temperature exceeds a certain predefined amount and output the temperature to the screen. But perhaps you are talking about transmitting the data from the arduino over a cat5e cable to the computer. Is this possible? I'm still a newbie.

Thanks!
 
The MLX90614 communicates with pulse width modulation (PWM) or on a SMBus. Because they are both digital communications, you do not need to worry unless there is so much noise that the 0-1 discretes get confused. That would take a lot of voltage noise on a 5v line. Because of the speed of the bus, time delays are also important and the length of your cables are limited unless you use repeaters. SMBus is limited to under 20 ft.

PS. Arduino has a large user community on the internet. You can Google "SMBus Arduino" and find a lot of advice that is very specific to your problem. In fact, check this out: http://forum.arduino.cc/index.php?topic=21317.0 It is discussing your MLX90614.
 
FactChecker said:
The MLX90614 communicates with pulse width modulation (PWM) or on a SMBus. Because they are both digital communications, you do not need to worry unless there is so much noise that the 0-1 discretes get confused. That would take a lot of voltage noise on a 5v line. Because of the speed of the bus, time delays are also important and the length of your cables are limited unless you use repeaters. SMBus is limited to under 20 ft.

PS. Arduino has a large user community on the internet. You can Google "SMBus Arduino" and find a lot of advice that is very specific to your problem. In fact, check this out: http://forum.arduino.cc/index.php?topic=21317.0 It is discussing your MLX90614.

Thanks for the info. And yes, I have an account on Arduino forums too. The people on Physics forums usually respond very quickly, though, so I decided to post here too :)
 
  • Like
Likes   Reactions: dlgoff, Arnaldy Jr. and FactChecker
EternusVia said:

The first sensor looks to use I2C and the second one looks to use SPI. How many of each are you planning to use? Are you going to pick one and use 12 of that one?

I2C running at a slow data rate is probably the best way to go for connecting up 12 sensors to your uC. SPI tends to be a faster serial bus (and requires 12 chip selects out of your uC). SPI would generally also require back-termination resistors on the CLK, MOSI and MISO lines. Back-terminating the CSx lines is probably a good idea too. :smile:
 
  • Like
Likes   Reactions: FactChecker
berkeman said:
The first sensor looks to use I2C and the second one looks to use SPI. How many of each are you planning to use? Are you going to pick one and use 12 of that one?

I2C running at a slow data rate is probably the best way to go for connecting up 12 sensors to your uC. SPI tends to be a faster serial bus (and requires 12 chip selects out of your uC). SPI would generally also require back-termination resistors on the CLK, MOSI and MISO lines. Back-terminating the CSx lines is probably a good idea too. :smile:

Thanks for your input!

At this point, I plan on using the I2C sensor. My project involves monitoring the temperature of bearings. I plan on boring a hole a few centimeters deep on the bearing into which I'll place the temperature probe of the I2C sensor. Being physically connected to the bearing, I figure it'll get dependable temperature readings.

That being said, if the SPI sensors are considerably better suited for this project (user friendliness, data retention over long wires, etc.), I would definitely consider using them instead. User friendliness is a big plus as I'm still a noobie.
 
Be aware that both SPI and I2C are intended for communicating between ICs on a PCB with the benefit of a ground plane, not communication over cables. There are a number of issues you may run into:

-Outputs not able to drive low impedance of cable.
-Reflections of fast edges of the signals, even if they are toggling at low frequency. For example, you may get double clocking.
-Crosstalk on SPI bus due to sharing of long, common, ground connection. For example, you will probably see an artifact of the SPI clock signal riding on the data signal.
-High impedance of I2C is susceptible to all kinds of noise pickup, together with I2Cs will known propensity for locking up when something unexpected happens. For example, you may find your I2C locking up on you when someone gets a static discharge for a nearby doorknob.

On the other hand it may work for you. You can maximize your chances if you do the following:
1 - Use low data rate and put RC low pass filter on all signals to roll of fast CMOS edges before launching then onto cables.
2 - Use as many cable wires as possible for ground.
3 - Use as smallest I2C pullup resistor that you can (1K on 3.3V system).

If this were an actual product development you would want to use something else altogether, like CAN bus.
 
  • Like
Likes   Reactions: Jeff Rosenbury, FactChecker and berkeman
the_emi_guy said:
-Reflections of fast edges of the signals, even if they are toggling at low frequency. For example, you may get double clocking.

That's what the back-termination resistors are for with the SPI bus. However, the fan-out to parallel paths would complicate that strategy a bit...
 
  • #10
Not going to lie, a lot of the conversation is above my head at this point. I'm hoping that once I start experimenting, I see the logic of the topics you two are discussing. I'm sure I'll be glad for the details once I need them!
 
  • #11
  • #12
EternusVia said:
Hi all. I'm having some rudimentary problems with the MAX6675 thermocouple that I mentioned. If you're willing, I'd appreciate input. I posted about the problem in detail here: http://forum.arduino.cc/index.php?topic=334241.0

Ah. Well, I bought two of these sensors. After switching the first one out and trying me second sensor, everything seems to be working fine. False alarm... aside from the fact that one of my sensors is broken!
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
Replies
11
Views
24K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
907
Replies
16
Views
4K
  • · Replies 3 ·
Replies
3
Views
8K
  • · Replies 24 ·
Replies
24
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K