Hauer
Posts: 1
Joined: Tue May 26, 2020 10:13 am

I2C scanner find nothing when connecting to Arduino with USB port

Tue May 26, 2020 10:25 am

Hi guys, I have been trying to connect Raspberry Pi 4B to Arduino by USB port, and then connect Arduino UNO to several sensors by I2C. Successfully, I install and run Arduino IDE on my Raspberry Pi and also compile with it. However, there's something wrong when I run the scratch code "I2C scanner" (from Library <Wire.h>). I couldn't find any I2C address in my Arduino UNO BUT with the same assembling, I could find the correct I2C address when I connect Arduino UNO to my PC. Could anyone tell me what step might be forgotten when I'm running this project?

Hardware: Raspberry Pi 4B(Raspbian) / PC(Win 10) / Arduino UNO
Sensor: MAX30102
Communication: Raspberry Pi - Arduino: USB / Arduino - MAX30102: I2C

---
And I found that the TX LED twinkles when I connect Arduino UNO to PC, but the TX LED is dead when I connect Arduino UNO to RBP

beta-tester
Posts: 1373
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: I2C scanner find nothing when connecting to Arduino with USB port

Tue May 26, 2020 5:34 pm

hello and welcome...

you mean the TX LED of the Arduino isn't flickering when it is connected to the RPi?
and do you mean it isn't flickering while flashing the sketch from the IDE to the arduino or after flashing the sketch at scanning the i²c devices only?

when TX is dead, how could you flash the sketch from the RPi to the arduino ? or was it done from the PC?

did you tried to test the general USB-serial communication between RPi and Arduino board. a simple serial communication sketch?

is the serial communication setted up properly?
(right board, right port, right baud rate)

when the serial communication is working but only no i²c devices couldn't be found maybe there is some noise coming over the USB port... try another USB port on the RPi.
and put all wires of the arduino and max 30102 far away from the RPi, hdmi cable and power supply cable...

is there a termination resistor needed for i²c that is not provided in your wireing? (so it is very sensitive to interferences)
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

Return to “Beginners”