Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Data Corruption from Sensors with Long Wires

  1. Jun 28, 2015 #1
    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.
  2. jcsd
  3. Jun 28, 2015 #2
    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.
  4. Jun 28, 2015 #3
    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.

  5. Jun 28, 2015 #4


    User Avatar
    Science Advisor
    Gold Member
    2017 Award

    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.
  6. Jun 28, 2015 #5
    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 :)
  7. Jul 2, 2015 #6


    User Avatar

    Staff: Mentor

    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:
  8. Jul 2, 2015 #7
    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.
  9. Jul 3, 2015 #8
    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.
  10. Jul 3, 2015 #9


    User Avatar

    Staff: Mentor

    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...
  11. Jul 3, 2015 #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!
  12. Jul 5, 2015 #11
  13. Jul 5, 2015 #12
    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!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook