1
\$\begingroup\$

I'm trying to use cansniffer and candump to read the CAN bus data in my car with a Raspberry Pi and the PiCAN 2 board, but I have run into a weird issue I can't explain.

Situation:

I've located the CAN-H and CAN-L wires in the car. I stripped part of the wires and used wires with an alligator clips on both ends to clamp to the stripped part. On the PiCAN board I attached wires to the CAN-H and CAN-L ports, each wire is stripped at the end, and also connected with alligator clamps.

The problem:

I only see data from candump / cansniffer when I take off one of the clamps and 'rub' the wire against the clamp. Which seems really weird, and I have never experienced anything like this. Are there some tips that I can try?

I have tried using just wires, different wire gauge, but the problem stays.

\$\endgroup\$
8
  • \$\begingroup\$ What is candump and cansniffer? \$\endgroup\$ – Andy aka Sep 30 '18 at 8:44
  • 1
    \$\begingroup\$ Capitals matter. \$\endgroup\$ – Transistor Sep 30 '18 at 8:46
  • 2
    \$\begingroup\$ Rubbing the wires is producing a noise signal - contact bounce. \$\endgroup\$ – Chu Sep 30 '18 at 9:14
  • 1
    \$\begingroup\$ Diff . Voltage readings must have good conductance and low inductive (short wire) gnd shield of paired signals to 0V. Otherwise poor signal integrity. use STP wire or separate twisted pair sig+gnd. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Sep 30 '18 at 11:43
  • 1
    \$\begingroup\$ This screams signal ground problems. Probably you didn't connect ground, simple as that. \$\endgroup\$ – Lundin Oct 4 '18 at 9:19
7
\$\begingroup\$

You need to connect three wires: CAN-H, CAN-L, and ground. The CAN lines are differential, but they are still ground-referenced. That's another way of saying that your CAN receiver probably has a limited common mode input range.

If you do have ground connected, then you are not making good connections to the CAN lines. Make sure the clips are digging into the bare wires properly. Make sure that the teeth of the clips are on the wires, then manually squeeze the clips together more.

Also make sure you don't have the CAN lines flipped. The best way to identify the lines is to look at their voltages on a scope. When the bus is idle, both lines will be at the same voltage, usually around 2.5 V. When the bus is in the dominant state, then CAN-H should be about 1.8 V higher than CAN-L.

Keep the total wire length from the car wires to your receiver short. CAN is not meant to be in a star configuration, which is what you are creating. CAN will still work if the stubs are short enough. The CAN bus will already have a terminator at each end, so make sure your receiver does not have any terminator enabled. Some receivers have the option for this. Remember that in CAN, it is the bus that is terminated, not individual devices.

\$\endgroup\$
1
\$\begingroup\$

The cables might be aluminum. It is used in cars and power lines as they are very good conductor, lighter and cheaper than copper.

The problem with aluminum is that it's very difficult to make connections because of the oxide layer that forms rapidly exposed to the oxygen of the air.

If indeed they are aluminum, you can try to crimp the cable, or putting some oil on the wire and try to scratch through it while connecting the cables.

\$\endgroup\$
0
\$\begingroup\$

Differential logic voltage readings must have good conductance (or contact) and low inductive (short GND wire) and shield of paired signals to 0 V. Otherwise, poor signal integrity will occur.

I suggest you use STP wire or separately twisted pair signal + ground. AWG24 to 30 magnet wire or thin insulated wire. This may reduce signal wire impedance to prevent ringing on short cables.

Examine the wire contact resistance for insulation issues, but also note that your fingers absorb stray coupling to ground. By lowering the common mode impedance while rubbing which is improved by twisted pairs to ground for each signal. It also adds capacitance to the differential impedance too, so CAN bus interfacing requires knowledge of impedance matching and stray ground noise caused by your SMPS which is then improved by bonding of receiver 0 VDC to chassis (like an earth ground).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.