Thursday, June 11, 2015

How to hack into computer’s I2C bus

Few weeks ago I added GPIOs to ESP8266 module by soldering few wires. This time I’m “adding” an I2C bus to my laptop by just soldering some wires!

Back in 2006 I saw an wiki-page on lm-sensors -website (This one!) describing that one could tap into the PC’s I2C bus via the memory module. Back then I hadn’t soldered any SMD stuff and I decided using a parallel port was better way to interface with I2C devices.

Years later parallel ports kinda disappeared and I2C devices didn’t. Interfacing I2C devices though USB-port needs a USB to I2C adapter or a microcontroller that acts like one. But that costs a dollar or maybe even few dollars and uses one USB-port! There must be cheaper way to do it. I remembered the old wiki-page and decided to try it out with more modern memory module. I had plenty of DDR2 SO-DIMM modules, so I decided to try with one of those. The specific module had 24c021 EEPROM/Supervisor chip. It’s like 24c02 with some extra features (which aren’t relevant to this hack). Pinout was available in the datasheet and I was ready to go.

I had LM75 -temperature sensor on my table, so I tested the hack with that one. I soldered few wires, installed software to test the hack (i2c-tools and lm-sensors) and it was time to test if I could access the temperature sensor. I was able to read data from the sensor and lm-sensors detected it. Just to make sure the detected lm75 was actually the one I added, I run lm-sensors every second and touched the sensor to see that the temperature reading started to go up. It works!

I’ve seen some hacks where people have added USB-enabled microcontrollers inside laptops to add something like LEDs or sensors, but those hacks will use an USB-port. This hack doesn’t disable any featuress, but just adds new ones.