No I2C Devices Found

Hi there! This is my first time using Arduino (or doing any electrical work in general), and I'm not getting any of the I2C devices I have connected via the header pins on my UNO R4 WiFi to show up. I have a sketch that goes through both buses (Qwicc/Header). I'm pretty sure there is something that I have wired wrong and would appreciate some guidance. Thank you! I've attached a photo but the wiring is pretty messy.

I doubt anyone can read the rats nest of wires. Here is what I suggest. First always post your code using code tags. Next start simple with just your display and your Uno R4 board. There is plenty of code examples out there. Keep it simple and make sure you get the SCL and SDA pins correct.

Ron

Start by reading the pinned post re 'How to get the most from the forum'.

Not sure if it would help you, here is a version of a Wire Scanner I use for the UNO R4 boards. Adapted from a version for Teensy(PJRC) Boards

Wire_Scanner_all_UnoR4-260813a.zip (2.5 KB)

I plugged in a Sparkfun TOF imager to the Qwiic connector and output:

Scanning(Wire)...
No I2C devices found

Scanning(Wire1)...
Device found at address 0x29  (TSL2561,VL6180,TSL2561,TSL2591,BNO055,CAP1188)

done

At least it might show if it sees anything...

test each device (LCD display, sensor, relay, etc) in a separate program - when all work OK then start building the complete program

e.g. your photo in post 1 appears to have a LCD display connected via I2C

try this program (you may need to change the number of line/columns etc to suit your display)

// UNO R4 WiFi I2C LCD 20*4 display

// from https://arduinogetstarted.com/tutorials/arduino-lcd-i2c

#include <DIYables_LCD_I2C.h>

// the I2C address is 0x27 (some displays use 0x3C)
// if in doubt use an I2C scanner to determine the address
DIYables_LCD_I2C lcd(0x27, 20, 4); // I2C address 0x27, 16 column and 2 rows

void setup()
{
  lcd.init(); // initialize the lcd
  lcd.backlight();
}

void loop()
{
  lcd.clear();                 // clear display
  lcd.setCursor(0, 0);         // move cursor to   (0, 0)
  lcd.print("Arduino");        // print message at (0, 0)
  lcd.setCursor(2, 1);         // move cursor to   (2, 1)
  lcd.print("GetStarted.com"); // print message at (2, 1)
  lcd.setCursor(1, 3);         // move cursor to   (column 0, line 3)
  lcd.print("Hello World"); // print message at (2, 1)
  delay(2000);                 // display the above for two seconds

  lcd.clear();                  // clear display
  lcd.setCursor(3, 0);          // move cursor to   (3, 0)
  lcd.print("DIYables");        // print message at (3, 0)
  lcd.setCursor(0, 1);          // move cursor to   (0, 1)
  lcd.print("www.diyables.io"); // print message at (0, 1)
  lcd.setCursor(1, 3);         // move cursor to   (column 0, line 3)
  lcd.print("Hello World"); // print message at (2, 1)
  delay(2000);                  // display the above for two seconds
}

when run on a UNO R4 WiFi shows

what devices are you attempting to connect? do some use 3.3V logic?

you need to check that any libraries you use work on a UNO R4 WiFi/Minima

Look up Nick Gammon (Gammon.au) very useful website.

I'm quite certain he has I2C tools that you can run. You simply load his code onto your board and the results appear on the serial monitor.

Hi, @bbao
Welcome to the forum.

Have you got 4K7 pullup resisitors on each of the I2C wires?


Can we please have a circuit diagram?
An image of a hand drawn schematic will be fine, include ALL power supplies, component names and pin labels.
Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

note that

// UNO R4 WiFi manual https://docs.arduino.cc/tutorials/uno-r4-wifi/cheat-sheet/?queryID=02def294265afed46fc5704f9d452a8e

// states "he Qwiic connector on the UNO R4 WiFi is connected to the secondary I2C bus (IIC0), which uses the Wire1 object rather than Wire"

Welcome!
I would like to see an annotated schematic showing all connections in your project. Be sure to include all power sources and links to technical information for each hardware device.

When I build prototypes, I use a consistent wire-color scheme: mainly red for positive supply, black for ground, and then one color for each signal type where practical. This makes troubleshooting much easier and reduces the chance of wiring mistakes. As I wire the project, I generate a color table and put it in a comment at the top of the code.

Common practice in industry, indeed mandatory. Someone with far more experience pointed out the need for consistent colour coding and "star" earthing.

Always a good idea to document it all even at domestic level.

12-months down the line, it'll be be "what does that wire do or go"

I opened up a terminal box yesterday with a row of DIN rail terminals. Inside were all my notes on the wiring scheme dated 2017.

Big fan of 8" x 5" record cards, backed up by a spreadsheet.

I hear and agree with what @tigger and @gilshultz mention which is great stuff.

But sometimes it depends on if this is something you are just experimenting for the day with or if this is part of a long term project. Long term projects I endup buying some new jumper wires to make it easy to color code things.

Quick and dirty I grab whatever wires that I can find from ones I reclaimed from other experiments...

But the other main point I would suggest is to start off simple, that is
wire up one of your sensors, does it work? If so, try adding a second one, do
both still work? ... Up until your last wire object.

Check that all of your devices are setup to handle the same voltage. Ones that are QWIIC I am pretty sure are all 3.3v And I believe there are probably PU resistors on the QWIIC wiring.

As for the other wiring:
The Wire object should be connected to the SCL/SDA pins not A4/A5.
Never mind I think those pins are wired to the same processor pins...

Nothing wrong with quick and dirty.
Sooner or later though, it can come back to bite.
You have a train of thought one day and something quite different the next.
It's the same with changes to sketches.
As they develop, you can lose track of changes.
Save as. Save as different versions.
Always something to revert to.