Connecting remote sensor to Arduino Pro

Hello,

I’m using the Arduino pro to monitor an accelerometer. For the final solution, the sensor will reside apx. 3 feet from the microcontroller. In my initial tests, with the sensor connected to the Arduino pro via six-inch jumper wires, the circuit works as expected.

However, when I attach the sensor via 3 feet of cable, the readings suddenly slow down. (They speed up periodically; but, they are abnormally slow the majority of the time.) I’d initially tried using a 3 foot run of CAT 5 cable.

Questions: 1) Would a 3 foot run of cable introduce enough resistance to create this sort of behavior? 2) Can anyone suggest a strategy for testing/debugging the issue that I’m seeing? And, 3) Any suggestions as to where I might be able to order a 3 foot length of four-conductor cable (in 20 gauge wire)?

Thanks!

Will assume serial comm, as your post has no relevant information.

The first solution would be to incrementally reduce the speed of the bus until comm restored. If your design requires a higher data rate, then you need to understand the protocol and its electrical limitations. Note that SPI or I2C were originally intended to provide a chip-to-chip comm bus; that is, between ICs on a single, or adjacent, PCB. Look for digital driver ICs intended to ‘push’ the bit stream through much L and C.

Yes, please provide more details about the accelerometer and the way it is connected to the Arduino. Most likely the cable length causes the digital signals to decay along the way. And that is not due to resistance, but capacitance. Long cables act like capacitors in the sense that it needs time to charge up to the high voltage level.

A CAT 5 cable should handle 100 MHz signals along 100 meters. However ethernet is totally different from SPI/I2C or serial-TTL so cannot really be compared. So there may be something else at play. But you do not provide enough info to work on.

Appreciate both responses. I’d based my wiring and firmware on this example: http://www.arduino.cc/en/Tutorial/Memsi … Memsic2125

I’m guessing that the longer wire is acting as a capacitor: This would explain the output slowing down as the charge builds up and then suddenly resuming at “normal” speed every few seconds?

Apologies for the lack of detail and ignorant questions–I’m a software guy–hardware is still somewhat of a black box.

Thanks!

That chip does it’s measurements based on heat transfer inside the chip. Maybe the cause of the changing values is due to changing ambient temperatures. Any chance the thing is under the influence of the wind or other air temperature changes? The tutorial you are following doesn’t measure the temperature output of the chip. Measuring that with an analog input pin (you’ll have to add appropriate code) or even with a digital multimeter might prove this.

The outputs are low frequency (100 Hz) PWM outputs. So no I2C or SPI or UART. So the capacity of the CAT 5 cable or it’s 3 foot length is not going to cause the issue. Maybe any flexing of the cable is causing the chip to tilt, and thus disturbing your measurements. Just a wild guess here.

Or what else are you doing with the Arduino. Are you activating power-hungry actuators? Maybe that is causing supply voltage changes causing the zero-G PWM value to shift. (mentioned in the guide)

Datasheet: https://www.parallax.com/downloads/mems … -datasheet

operating guide: https://www.parallax.com/sites/default/ … e-v2.1.pdf

Valen,

Thanks for the quick response.

Temperature isn’t an issue–I’m running my tests at room temperature. And, I know that the accelerometer/Arduino are working as I can: detach the cable, plug the accelerometer directly into the Arduino board, and see the expected output.

It’s only when the cable is attached that the readings slow down. Out of curiosity and thinking it was a resistance issue (before your original response), I’d created a new cable with larger-diameter wire (18 gauge). When I tested, the readings are still slow(er) but not as slow as with the CAT 5 cable.

The guide does say that a different supply voltage can change the 0-g PWM reference. Maybe the CAT 5 cable (and possibly RJ45 connectors?) do induce a bit of a voltage drop. Try to measure the Vdd voltage against ground at the accelerometer, and compare it to what it is at the beginning of the cable at the Arduino.

Does the module have the 220 ohm resistors on it? Or is it a bare chip?

I’m using the chip as Parallax sells it: There are no resistors onboard that I’m aware of. (Just checked the Parallax datasheet and there don’t appear to be any resistors in place.)

Note that while I’m using CAT 5 cable, there are no RJ45 connectors. I’ve soldered leads to the cable ends which mate with the accelerometer on one end and the Arduino on the other.

Ok, I noticed in the guide some smd parts at the top. Turns out they are decoupling capacitors to the supply inputs of the chip. Not the 220 ohm resistors in series with the digital output lines as shown in the guide.

I don’t know what else could cause this. What exactly do you mean with slow down and speed up anyway? Do the values increase/decrease? Or does the period between sample measurements change? Eitherway, the acceleration is proportional to the ratio of on-time over total pulse repetition period. The arduino code of the tutorial only measures the duration of the high period. So if the repetition period isn’t fixed (the datasheet says it can vary ± 5%, but not due to what) then it could appear as if there are accelerations. Proper code would measure the off-time of the pulse too, or the total period, and determine the ratio from that.

Could you be missing an edge due to signal integrity issues? Can you look at the signals with a scope (at the processor end)? Would it be possible to put a small micro next to the accelerometer and send back serial data?

/mike