The short question: is there a difference between using (on a breadboard) a standard through-hole 10K pullup resistor, versus using a modded Dupont cable with a 10K pullup resistor soldered in the middle, when setting up an MCU and a peripheral using I2C? The modded Dupont cable does not work for my case.

enter image description here

Environment: breadboard, the Espressif ESP32 MCU as I2C Master using pin #21 as SCL and pin #17 as SDA (the internal "weak" +-4.7K pullups are enabled), a Melexis MLX90393 magnetic field sensor as I2C Slave on a Sparkfun breakout board (product https://www.sparkfun.com/products/14571; the 10K pullups on the Sparkfun breakout board are also enabled). See picture for the breadboard setup (focus on the pullup resistor).

The software works fine and I get 5 sensor readings per second if I wire a bare-bone 10K pullup resistor between the hole next to the MCU's SCL pin #21, and a hole on the 3.3V rail of the breadboard. This is standard procedure for I2C schemes in order to pull the I2C SCL high by default. Same for SDA.

However, I wanted to make wiring up things on the breadboard much easier and use a modded Dupont cable for the pullup. So I took a 30 centimeter Dupont wire, cut it in the middle, and soldered a standard 10K pullup resistor in between and put a shrink tube around it. If I measure the impedance between the 2 ends of the cable then it is +-10K Ohm.

So I plugged the modded Dupont cable besides the MCU's SCL pin #21 and the 3.3V rail of the breadboard (replacing the bare-bone resistor's of the previous configuration). Now the system does not work anymore* (the I2C communication fails).

What could be the (electrical?) reason for the failure? I do not have an oscilloscope but I do have a logic analyzer.

Thanks from a beginner.

  • 1
    \$\begingroup\$ When you say Dupont cable, are you referring to a jumper wire? \$\endgroup\$ – KingDuken Sep 14 '18 at 15:48
  • \$\begingroup\$ @king that's another name for them en.m.wikipedia.org/wiki/Jump_wire see also molex cable, jst cable, etc. \$\endgroup\$ – Passerby Sep 14 '18 at 16:21
  • \$\begingroup\$ I'm curious how cutting a jumper wire, soldering in a resistor, and covering it with shrink tubing was "much easier" than plugging a resistor into the board. Can you explain your thinking? Was there some other motivation? \$\endgroup\$ – Elliot Alderson Sep 14 '18 at 18:40
  • \$\begingroup\$ @Elliot less likely to short, longer so it can be easier to manage on a crowded board, flexible and lasts longer than flexing a bare resistor. It's not completely off the walls illogical. \$\endgroup\$ – Passerby Sep 14 '18 at 19:16
  • \$\begingroup\$ @Elliot That is right. It is only used during development where the wiring has to be changed very often. \$\endgroup\$ – Rolf Sep 15 '18 at 20:28

No, in normal cases that should make no noticable difference.

But maybe

  • the dupont headers don't make good contact with your breadboard
  • your setup is marginal in some way (frequency too high?) and this extra wiring tripped it over the edge
  • you made some other mistake (from the 2nd photo it seems that you might have a breadboard that has a halfway break in the power lines, but the last foto is a 400 holes bb which I have never seen with breaks)
  • \$\begingroup\$ Thanks for the confirmation. a) I have double-checked the contacts of the dupont headers; I also made 2 sets of modded Dupont cables and tested them on 2 breadboards; b) The frequency is 100Khz which is not so high for I2C (tests with 10Khz and 400Khz show the same problem). \$\endgroup\$ – Rolf Sep 14 '18 at 17:18
  • \$\begingroup\$ ... c) Yes, I probably made another mistake, hoping to figure it out with the Logic Analyzer and see what goes wrong with the CLK signal. Note that the 10K pullups are also enabled on the sensor breakout board but they do not seem to have an effect (although I can measure 10K between the SCL pin and the VCC pin when the I disconnect the sensor). Maybe I should solder everything on a PCB perfboard but that is a lot of work, and the project is honestly not ready for that. \$\endgroup\$ – Rolf Sep 14 '18 at 17:18

There is definitely a difference: one works and the other doesn't.

But joking aside: the Dupont cable is going to introduce more capacitance. You don't mention the SCL frequency, but if the capacitance is too much, the SCL rise time will degrade. It can degrade to the point where it doesn't go over VIH, at which point I2C won't work anymore.

It's too bad you don't have an oscilloscope, because you would be able to check for this easily. The quickest way to check will be to lower the I2C frequency to something ridiculously slow; if that works, than the capacitance is your problem. If it is your problem, you can fix it by lowering your pullup resistance, which will clean up the rising edges.

  • \$\begingroup\$ Just saw your response to the other answer that you've already tried 10kHz...I will let my answer stand for now in case there's anything else in there that might be helpful. \$\endgroup\$ – Annie Sep 14 '18 at 19:46

I have taken some drastic measures to get to the bottom of this; and the setup is working now :)

  1. I have read somewhere that I2C was designed primarily to hookup I2C devices which are relatively close to the MCU. I was using 30cm Dupont cables to hookup the sensor board (I2C Slave) to the MCU (I2C Master). So I have replaced those with shorter 10cm Dupont cables and now it works flawlessly (the external pullup resistors are also not needed anymore).

  2. I'm using another new and different type of breadboard. I have dismantled the transparent breadboard that was used for this project and saw that the metal connections were of bad quality (although I have used a few of them for 3 months without problems). I assume the connections of a breadboard wear out over time and a breadboard needs to be replaced every now and then when used intensively.

I hope these assumptions are correct and that the reports will help others as well.

enter image description here


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.