1
\$\begingroup\$

I designed a PCB board with some sensors (gyros, accelerometers, and etc.) using the I2C protocol to communicate. However, when I use an Arduino UNO as the master, I'm not able to see the waveform of both the SDA bus and the SCL bus. They remain static at ~400mV when measured by an oscilloscope. When I use a different board (such as this one) with the same test set, I can clearly see the waveform that SDA and SCL produces

Usually, it either means that something is shorted, but I didn't see any problem when I used a multimeter to check the continuity of all the vias for SCL, SDA, VDD, and GND. The resistance between SCL/SDA to GND is ~1M Ohm.

It could also be that the pull-up resistors on the I2C bus are missing, but I did use a 4.7kOhm pull-up resistor for every I2C bus. I also tried to lower the resistance by connecting a paralleled potentiometer. The voltage of SCL/SDA increases as the resistance decreases, but there's no waveform at all.

There are actually 3 I2C lines on the board to avoid conflicting I2C addresses, and none of them work. The simplest line only contains a gyro and an eCompass. The schematics are below: gyro eCompass

You can find the full EAGLE schematics and board files here.

\$\endgroup\$
14
  • 5
    \$\begingroup\$ Sounds like you do NOT have pull-up resistors. Measure resistance between SDA and SCL and VDD. Then make sure VDD is powered, when circuit is ON. They should go high. \$\endgroup\$ Sep 2 at 0:13
  • 1
    \$\begingroup\$ It is more likely a software problem. \$\endgroup\$ Sep 2 at 1:03
  • \$\begingroup\$ If you connected 4.7k Ohm, resistance between SCL/SDA to GND likely be lower than 1Meg Ohm. Probably, you need to measure the resistance between SCL/SDA to VCC as well. \$\endgroup\$
    – jay
    Sep 2 at 1:32
  • \$\begingroup\$ The resistance between SCL/SDA and VDD is in fact 4.7 kOhm as expected (measured by multimeter). VDD is definitely powered - I used an LED on the board to verify it. I also don't believe it's a software problem. I tried different basic programs to establish I2C communication already. None of them worked on my board, but they work on other boards \$\endgroup\$
    – user295069
    Sep 2 at 2:12
  • 1
    \$\begingroup\$ your resistance between SDA and SCL is correct - 4.7k from SCL to VDD, another 4.7k from VDD to SDA, makes exactly 9.4k. As recommended here, disconnect all slaves and see if the lines go high. This actually does seem like software issue, such as misconfigured MCU pins (not 100% sure of course) \$\endgroup\$
    – Ilya
    Sep 2 at 8:30
3
\$\begingroup\$

There are several issues with your design.

Schematic:

  • VDD_IO pins of the LSM303 are connected to ground
  • Vref pin of ADC128D818 connected to 5V which exceeds the supply voltage
  • possibly more, I have not made an exhaustive check.

The first of these is probably sufficient to cause the problem.

PCB:

  • Very tight 5 mil clearances everywhere and traces getting very close to vias. While it might work if made by a good fab this is asking for trouble and an accidental short somewhere. You don't even need such tight clearances for this board, so make it easy for the fab :)

  • Traces are also very thin — this is OK for signal but make sure your power traces, including those to decoupling caps, are a bit thicker. Short power traces can be 10 mil, try to use more for any long ones.

I'd suggest first tidying up your schematic. Use the power supply symbols (eg. +3V3, +5V etc.) rather than net labels for clarity. Use the boxed & pointy type of net labels throughout ("Xref" checkbox in property dialog) and make sure it's obvious which wire they're connected to (don't have the label offset from the wire).

Once that's done, check everything for potential mistakes. Go through each datasheet, bring up the "pin configuration and function" section and check the schematic pin by pin, also checking the allowed voltages. Then redo your PCB with slightly more generous clearances and make sure there are no DRC violations.

\$\endgroup\$
9
  • \$\begingroup\$ Thank you so much! That VDD_IO error is huge. I will definitely double check the schematics and redesign the board. redesign the board. BTW I used OSH-Park for the PCB board. I'm not sure whether they are good or not haha \$\endgroup\$
    – user295069
    Sep 2 at 23:55
  • \$\begingroup\$ @user295069 OSHpark are fine so probably the PCB turned out OK, but it's still a good idea to design your PCB with larger clearances. Did you use the autorouter? This is a classic cause of traces getting very close to vias when they don't actually need to. \$\endgroup\$
    – DamienD
    Sep 3 at 10:19
  • \$\begingroup\$ Also, beware of Eagle's schematic editor: only the tip of the pins creates a connection. So for instance it's unclear if pin 18 of U4 actually connects to C2 and if C2 actually connects to ground. Best to disambiguate this by spacing out the symbols so there's always at least one unit of green wire between pins and connections. A good way to test this is to move the part; if the wires don't move with it they were not actually connected, even though they may have overlapped. Caught me a few times. \$\endgroup\$
    – DamienD
    Sep 3 at 10:23
  • \$\begingroup\$ I just checked and C2 doesn't connect to pin 18: try to move C2 and observe. It only works because you manually labelled the wire on pin 18 to be the same net. \$\endgroup\$
    – DamienD
    Sep 3 at 10:30
  • 1
    \$\begingroup\$ I desoldered the LSM303 and the rest of the sensors all work! Thank you so much \$\endgroup\$
    – user295069
    Sep 19 at 6:43

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.