1
\$\begingroup\$

I have a lot of trouble running a prototype made up of two I2C modules, one of which is disabled at the beginning.

Here is the list of components:

  • Arduino Uno
  • LCD I2C module
  • Moisture sensor module (ads1115 + moisture sensor)

The moisture sensor module is swithed off by default to prevent oxydation of the sensor's electrode.

When the arduino starts, the current flowing in the SDA/SCL pins of the moisture sensor module creates a loop, and conflicts with the LCD module.

I can make it work if I remove the transistor, and connect the Vin pin of the moisture sensor directly to the arduino Vout

How can I make them work together? I guess I should use a diode somewhere, or use one or two more transistors to prevent current from entering SDDA/SCL pins...

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • 2
    \$\begingroup\$ please show where the two pull-up resistors on SDA and SCL lines are located, and to what voltage source these resistor go to...on your schematic. I would hope they go to Arduino Vdd supply. The schematic editor does allow component values to be edited. We really need a correct schematic in order to help. \$\endgroup\$ – glen_geek May 4 '17 at 21:48
  • \$\begingroup\$ And show your grounding and power while you are at it. \$\endgroup\$ – Trevor_G May 4 '17 at 21:50
  • \$\begingroup\$ schematic corrected ! the two pull-up resistors are located in the arduino Uno \$\endgroup\$ – dams May 5 '17 at 5:41
  • \$\begingroup\$ At long distances, cable capacitance plays an important role and forms a low pass filter with pull up resistors. \$\endgroup\$ – Rohat Kılıç May 5 '17 at 5:49
  • \$\begingroup\$ I have used a shielded wire. That solved the problem of the lcd module working randomly. But I still can't control the moisture sensor activation \$\endgroup\$ – dams May 14 '17 at 16:51
1
\$\begingroup\$

I2C was never designed to work over long distances, it's only intended for connecting devices on the same PCB or adjacent PCBs. The capacitance of long wires kills the signal edges. However, there are ways to get this work. This Hackaday article describes some options. Of these options you should probably go with a differential bus buffers (PCA9615). The differential buffer will solve two problems for you: it will drive your long cable, solving capacitance problem; and it will give you protection from noise induced on the cable.

\$\endgroup\$
  • \$\begingroup\$ I have used a shielded wire. That solved the problem of the lcd module working randomly. But I still can't control the moisture sensor activation \$\endgroup\$ – dams May 14 '17 at 16:52

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.