3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

World's Cheapest I2C (I-Squared-C) Adapter

World\
Make a sensor interface for your computer for under a buck!

Update 6/9/08: After exploring several avenues I've concluded there is no practical manner of implementing this technique in Microsoft Windows. This is not petty OS bashing, I've really busted a nut trying! Sorry! Windows users needing I2C capabilities are best served by existing USB-based solutions.

Update 5/24/08: Linux support has been added, as well as sample code for the Nintendo Wii Nunchuk controller and the BlinkM "smart LED." See the README.txt file included with the source code for directions on compiling and setup on Linux.

I2C (short for Inter-Integrated Circuit) is a two-wire serial bus typically used in computers for low-level communication between internal components. I2C is also popular in robotics. All manner of sensors and actuators are available in an I2C-compatible form: ultrasonic rangefinders, sensors for acceleration, tilt, temperature and pressure, servo controllers, and bus expanders that provide additional general-purpose (GPIO) lines.

Most modern microcontrollers (Atmel, Microchip PIC, etc.) have support for I2C built right in. But the processing power available on microcontrollers is limited, and software development - with specialized cross-compilers and programming environments - can sometimes be a chore. With laptops and single-board computers becoming ever smaller and more affordable, it's increasingly common to see these systems used directly in robotics and electronics projects. This provides ample power for new capabilities such as vision processing and more sophisticated A.I., and it greatly expands the scope of available development tools and languages...but it also presents a new problem: interfacing these "regular" systems to peripherals is typically done through mainstream consumer-grade ports such as USB; there's no externally-available "I2C port" we can just tap into to make use of our sensors...or is there?
 
Remove these adsRemove these ads by Signing Up
 

Step 1Existing Options

Existing Options
«
  • usb-i2c-alt.jpg
  • usb-i2c.jpg
One way of connecting I2C devices to an ordinary desktop or laptop computer is through a USB-to-I2C adapter. There are at least a dozen such options out there, ranging from do-it-yourself kits with open source software, to sophisticated commercial units with every bell and whistle.

One downside to the USB-to-I2C approach is cost. A full-featured commercial model can cost $250 or more. Even the "free" homebrew alternatives assume a collection of parts and a prior investment in a microcontroller programmer and the related knowledge to make use of it. Another downside is the relative scarcity of driver support outside the popular Windows fold. Few of these devices work natively on Macintosh or Linux computers.
« Previous StepDownload PDFView All StepsNext Step »
44 comments
1-40 of 44next »
Apr 4, 2011. 12:03 PMComputothought says:
I have not tried this but it looks interesting.
http://www.maxim-ic.com/app-notes/index.mvp/id/3230
Jun 17, 2009. 9:42 AMcyrozap says:
When you say that it doesn't work on the Eee PC, which one are you referring to? I have the 1000HE.
Aug 16, 2008. 3:41 AMDerin says:
AHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!THEY DONT SELL USB TO I2C ADAPTERS HERE AND IM NOT ALLOWED TO USE LINUX!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Feb 4, 2009. 1:30 PMReCreate says:
what do you mean by"IM NOT ALLOWED TO USE LINUX!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" who cares if they don't want you to use linux...setup your own in a usb thumb drive
Dec 16, 2008. 6:02 PMsoshimo says:
There are several options. First you can install Cygwin and probably with some minor tweaks in the code get it to compile and run under Cygwin. Second, you can just replace the platform specific code (which there probably isn't much of being a Linux program) with Windoze code (I'm assuming the source is OSI, MIT or some other similar license).
Oct 23, 2008. 1:54 AMGavabc123 says:
Why aren't you allowed to use Linux?
Aug 13, 2008. 2:40 AMcollard41 says:
do you have a schematic for this, as i was interested in making a PCB for one thanks good i'ble
May 7, 2008. 5:51 PMOra says:
So, there is no way to do this with a macbook pro since it uses an Nvidia graphics card?
Jun 22, 2008. 9:26 AMDerin says:
will ati cards on a pc work?
May 17, 2008. 3:21 AMinfoATcruysen.nl says:
May 17, 2008. 2:59 AMinfoATcruysen.nl says:
Shareware version of software for windows:
http://www.nicomsoft.com/
Apr 23, 2008. 5:59 PMItsgoofytime says:
This isnt really a robot, so why is it entered in the robot contest?
May 17, 2008. 1:59 AM_soapy_ says:
Because it is both brilliant, and robotic control related. So far, it gets my vote.
Apr 24, 2008. 3:14 PMItsgoofytime says:
ah i missed that. just realized the servo too. Hope to see more soon.
May 14, 2008. 4:05 PMDanOverholt says:
Great stuff! you should definitely get a wiimote, tear it apart, and look into getting your code to talk directly to the wiimote's camera module, which speaks I2C - doing this increases the tracking rate to 200Hz: http://procrastineering.blogspot.com/2008/03/tracking-multiple-laser-pointers-200hz.html
Apr 29, 2008. 1:19 PMmoris_zen says:
Any 1 got an example for windows driver source code?
Apr 28, 2008. 7:38 AMloafswell says:
I did some googling around and it appears that nvidia does have a ddc bus and that it can be configured in x configuration, this is in linux. Why do you say that it can't be done with nvidia cards?
Apr 27, 2008. 12:53 PMWire54321 says:
were can i buy a I2C temperature sensor. Thanks for the help
Apr 23, 2008. 6:09 AMBongmaster says:
there appears to be an arduino clone that has a USB bootloader that can connect direct to the usb with no ftdi chip or usb to ttl board. its on the arduino.cc forums somewhere.
Apr 23, 2008. 6:38 AMgmoon says:
There are AVR USB hacks (probably converted for use with the Arduino), but they have sever limitations: USB 1.1 only, they need a specific xtal (so they are useless if you need a different clock source), sometimes require "overclocking" the AVR, take up valuable programming memory, IRQs, etc. There are a couple USB-capable AVRs, but PIC seems to do USB better. But the i2c interface is directly supported by the AVR hardware (it's hardwired logic, not software.)
Apr 23, 2008. 7:37 AMgip_mad says:
A lot of PICs have hardware I2C! :)
Apr 23, 2008. 8:14 AMgmoon says:
Sorry, I didn't mean to imply that they didn't. Both have several comm protocols in hardware....
Apr 23, 2008. 9:31 AMBongmaster says:
i have only just heard of i2c. i already knew that the atmega168 and 8 had ttl serial, but this i2c is something i am gonna look into :)
Apr 23, 2008. 6:07 PMgmoon says:
Atmel calls i2c a "two-wire serial interface." I guess they didn't want to pay for licensing the "i2c" name or technology--just create a compatible version. Could be why you hadn't heard of it....
Apr 26, 2008. 9:56 PMsumguysr says:
i2c has a thousand names as phillips didn't actually patent it but only holds the trademark. It's probably not a matter of cost but rather ability, from what I've heard phillips is pretty picky about who they let in on their licensing of i2c. 2wire is a pretty common name for it though that tends to show up anywhere the other names are mentioned.
Apr 23, 2008. 10:20 AMgip_mad says:
Great instructable! I'll test it soon, I hope to find some info on how to use the DDC in win XP.
Apr 26, 2008. 7:45 PMScottSEA says:
Let me know when you make any progress with the I2C adapter on XP - I too have an XP and would love to try this, but I'm busy on another project right now.
Apr 26, 2008. 4:30 AMcoonass says:
what's the bandwidth on this port? I ask because I'd like to consider using this as an oscilloscope channel, but I'd like to know what the top end of the frequency range is that I'd be able to measure. I can handle voltage scaling by putting in my own external opamp.
Apr 26, 2008. 11:53 AMcoonass says:
Thanks! I appreciate your prompt reply. 100 KHz could be helpful in some apps (I'm not working in RF just now, and more important to me just now is audio and logic pulses in automotive electronics systems - I need more than anything else to be able to sort signal from noise. Looks like that bandwidth might be of real help. Cheers again.
Apr 26, 2008. 2:05 AMbobulator says:
niiice. now I just have to look behind my PC to see if it has one of these DV thingys. does it work on Lunix?
Apr 23, 2008. 8:23 AMliljeberg94 says:
Have you stole my batteries?;S
Apr 25, 2008. 6:10 AMLftndbt says:
I think they could be anyone of half the worlds population... Same as mine too... ;)
Apr 23, 2008. 4:41 AMgmoon says:
Great stuff. With rs-232 and parallel ports disappearing, and USB not directly supported by most micros, this is an excellent alternative.
1-40 of 44next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
2
Followers
2
Author:pburgess