Arduino Infiduino UNO R3 talking to Raspberry Pi4B via I2C

My question is about the pullup resistors that may or may-not be on either board that I wish to connect to each other. On the Arduino I expect to use A4 for SDA and A5 for SCL. On the Pi4B I expect to use J8-Pin 3 (GPIO2) for SDA and J8-Pin 5 (GPIO3) for SCL.

What puzzles me is this business of the I2C bus needing pullup resistors. Specifically, do I need to put resistors in place on the 2 I2C lines OR Does one or both of the boards already have pullup resistors in place for use on the I2C bus?

Part of my problem is in knowing if I have to "enable" any pullup resistors using something like the "pinMode()" function on either board.

Or, is it as simple as just connecting the SDA and SCL pins together on the respective boards?

I prefer Python on the Pi4B and C on the Arduino.

The Pi4B will act as the 'controller' and "send a command" to the Arduino, while the Arduino will act as a receiver and then act upon the received command.

I won't need any special handling in case of a failure to communicate since this is all under control of a real person who will observe if it worked or not and then repeat the process upon detecting a failure. Thanks -- Ray

On the Arduino I expect to use A4 for SDA and A5 for SCL. On the Pi4B I expect to use J8-Pin 3 (GPIO2) for SDA and J8-Pin 5 (GPIO3) for SCL.

You must not connect them directly. The Raspberry Pi runs on 3.3V, the UNO on 5V. The 5V of the UNO may damage the Raspberry Pi! You need a level converter between them.

What puzzles me is this business of the I2C bus needing pullup resistors. Specifically, do I need to put resistors in place on the 2 I2C lines OR Does one or both of the boards already have pullup resistors in place for use on the I2C bus?

You must have the pullups only once per bus. If you insert the level converter it usually already contains the pull-ups (depends on the logic used). The level converter splits the it into two buses, each having it's own pullups (as I wrote usually in the level converter).

The Pi4B will act as the 'controller' and "send a command" to the Arduino, while the Arduino will act as a receiver and then act upon the received command.

Why did you choose I2C for the connection of the two? In most situation we see here in the forum, I2C is a bad choice. Why don't you just connect the UNO to the Raspberry Pi by USB and have a solid UART communication?

pylon: You must not connect them directly. The Raspberry Pi runs on 3.3V, the UNO on 5V. The 5V of the UNO may damage the Raspberry Pi! You need a level converter between them.

I'm using the Arduino Infiduino UNO which has a 3.3v/5v switch so I can avoid the level shifting.

You must have the pullups only once per bus. If you insert the level converter it usually already contains the pull-ups (depends on the logic used). The level converter splits the it into two buses, each having it's own pullups (as I wrote usually in the level converter).

I'm told the Pi 4B has the I2C pullup resistors on-board (1.8K).

Why did you choose I2C for the connection of the two? In most situation we see here in the forum, I2C is a bad choice. Why don't you just connect the UNO to the Raspberry Pi by USB and have a solid UART communication?

I began with the approach you mention, but it takes away the ability to use the Arduino IDE serial monitor for DEBUG prints because the serial port can't be shared by the Arduino and the Pi.

As a alternative to I2C, I used the software serial library on the Arduino using pin 10 as RX (I don't need TX) and I use a USB-Serial-TTL cable like people use for console use and debugging. I use the one from Adafruit (FTDI Serial TTL-232 USB Cable Product ID: 70).

The Pi has a Seeed 4-Mic ReSpeaker mounted on it which physically consumes all 40 pins, but it exposes, via 2 Grove connectors, 2 interfaces: GP12 which is GPIO 12 and 13 and I2C which is the normal I2C. At this point, I have a solution to my problem using either GPIO 12-13 or I2C. The down side is the distance limitation. (Currently a non-problem).

However, I am looking into the possibility of wireless between the Arduino and the Pi.

The Arduino will be running a program which lets me send commands to my model electric trains, via a CC1101 based radio, such as "Sound the Horn". The Seeed 4-Mic ReSpeaker board lets me command the engine to blow its horn by voice whereas I currently command it either by a button press or an RFID tag detection.

Thanks for the reply. Ray