Bitbanging I2C by hand

I2C

Play around with electronics long enough, and eventually you’ll run into I2C devices. These chips – everything from sensors and memory to DACs and ADCs – use a standardized interface that consists of only two wires. Interacting with these devices is usually done with a microcontroller and an I2C library, but [Kevin] wanted to take that one step further. He’s bitbanging I2C devices by hand and getting a great education in the I2C protocol in the process.

Every I2C device is controlled by two connections to a microcontroller, a data line and a clock line. [Kevin] connected these lines to tact switches through a pair of transistors, allowing him to manually key in I2C commands one bit at a time.

[Kevin] is using a 24LC256 EEPROM for this demonstration, and by entering a control byte and two address bytes, he can enter a single byte of data by hand that will be saved for many, many years in this tiny chip.

Of course getting data into a chip is only half of the problem. By altering the control byte at the beginning of an I2C message by one bit, [Kevin] can also read data out of the chip.

This isn’t [Kevin]‘s first experimentation in controlling chips solely with buttons. Earlier, we saw him play around with a 595 shift register using five push buttons. It’s a great way to intuit how these chips actually work, and would be an exceptional learning exercise for tinkerers young and old,

[Read more...]

PCA9517 i2c translator a perfect companion for Raspberry Pi hardware add-ons

The rig pictured above works as an Internet connected temperature sensor which sends [Zaion] an email with a graph of the change over time. This in itself is interesting, but one part in particular caught our eye. He’s using an i2c temperature sensor , and we think the PCA9517 Level-Translating I2C Bus Repeater that makes it possible is a perfect match for the RPi.

This is a Texas Instruments part. You can find more about it from the company’s product page. The key words in the name of the chip are ‘Level-Translating’. This has two bus connections, each with variable voltage levels. On side A the bus can be 0.9V to 5.5V. On side B the bus range is 2.7V to 5.5V. Since the Raspberry Pi I/O pins operate at 3.3V this could connect to the B side, give you the ability to interface with i2c parts rated for lower or higher voltages. This is especially handy for folks who started with the Arduino and own mostly 5V compliant prototyping hardware.

The part comes in a SOIC package, which you can easily hand solder and will costs around $1 depending on the supplier.

A truly professional Raspi analog input

Much to the chagrin of hardware tinkerers, the Raspberry Pi doesn’t have analog inputs on its GPIO pins. Sure, you can blink a LED with just a few console commands, but reading sensors with a bone-stock Raspi requires a little additional hardware. [Brian Dorey] just released a board that allows for 8 analog inputs on the Raspberry Pi with a 16-bit resolution that is much higher than any Arduino-based build.

[Brian]‘s build is based on an earlier, similar iteration of a Raspi analog board we saw last July. Like the previous version, the new professionally made PCBs use a pair of Microchip MCP3428 analog to digital converter. These ADCs are able to sample four channels at a resolution of 16 bits; a vast improvement over the 8-bit ADCs included on every Arduino.

The boards communicate with the Raspberry Pi over an I2C serial bus using a neat stackable header. In theory, it should be possible to use several of these boards and measure dozens of analog channels, but we’ll leave a demonstration of that up to [Brian].

Word clock of a different nature

This work clock functions in an unexpected way. With each passing second it displays a random four letter word on the right side of the display. Traditional word clocks tell the time in natural language, but this one is simply used as a learning opportunity.

[Iron Jungle] got his hands on the display for just five buck from Deal Extreme. Looks like the price has gone up two dollars but that’s still a bargain. He wanted to use all eight digits of the display, and was looking for an opportunity to control more than one i2c device at a time. He ended up rolling an EEPROM and DS1307 RTC into the design. He figured the could display 24-hour time on four of the digits, and pull a library of four-letter words off of the EEPROM to fill the rest. He grabbed a word list off of the Internet then used a Python script to remove words containing 7-segment unfriendly characters (K, M, V, W, X, Z). The final touch was to use a salvaged relay to give the clock a ticking sound. Hear it for yourself in the clip after the break.

[Read more...]

An Adafruit Raspberry Pi extravaganza

The folks at Adafruit are busy as a bee working on bringing some of their really cool boards to the Raspberry Pi platform. Here’s a few that came in over the last few days:

16 servos is almost too many

Servos require a PWM output but the Raspi only has hardware support for PWM on a single GPIO pin; certainly not enough to build a gigantic, city-leveling robot. [Kevin] over at Adafruit put together a tutorial for using this 16 channel servo driver with the Raspi.

12 bit DAC

With only one PWM pin and no analog out, it was only a matter of time before someone hooked up the Adafruit 12 bit DAC to the Raspberry Pi.

16×2 LCD displays

Both the servo and DAC builds use the Adafruit I2C library and a bit of Python. Of course it’s possible to treat the GPIO pins on the Raspberry Pi as digital outs, just as [Mikey] did with his Raspi LCD display tutorial.

So, what distro are you using?

Of course all these builds use Adafruit’s Occidentalis distro, a maker-friendly Linux distro we’ve posted about before. It’s too useful to languish as a single Hackaday post, so here it is again.

Raspberry Pi keeps tabs on your solar power setup

raspberrypi-solarlogger

[Brian Dorey] has been adding green power solutions to his home for some time now, and as things have progressed, he has experimented with several different iterations of data loggers. The latest system watching over his solar power setup is a Raspberry Pi armed with a custom-built I2C analog/digital converter.

The Rasp Pi is responsible for monitoring several different temperature sensors related to his solar water heating and storage system, but that’s just the beginning. It also keeps watch over his roof-mounted solar electric panels, his battery bank, and its charge controller. For good measure, he also monitors his home’s temperature and his water tank’s recirculation pump because, why the heck not?

All of the collected data is relayed to his web server where it is handsomely displayed for his perusal and analysis. [Brian] has made his code available here, so you can monitor your home in the same fashion with little fuss.

Start thinking 4th dimensionally with a time circuit tutorial

When [Phil Burgess] showed off a few I2C – controlled seven-segment displays on adafruit’s weekly vlog, the comments immediately turned to the time circuits featured in everyone’s second-favorite time machine, the Back to the Future DeLorean. The time circuits are now active, so now you can easily add a temporal display to your car well before a hover conversion.

[Phil] used these LED displays, conveniently controlled by a four-wire I2C bus. Although the displays are addressable independently, it’s only possible to assign each display to one of 8 I2C addresses. [Phil] figured out a neat way to control the 9 displays of the time circuit with the help of a 74HC138 3-to-8 line decoder.

The case was constructed out of clear acrylic lasercut in adafruit’s shop and spray painted with faux-metal paint. After installing the seven-segment displays, a Teensy, ChronoDot, and a few AA batteries finished up the build.

With any luck, the design files for the laser cut case should be available shortly, so get those I2C displays while they’re still in stock.