Raspberry Pi Python LCD Class 0.0.1 Release

The earlier post “Clocks – Part 1: HD44780 16X2 LCD” showed connecting a HD44780 16×02 LCD module to the Raspberry Pi and displaying the date and time.

I’ve taken the code to drive the display and made a class so that it can be used in other projects.

In time, I may extend this for other display sizes (20×4), types (graphical) and interfaces (I2C, etc).

At the moment, the class handles the 4 bit HD44780 16×2 Character LCD.  It’s very simple and provides member functions to initialise, clear and write text to each of the 2 lines.

It can be downloaded here.

Unix Daemon Python Library 0.0.1 Released

Another building block I’ve found useful having wanted to have processes run after the terminal session has ceased is the Unix style Daemon process.  This library provides a Python wrapper class.

The code was shamelessly borrowed from Sander Marechal’s “A simple unix/linux daemon in Python”.  Unfortunately his page no longer exists. Continue reading

BMP085 I2C Temperature & Pressure Python Library 0.0.1 Released

This purpose of this library is to read temperature and barometric pressure from the BMP085 I2C sensor.

The datasheet can be found here.

I cannot take credit for the code.  I’ve just wrapped it in a class for my own use and shared it here.  It was shamelessly borrowed from these 2 sources:

The class can be downloaded from the downloads page.

Arduino I2C Bus Scanner

I recently bought a SainSmart IIC/I2C/TWI Serial 2004 20×4 Yellow LCD Modules.  Lovely device, however, the documentation was less than lovely.  Many hours of checking & re-checking wiring and code, I still couldn’t get this to work.

If you read the above link, it says that the I2C address is 0x27.  Some forum browsing suggested that this might not be correct and that the Sainsmart documentation had one or two errors. Continue reading

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