2

Recently found out that using the pigpio library one can set the raspberry pi to be a slave in a bus setup with an arduino. Someone has even written some test code on the RPi forums which shows that a setup of RPi and arduino can be set as a slave-master. My biggest question now is how to wire them together. I'm using an Arduino Uno which is 5v and the raspberry pi is only 3.3v tolerant. I read that I2C setups usually has a power cable and pull-up resistors connected to the SCL and SDA lines but many pictures do not show these lines. After some brief discussion, I was told to setup something similar to the explanations.

I'm wondering if the schematic and my understanding are correct for setting up the I2C connection between the RPI and Arduino. Attached below is the picture of the schematic.

edit: Updated my schematic to use the correct pin layout

enter image description here

Hojo.Timberwolf
  • 177
  • 2
  • 9

1 Answers1

2

To use the Pi as an I2C slave you have to use GPIO 18 and GPIO 19.

From the pigpio documentation.

The BSC peripheral uses GPIO 18 (SDA) and 19 (SCL) in I2C mode

See bsc_i2c and bsc_xfer.

You do need external pull-ups to 3V3 as those GPIO do not have any external pulls. For reference GPIO 2/3 have 1k8 external pulls to 3V3.

joan
  • 71,852
  • 5
  • 76
  • 108