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

ATtiny85 Christmas Bauble


Figure 1 - Working Bauble

First use for the very tiny and very cool ATtiny85 microprocessor; the Christmas Bauble.

My first go at this shows my limited fabrication skills!  But it functions well & looks great in the dark.  The LEDs flash & chase around in various styles.

The only difficulty was soldering the button cell battery holder to the back of the veroboard.  Only a little melted plastic.  Picture below. Continue reading

Programming an ATtiny85 with an Arduino Nano

ATtiny45-85

First question for anyone reading this … why?  Well, I’ve a few ideas for using this tiny microprocessor.  There’ll be a post along very soon after this one.

Here’s the datasheet for this fantastic device.

Just about all the information needed to do this can be found in High-Low Tech’s Programming an ATtiny w/ Arduino 1.0.1.
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

Spam of the Day: 18 Nov 12

More funny spam:

The building Lord, your noble sentiment so touched. Now such a materialistic society money could have seen the original poster such temperament middleman, no doubt, is my whole life the biggest lucky. Let I deeply feel the greatness of the human nature. A son of the building Lord, is in the dark of the night sky stab crack lightning, and like the sunshine of dark clouds tear, let me drink nectar as a moment, let me understand eternal truth in this world there is real. Only the building Lord that have broad mind and the complete knowledge system can be only one preface of this truth. Saw a son of the building Lord, I sank into the serious thinking. I think, if not the son of the building Lord top up, is a betrayal of the truth, is the great compromise on fallacy. Therefore, I decided to no top!

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