Adding GPIOs To The Raspberry Pi With The Camera Interface

GPIOs

The Raspberry Pi Model B+ was just released, and now everyone who picks one of those up has a few more GPIO pins to play around with. For the millions of people with the two-year-old version of the Pi, we’re still stuck with the same old, same old: 17 GPIOs on the big header, and that’s about it as far as toggling pins goes.

The Broadcom SoC on the Pi has far more GPIO pins than are broken out on the large header, and a few of those go to the CSI camera interface. These GPIOs can be broken out with a few flat cables (Portuguese, Google Translatrix), giving you four more GPIOs, and this technique can also be used with the new, expanded Model B+.

The CSI camera connector has two I²C lines that go directly to the camera, controllable in Linux as GPIO0 and GPIO1. There are two more GPIO connectors on the CSI connector controllable as GPIO5 and GPIO21. By carefully slicing and soldering wires to a flat cable, these GPIO lines can be broken out onto a breadboard.

There’s a video below demonstrating these GPIO lines being used to control a few LEDs. Of course, anything that is possible with a normal Raspi GPIO is possible with the CSI connector GPIO lines.

Comments

  1. Dodo says:

    This is a really trivial hack. But it’s useful though.

    • kaidenshi says:

      Indeed, I’d put it right there with the folks removing the ethernet and USB jacks from a model B to get a model A form factor with 512MB RAM. The majority of Pi users won’t ever do this, but it’s great for the few who might need it.

      • bleck says:

        That was done generally before the model A was released from memory.

        • kaidenshi says:

          I don’t think you made the mental leap from my first sentence to the second one, unless you meant to say the ribbon cable hack has been done since before the model A was released? My first sentence agreed with Dodo, that this is trivial but useful, like cutting down a model B to save space was. My second sentence was saying that the majority of Pi users won’t ever do the ribbon cable hack. Sorry if I confused you.

  2. Andrew says:

    It’s not really “adding” GPIOs, since they are already there.

    • Mushroomglue says:

      Actually, yes it is; while the outputs were already there, prior to this, the were single-purpose (only meant for the camera) not general-purpose (usable for anything you feel like).

  3. Lwatcdr says:

    I wonder if you could make a 1541 emulator out of this. It does have an UART so it should be possible.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 93,704 other followers