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

Accessing Twitter with Python

As a building block for future projects I wanted to learn how to post to twitter using Python. There’s quite a bit of help and information out there, some of it out of date as it appears the API has changed particularly in the area of authentication. Not sure when this happened, but some tutorials teach the obsolete username/password method whilst others use the current OAuth method. The python.org’s page on the module was, of course, the most up to date. 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

HC-SR04 Ultrasonic Ranger – Part 1

Figure 1 - In Action

First go with a HC-SR04 Ultrasonice Range Finder with an Arduino Nano.  Very simple, worked out of the box.  Connected it up, downloaded the New Ping Library for Arduino, used the example program and off it went.

Below I’ll include the schematic & example program.  Will need to have a go at some practical uses for this next.
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