The Raspberry Pi

Great, we now have a hardware ALU with its most important elements implemented on a metric tonne of breadboard. However, this awesome little machine is missing a crucial component – the interface to Twitter.

Raspberry Pi - a mightily small embedded Linux PC. Credit: http://www.sotechdesign.com.au/

Raspberry Pi – a mightily small embedded Linux PC. Credit: http://www.sotechdesign.com.au/

Enter the Raspberry Pi (RPi) – everybody’s favourite credit-card sized PC. As good as it is for playing back high-definition video and surfing the web with a connected monitor, its real power is harnessed when it’s used for a different, deeper purpose.

The role of the Raspberry Pi

The role of the Raspberry Pi

The RPi sits between our ALU and Twitter’s Application Programming Interface (API). It has two main roles – 1. Managing the sending and receiving of Tweets, 2. Decoding instructions and interfacing with the hardware ALU. This is where the RPi comes into its own – it can run a fully featured Linux operating system and so can perform high level computing operations like fetching and posting a Tweet, but it can also interact with very low-level hardware using the few on-board GPIO pins and, more importantly, the super-powerful I2C and SPI buses.

MCP23017 I2C Port Expander Pinout

MCP23017 I2C Port Expander

Embedded applications are where the RPi really rocks. Out of the box it’s easy to power (via USB), has internet connectivity and has a great way of interfacing with the real world – I2C. I2C is a communications bus that allows communication of data and commands between Integrated Circuits, hence Inter IC, IIC and I2C. Find out more about I2C here.

The I2C bus was designed by Philips in the early ’80s to allow easy communication between components which reside on the same circuit board. – i2c-bus.org

We’re using it with several Microchip MCP23017 Port Expanders, which effectively gives the RPi 16 remote, bidirectional I/O ports. This is great as it allows us to put data into the registers and read from the output register using a single RPi.

LED light chaser with MCP23017 on Raspberry Pi. Credit: http://www.skpang.co.uk/

LED light chaser with MCP23017 on Raspberry Pi. Credit: http://www.skpang.co.uk/

An awesome example of how useful the Microchip Port Expanders are can be found at SK Pang Electronics blog where a Port Expander has been connected to the RPi using just four wires (PWR, GND, SDA, SCL) and gives the programmer 16 individually addressable IO pins, as shown by the 16 LEDs (check out the video). However, what’s even more impressive is that the Port Expanders themselves can be daisy chained to make available even more IO. More Port Expanders are easily introduced to the system by connecting them with the same four wires as the first one.

Advertisements

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