Raspberry Pi reading BMP085 Temperature & Pressure

Figure 1 – BMP085

Another fun little i2c device acquired cheaply via eBay.  It reads barometric pressure and temperature.  There’s some relatively simple maths to convert the outputs to something readable.

Once again, ADAFruit provide a fantastic guide and library for using the device in their Using the BMP085 with Raspberry Pi.  As in previous posts, I could have just used the ADAFruit library out of the box.  Whilst I do not feel the need to re-invent the wheel and re-code from scratch, I do like to have an understanding how it works. Continue reading

Raspberry Pi, Python & i2c Analogue to Digital Converter (ADC)

A quick little post for my future reference really.  Wanted to get an i2C Analogue to Digital Converter (ADC) working on a Raspberry Pi.  No real application as yet, but sure to be one in the future.

Most of the information to make this work was taken from posts by Grumpy Mike on the Raspberry Pi forums.  Got a couple of PCF8591s nice & cheep from eBay. Continue reading

Pelican Crossing – Part 2: I2C MCP23017 & 555

Figure 1 - Working Breadboard Prototype

In Pelican Crossing – Part 1 software threads were used to provide timing to both the lights and the buzzer at the same time.  In Part 2, the I2C MCP23017 is used again but instead of using software to time the operations, the intermittent buzzer is implemented in hardware using a 555 timer.  This simplifies the code but makes the hardware more complex.  I learned something from both versions.

Continue reading

Clocks – Part 2: Daemon Process

The python code in Clocks – Part 1: HD44780 16X2 LCD suffers from (at least) one major drawback; if you close the terminal session, the clock dies.   This post improves on the by running the clock as a daemon process.  That is, one that doesn’t die when the terminal session is closed.

Or by Wikipedia’s definition:

In multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user.

Continue reading

Python Development using Eclipse

My Raspberry Pi’s are connected in a headless fashion, over the network with no dedicated screen & keyboard.

I find it more convenient to do my Python programming on my Windows 7 PC using Eclipse with the code base on Network Attached Storage.  The same code base is mounted on the Raspberry Pi.  It is then possible to tinker with scripts that don’t require the RPi’s hardware within Eclipse or log into the Pi to run the scripts that use the GPIO or to deploy scripts when they are finished.

For me, it’s the best of both worlds. Eclipse is a fantastic feature rich open source Integrated Development Environment.

There are plenty of great installation guides for Python and Eclipse so I won’t re-invent the wheel here just list the compontents and guides to installing them.

Python Programming Language – Official Website

Eclipse Foundation

PyDev – Python Plugin for Eclipse

Traffic Lights: Part 1 – Just Resistors

This post details my first and simplest attempt at driving some LEDs with a Pi.  3 LEDs, 3 resistors and some wires.

The circuit diagram, breadboard version and veroboard version are shown.  Python source code for the traffic light sequence is shown.

Next will be versions of traffic lights using transistors and then an I2C bus expander.
Continue reading

Raspberry Pi GPIO Pinout

There’s a couple of good sources of explanations for the pin-outs of the Raspberry Pi’s GPIO connector.

My favorite being the one on LWK’s Arduino Projects blog.  Don’t let the title fool you, the author has seen the light and is tinkering with Pi’s too.

Recently the Raspberry Pi foundation announced Rev 2.0 of the board.  I only have Rev 1.0 boards, so don’t need to worry about the pin-out changes just yet.  Either way, it is simple enough to make your circuits compatible with both.
Continue reading