Since our robotics kit uses an I2C bus, it would be really handy for me to have a USB-to-I2C adapter. With the addition of a simple RJ11 adapter, I’d be able just plug in a module and start hacking on it without the annoying set-up times, that involve sorting out the Slug and power board combo. If Student Robotics had several of these adapters, then any member could just grab a module and start hacking on some code.
I’ve just come across Till Harbaum’s i2c-tiny-usb design. Rather surprisingly this uses a relatively cheap ATtiny45 Atmel AVR and nothing else. It bitbangs the USB protocol. Apparently, this works rather well. What’s even more exciting, is that there’s a kernel driver available for the i2c-tiny-usb. This makes it behave as a proper Linux i2c bus device, so interacting with it from software couldn’t be simpler. This board can be an I2C master with clock speeds of up to 50KHz.
The Open Source InterFace (OSIF) is part of the OpenServo project, and I believe was designed by Barry Carter. Carter took the i2c-tiny-usb design, and adapted it to use an AVR with more pins, and upped the maximum I2C clock speed to 400KHz. Furthermore, the board has support for serial (I think UART), 6 GPIO lines and an ADC channel. Barry Carter sells the OSIF for £20 a board.
Carter also provides a kernel driver for the OSIF as well :-D
I bought an OSIF earlier today. I like the way that the OSIF uses work from two previous open hardware projects to create
4 responses to “I2C Adapters”
Site by Rob Gilton. © 2008 - 2019
I am planning to use OSIF just a a I2C interface (no robotics). For this I need a python-Interface which talks directly to the USB-Interface. Today I will have my first try using http://pyusb.berlios.de.
If you already have somting like this running – please let me know.
I really like your work you do with MSP430, I2c!
If you’re using the OSIF with Linux, then using it with the kernel driver can give you an interface to the bus from userspace through something like /dev/i2c-0. For Student Robotics we use a custom Python library written in C that allows us to do the I2C related stuff from Python.
If you’re interested, the code for it lurks in the Student Robotics subversion, here: http://svn.studentrobotics.org/slug/py2c/trunk/
I’m not guaranteeing that it’ll work for you, but maybe it’ll help you on your way.
P.S. Sorry about the long delay in my response — I’ve been on holiday.
Just wondering if any of you guys have tried the following, for example i2C compass module, then use i2C to usb converter, then usb to cat 5 extender to allow transmission over long distance for use in ROV system, do you think its possible, then convert the cat5 usb on laptop to allow compass data to be read though serial port ?????….
Russell: I’ve never experienced a USB to cat5 extender.
The Compass->I2C->USB->PC->Serial situation certainly sounds viable to me. Unfortunately, I can’t advise on the cat5 extender though :-)
(standard “don’t trust this advice” disclaimer applies here)