An Arduino UNO is given. I want to establish an I2C communication channel between Arduino UNO and a Linux Machine which have only USB ports available to communicate with peripherals. Currently I can communicate with Arduino board via USB Serial cable (TXD and RXD which are on pins D0 and D1).

My question is: is there any way to use those pins as SCL/SDA to communicate via I2C with Arduino Board?

I am thinking that the only way to accomplish this is to buy an USB to I2C Adapter and connect to A4 (SDA) and A5 (SCL); but maybe I'm wrong.

I have also seen that way: https://gist.github.com/kraftb/8c0bbcc35a9778608d74. Basically to use an intermediate Arduino board.

  • 1
    Why? I wonder ... – user31481 Jul 19 '17 at 12:13
  • @LookAlterno Because it's faster? – caffeine Jul 19 '17 at 12:29
  • The speed grades for I2C are: standard mode: 100 kbit/s; full speed: 400 kbit/s; fast mode: 1 mbit/s; high speed: 3,2 Mbit/s. USB 2.0 Hi-Speed is 480 Mbit/s (~57 MB/s). USB is faster. – user31481 Jul 19 '17 at 12:38
  • 1
    What about Serial port speed? USB speed is not limited by Serial speed from Arduino UNO? – caffeine Jul 19 '17 at 12:56
  • 4
    I'm voting to close this abandoned question because it arises from a misconception – Chris Stratton Oct 17 '17 at 17:52

With SoftwareI2CLibrary you can specify other pins, I haven't tested it with RX and TX.

I would recommend the USB serial interface is fast (2M baud) in perspective to that we are discussing a Arduino with a speed of 16MHz.

| improve this answer | |

The Arduino contains a USB to UART adaptor (made from an ATMega16U2) which then connects to the UART pins 0/1. If you want a different protocol you will need a different adaptor that works with your desired protocol.

| improve this answer | |
  • This may somewhat miss the point - even if you reprogram both chips on the Uno, you'd have to bit-bang I2C between them, which is certainly slower than using their hardware UARTs. Now if you could do some surgery to connect their I2C pins it might be a different story. But theoretically their UARTs can run faster than I2C's faster mode. – Chris Stratton Jul 19 '17 at 20:45
  • @ChrisStratton Personally I would use a direct USB connection to a suitable microcontroller. Especially as I now have my own modular USB stack for my favourite PIC32 microcontrollers... – Majenko Jul 19 '17 at 20:50
  • This is a bit miss leading, an Arduino can have different USB to Serial IC chip. – MatsK Aug 18 '17 at 14:26
  • A genuine Arduino made within the past few years has an ATMega16U2. If it doesn't then it isn't an Arduino. It's a clone, or a counterfeit device. – Majenko Aug 18 '17 at 14:27
  • 1
    Arduino is a brand. It is trademarked. While it is open source hardware the name isn't. Arduino Uno, Arduino Mega 2560, etc, are all made by Arduino and Arduino only. Or they have been counterfeited. – Majenko Aug 18 '17 at 14:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.