Monday, 23 June 2014

Solar Pump Regulator

After a period of operational evaluation and design refinement a smaller and more efficient Solar Pump Regulator has been developed.  This device acts rather like an intelligent solid state relay to protect the well being of the pump, pressure switch and battery whilst making good use of harvested solar power.  This device does not have much to do with Raspberry Pi except that a Raspberry Pi was used for development of the operating program (Arduino sketch) used by the ATtiny 45/85 microcontroller (MCU).  A Raspberry Pi continues to be my preferred device for programming MCUs prior to assembly and deployment of Solar Pump Regulator units.

Comprehensive design documentation has been released into the public domain (click here) so that anybody can produce Solar Pump Regulator devices in accordance with the present design or derive modified versions as they see fit.

Although the design is optimised for the intended application as a Solar Pump Regulator, the device is essentially a power MOSFET switch controlled by a programmable MCU which can measure the voltage of its battery supply.  Consequently there are other possible applications that could be addressed by substitution of an appropriate Arduino sketch designed to match the intended application.

A photo album has been created (click here) and more photos will be added in the coming weeks.

Saturday, 24 August 2013

The need for speed - I2C bus

When designing the high-integrity I2C bus for InterPi (and later, MegaBoard Pi), I simply followed the guidance of the NXP (previously Philips) application note AN10441 which says that the bidirectional level shifter can be used for both Standard-mode (up to100 kbit/s) or in Fast-mode (up to 400 kbit/s) I2C-bus systems.  Today, I have conducted some tests to explore the limits of the system.

Test Conditions:
  • Raspberry Pi Model B Rev 2 with Raspbian (current)
  • InterPi (one of the PiCocktails conjoined series)
  • Quick2Wire I2C Port Extender (operating at 5V)
  • 5V I2C bus pullups provided by Tiny RTC module
  • Quick2Wire short ribbon cable
  • Room temperature 
Caution:  Do NOT connect a Tiny RTC or Quick2Wire I2C Port Extender (operating at 5V) to a Quick2Wire Interface board.
Test Method:
Using the new diagnostic and test program, which can be downloaded from here, the program was exercised a number of times while increasing the bus speed until the onset of I/O errors.  The bus speed was altered by use of the following commands (with variations) that remove the I2C module and then add it with the desired speed characteristic:
    sudo modprobe -r i2c_bcm2708
    sudo modprobe i2c_bcm2708 baudrate=1200000

Test Result:
Operation up to 1.2 Mbits/s was quite solid and operation at higher speeds failed consistently.

It would seem that the NXP engineers' claim of 400 kbits/s is a conservative one , as one might expect, and that InterPi's high integrity I2C bus architecture can be expected to deliver high performance so long as bus compatibility and capacitance issues are suitably managed.

I did consider incorporating some redundancy into the program to perform read corroboration and read after write verification but decided not to do so because there is limited potential to overcome the fundamental weaknesses in the MCP23017 control protocol.  Because the MCP23017 does nothing to verify its received commands, it is vulnerable to single bit errors that can cause it to:
  • read from an erroneous register address (read corroboration can help),
  • write to an erroneous register address (very nasty),
  • perform a read instead of a requested write (write verification can help), or
  • perform a write instead of a requested read (nasty)
Multiple bit errors can cause even greater mayhem.

These weaknesses argue for a conservative approach when deciding on the I2C bus clock speed. 

Wednesday, 21 August 2013

Bit-Banging The SPI Bus and PiFace

Among the Diagnostic & Test programs released last week there was one called that was intended to facilitate the examination and control of an MCP23S17 device's GPIO ports to a greater extent than is possible with the PiFace "emulator".  Today, has been upgraded to incorporate changes that permit examination and control of all operating modes of the MCP23S17 device.  If your interest in the MCP23S17 (or PiFace) extends beyond the simplistic, you will possibly find this program interesting or useful.  It can be downloaded from here.
I hope this program will help to extend your appreciation and understanding of the MCP23S17, a remarkably flexible and capable device for expanding the Raspberry Pi's potential.

InterSPi (above) is a project of the "conjoined series", intended for conjoined use with InterPi and/or MegaWire and/or InterHub but it is also suitable for separate use.  Details can be found here.

Tuesday, 13 August 2013

Diagnostic & Test Programs

New and revised programs have been made available for downloading as follows:
  • is a new program intended primarily for use by constructors of the InterSPi project of the conjoined series.  It may also be of interest to PiFace users who desire more visibility and control of the MCP23S17 functionality (new version uploaded 22Aug13). 
  • has an improved user interface and a greater range of control, compared with its predecessor.  The program adopts an unobtrusive mode of operation that does not affect any port of the ATmega MPU unless/until the user chooses to do so.
  •  has an improved user interface and a greater range of control, compared with its predecessor.  Although intended primarily for constructors of PowerIO, TinyIO and InterPi projects, the program may be of interest to anybody who is interested in exploring the RasPi GPIOs.  The program adopts an unobtrusive mode of operation that does not affect any GPIO port unless/until the user chooses to do so.

Tuesday, 23 July 2013

MegaBoard Pi Released

The 2nd release candidate PCB successfully completed final testing yesterday and has now been released.  Design documentation files including PCB production files (ExpressPCB and Gerber files) have been uploaded to the project folder for public access at:
More photos can be viewed by clicking here

Pictured here without a clock module and with no Arduino shield fitted, MegaBoard Pi is designed to provide substantial innate interfacing capability as well as unique expansion potential by use of Arduino shields and/or the high-integrity I2C bus.

Monday, 17 June 2013

More options for PCB supply

If you prefer to have your PCBs manufactured by somebody other than ExpressPCB, you might welcome the Gerber files that have recently been uploaded to the various project folders on Google Drive.

Wednesday, 26 December 2012

Cocktails of Constructional Projects For Raspberry Pi

This blog has been created to provide supporting documentation for people involved in or considering the construction of one or more projects arising from the "cocktail" series of articles published in The MagPi (Issues 10 ~ 15?) during 2013.  For each article published, there will be a blog page to contain the supporting information, principally links to photos, design documentation and program files.

You can also go directly to a spreadsheet with links to all the project design details and cocktail files by clicking here.

General instructions can be found at:


The original cocktail files concept involved the grouping together of a few project PCBs that were intended to be separated prior to assembly and use.  The concept has now been expanded to include groupings of project PCBs that are designed for conjoined use but can be separated if the constructor prefers.  Pictured (right) are release versions of InterPi (left with clock module fitted) and InterSPi (right) set up for 5V operation via the looped ICSP cable.  Connectors for InterPi's two  high-integrity I2C bus segments are at lower left.