17 Comments

  1. [...] Micho at Neophob.com has been experimenting with setting up the Raspberry Pi as an I2C master with an Arduino slave. Read more here [...]

  2. Links #4 | Björn Salgert
    Links #4 | Björn Salgert April 6, 2013 at 13:14 .

    [...] Per I2C vom Raspberry Pi zum Arduino [...]

  3. [...] I want to send data from my RPI (master) to one or multiple Arduinos (slave) via I2C bus. Hint: The RPI is running with 3.3V while the Arduino is running at 5.0V. I read some tutorials where they u…  [...]

  4. Pablo
    Pablo April 8, 2013 at 00:07 . Reply

    Hi, good work! One question: why not connect directly with USB to communicate?

  5. Claire
    Claire April 8, 2013 at 01:56 . Reply

    Hi! I work with engineering website EEWeb.com and would love to do an exchange of website links and feature you as a site of the day on EEWeb. Is this of interest to you?

  6. [...] tutorial covers the code required for both platforms and also debugging and testing, soclick here to get started. And for more, we’re on twitter and Google+, [...]

  7. Pete G
    Pete G April 8, 2013 at 11:20 . Reply

    Brilliant work, there’s lots of people needing this.

    One small point, I2C data bus will be bi-directional, not single as you stated. Both devices will send data on it. The reason it works, is that the devices using it have open-collector drivers, and pull-up resistors to the power supply rail. An arduino does not have any pull-ups installed, but the P1 header on the Ras-Pi has 1k8 resistors to the 3.3v power rail. Data is transmitted by pulling the lines to 0v, for a “high” logic signal, and then letting them float (pulled-up to the supply rail) for “low” logic. Because there is no pull-up resistor in the Arduino and because 3.3v is within the “low” logic level range for the Arduino everything works as it should. Remember though that if other I2C devices are added to the bus they must have their pull-up resistors removed.

  8. Andy
    Andy August 23, 2013 at 09:09 . Reply

    very cool!
    What IDE (on what OS) are you using to create the Java code for the RPI? I am somewhat familiar with ecplise (and win/osx as operating systems) but had my troubles crosscompiling for the rpi.

  9. […] I want to send data from my RPI (master) to one or multiple Arduinos (slave) via I2C bus. Hint: The RPI is running with 3.3V while the Arduino is running at 5.0V. I read some tutorials where they u…  […]

  10. Anush
    Anush July 12, 2014 at 05:38 . Reply

    Hello,Amazing tutorial….interesting post….I tried Implementing the same ,but have come across a few problems…..one of are when I run the class file it does not detect the arduinoit throws an exception (Exception in thread “main” java.io.IOException: Error writing to /dev/i2c-1 at address 0×4. Got -20001.
    at com.pi4j.io.i2c.impl.I2CDeviceImpl.write(I2CDeviceImpl.java:90)
    at I2cExample.main(I2cExample.java:34)
    )……Could you help me….

  11. medalist
    medalist November 19, 2014 at 20:04 . Reply

    hey guys,

    I have tried to communicate pi and arduino over i2c with PHP. Everything works fine, but I had to use that terrible functions like “shell_exec”, “exec” or “system”. It was very slow, but I have found a very nice solution. I wrote my own PHP extension, so now I have some new functions in PHP (i2c_init, i2c_request and i2c_detect) and the speed is some hundred times faster then before.

    If anyone is interested, please mail me. ;)

    BR
    Medalist

Leave a Reply

%d bloggers like this: