26. April 2013 · 2 comments · Categories: News

Power by Cloudstack.

It’s been a challenging few days (including a laptop crash, a time-consuming problem on our kitting production line, and various other distractions), but the week is ending well.

A few weeks ago I introduced C3Pi to old friends at Dyalog APL.


APL is a Marmite[1] language, and I’m one of those who love it, so I was delighted to hear that Dyalog have ported their product to the Raspberry Pi.

They were equally delighted to realise that it would be easy for them to drive C3Pi from APL.

Since then we’ve been providing occasional advice as they forged ahead with their plans. They’ve built several clones of C3Pi, and are using the on-board Raspberry Pi as a high-level controller for the on-board Arduino which is doing the motor  control.

Excitement has been mounting, and yesterday I heard that the Dyalog robot was moving under APL control.

Liam Flanagan of Dyalog has written an extension that allows APL on the Pi to control devices like the Arduino using I2C, and they’ve adopted and extended our trackbot software to allow them to control C3Pi’s direction and speed. The project has also been greatly helped by Dyalog’s Jason Rivers whose experience with model aircraft has been well applied to the challenges of robotics.

The two teams will be working together over the next few weeks to extend C3Pi’s capabilities. Next on the list is an IR proximity sensor that will stop the robot from bumping into things. After that we’ll be adding sonar, and soon C3Pi will get an on-board camera. This will initially be a webcam but we expect to replace that with the super new Pi-cam when that’s generally available.

We’ll also be merging the trackbot and quick2link codebases. The quick2link project is building a simple interpreter the runs on an Arduino or similar micro-controller and allows you to issue commands from other machines using serial communications, I2C or SPI. It’s perfect for the robot application but has other uses as well.

[1] For our non-UK readers: Marmite is a strongly-flavoured spread known to most Brits, who either love it or hate it.



14. April 2013 · 1 comment · Categories: News

We’ve wanted to extend and tidy up this website for a while, and that is going to be one of our top priorities for the next few days.

More and more people are using our boards and our software libraries, and we want to make it as easy as possible for new users to get started.

Yesterday we updated the code for an old post about our analogue board to make sure it worked with the current version of the library. Next we’re adding a short article about getting started with the analogue board.

Throughout the next few days we will be adding, updating and improving  content. We’d love feedback, and we we welcome suggestions. You can leave comments here but you’ll get a faster response if you post your suggestions and comments on our user forum.

We’ll tweet about the changes as we make them, so don’t forget to follow @quick2wire on twitter if you want to stay up to date!

The Raspberry Pi and the Arduino are both amazing, and each has its particular strengths. There are lots of projects that use one or the other, but there’s growing interest in solutions that combine the strengths of the two platforms.

We use both on C3Pi (our experimental robot). At present we use I2C to link the two, and today we found a way to simplify the way they are connected. Since there seems to be a lot of interest in this topic, I thought we’d share our approach and explain why the solution is a little simpler that we thought!


The I2C software is easy

We’ve been using our Python library on C3Pi to drive the I2C bus that we currently use to connect the Pi to the Arduino. We’ve also adapted the Arduino I2C slave code which is one of the Arduino  examples.

Both programs are very simple. You can find the current versions on github. (Warning: expect the code to change rapidly as we are experimenting with new ideas!)

Linking the Pi and Arduino hardware is easier than we thought

Until today, we were using a sparkfun level shifter to connect the 3v3 I2C bus used by the Pi to the 5v I2C bus on the Arduino.

It turns out that we don’t need to, because the pull-up resistors on the Pi keep the SDA and SCL lines close enough to 3v3 to be safe, even if they are directly connected.

Until today I thought that wasn’t the case. I dimly remembered that the Arduino has pull-up resistors that are enabled by default when you use the Wire library. However, it turns out that these are weak (high-resistance) pull-ups; the Pi has strong pull-ups which dominate those on the Arduino, making direct connection safe.

This only applies to I2C. If you want to connect the serial port on the Pi to the serial port on the Arduino, you will need some protective circuitry between them. That’s why we have a level shifter on our interface board.

But for I2C, just connect the Pi and Arduino as shown below and everything will be fine!

.————-.           .————.
|  Pi         |           | Arduino    |
|          SDA|———–|SDA         |
|          SCL|———–|SCL         |
|          Gnd|———–|Gnd         |
|             |           |            |
.————-.           .————.

Do you pine for the plug-in peripherals on other platforms like the Grove System from seeed studio or the Gadgeteer?

Are you finding it hard to choose between the great interface boards from companies like Ciseco and Quick2Wire?

Grove real time clock

Grove RTC

Sytech 3 Axis Accelerometer

Sytech 3 Axis Accelerometer

Help is at hand!

We’re about to start prototyping the babelboard – an inexpensive board that lets you connect I2C-based boards from all these families to the Raspberry Pi.

This will allow you to use dozens of I2C-based devices with the Pi without having to design or solder them. Just plug them in and write some code!

Over the next few days we will open up the project on GitHub and start posting details here. The board is fairly simple so we hope to have it available in kit form within weeks.

Find out more

If you want to know more, or have ideas, join our support forum, head over to the babelboard topic and get in touch.

QCon London is over for this year. What an awesome event it was!

Many friends were presenting and participating.

John Davies, co-founder and CTO of Incept5 had put together a fascinating track on Finance, Technology and Implementation. Technologists from the Finance sector are not usually allowed to talk about their work but somehow John had lined up an array of speakers from several major financial institutions. Sadly the track clashed with ours (see below) but I’ve heard good things about the talks.

Steve Freeman and I were asked to put together a half-day Maker track. It was a great success.

We talked about our Making efforts here at Quick2Wire, and Rain Ashford told us about her work with wearable technology.

Wearable tech has some very significant applications. She told us abut research that’s helping people on the Autistic spectrum to better understand the mood of others. She also talked about her work in the area of the Quantified Self (QS) movement.

QS also came up in Ward Cunningham‘s outstanding keynote.

Steve Freeman has been telling me for days how excited he was about Ward Cunningham’s new Federated Wiki. Yesterday I found out why.

Most of you will know what an amazing man Ward is. He invented the Wiki, and is responsible for many other widely-used software tools. The hallmark of his design is beautiful, useful simplicity.

I want to do justice to the Federated wiki and Txtzyme, and this post is already a long one. All I’ll say for now is that on Friday evening, dropping with tiredness, I somehow found the energy to fork both of Ward’s projects and start playing. Within minutes I was running a hacked Txtzyme implementation on an Arduino, and using it to control an LED from my laptop.

This stuff is mind-blowing – simple, powerful and free.

Ward has kindly agreed to do an email interview for this website, so expect more detail soon.

QCon was well organised, very well attended, and packed with interesting talks. If you’re a software professional, or interested in what top professionals do, then QCon is a must. And if you can’t wait till next year, you can find this year’s talks (and other excellent material) available on InfoQ.

Interactive Python

One of the great features of Python is the interactive interpreter. If you run the python3 command with no arguments it starts in an interactive mode in which you can enter Python code. The interpreter executes the code immediately and displays any calculated result.

Computer programmers call an interactive interpreter a “REPL”, which stands for Read/Eval/Print Loop. The interpreter reads some code from user input, evaluates the code, prints the result and loops round to repeat the process.

When programming in Python I find it useful to keep three windows open at all times: my text editor; a shell command prompt for running my program, tests or shell commands; and an interpreter prompt so that I can experiment with unfamiliar APIs, double-check my understanding of language features, run little manual or automated tests and use Python’s built-in help browser.


The help browser is another great Python feature. The built-in help function can be used to read documentation about the modules, classes & functions of the Python APIs. We’ve written documentation for the Quick2Wire APIs that you can read with the help command. For example, the following command will show you the help for our GPIO API.



The standard python3 interpreter has a pretty rudimentary REPL. There’s a much better one in the Raspbian software repository called ipython3, which provides a lot of help for entering and working with Python code. It auto-indents multi-line control flow statements, function and class definitions. It can auto-complete names for you: pressing Tab will complete a partially entered name from those that are in scope. It has a searchable command history that persists between sessions, so you can easily repeat or edit previous input. It can reload modules that you have imported, so if you change a code in your editor you can reload it into thee REPL. And much much more.

You can install ipython3 with the command:

sudo apt-get install ipython3
01. March 2013 · Write a comment · Categories: News

We’re running a new competition in conjunction with The MagPi magazine to celebrate the first Birthday of the Raspberry Pi.

The MagPi

If you haven’t come across it, the MagPi is a fantastic on-line magazine about the Pi, its uses and its users.

You can now purchase a print version of the MagPi and it’s still free on-line.
<hint>It’s run by volunteers who are always on the look out for new articles or more help.</hint>
Competition Rules
We’re giving away three full sets of Quick2Wire kits (Interface kit, I2C Port Expander kit, I2C Analogue kit), on the basis of projects that you submit.
Submit your entry by posting details of your project in the Quick2Wire support forum at https://groups.google.com/forum/?fromgroups#!forum/quick2wire-users.
Your post should make it clear that this is a competition entry.
Your project must run on the Raspberry Pi, and must be an original work by you.
The hardware and software for each project must be Open Source. Hardware must be licensed under the CC 3.0 share-alike license; your software and any libraries that you use must be licensed under the MIT license or LGPL.
The project does not have to be complete, but a significant part of it must be demonstrably working.
The winning projects will be chosen by a panel of judges (to be announced) on the basis of
  • educational value
  • utility
  • time and money required (less is better :) and
  • technical merit

We’ll also take your age into account if you are under 18.

The decision of the judges will be final.
Entries must be received by 8 AM UK time on Monday 15th April, and the winner will be announced on 1st May.

How to enter

You must post brief details of the project in the relevant section of our Google group, and must publish enough detail for someone to replicate the project.
Publication can be on the mailing list, or on a blog or external website. In the latter cases you must publish links to the description in a post to the group.
You must be willing for details of your project and your identity to be published in the MagPi and on this website.
Have fun, submit your entry, and good luck!

If you live within reach of Milton Keynes, you won’t want to miss nest weeks’ Raspberry Jam.

Peter Onion and friends run these each month at the The National Museum of Computing, Bletchley Park. Up to 40 Raspberry Pi enthusiasts turn up for an informal but lively session. There are lots of experienced Pi users as well as a healthy sprinkling of beginners, and you can always wander round the museum once the meeting is over.

The meetings usually fill up quickly so book your tickets now!

C3Pi is our experimental tracked robot with an onboard Raspberry Pi and an Arduino.

The Pi drives the Arduino over I2C, and the Arduino drives a motor controller board using PWM.

The Python program that drives the Pi uses our I2C library; it’s about four lines of code.

At the moment all we do is respond to a character sent by the Pi by doing a little dance like a bee that has just found some honey. The next step is to define a simple protocol that will allow the Pi to set C3Pi’s speed and direction. After that we will add a Sharp distance sensor which will tell the Pi to stop the motor if C3Pi approaches an obstacle.

We’re using a SparkFun logic level shifter to interface the 3.3v I2C levels on the Pi to the 5v on the Arduino. Here’s a picture of the current configuration:

C3Pi with Raspberry Pi, Arduino and I2C

We’re still experimenting with our API design, trying to find an abstraction for GPIO that works for both on-board GPIO pins and pins of GPIO expansion devices like our MCP23017 board. We realise that this creates a bit of churn in the API and that changes have been landing in the GitHub repository without warning.

To improve the situation we’re changing our development process so that big API changes are done in public and accepted into the API project after a review period. We’re using GitHub’s pull requests to manage the process.

In future, when writing a new API feature or changing an existing API we will make a personal fork of the quick2wire-python-api repository. When the change is ready to be integrated into the API we will issue a pull request, and the change will appear in the issue tracker. Other team members will then review the code, suggest improvements or raise objections. And it’s not limited to the team members either. If you use the API and are interested in upcoming changes you can see what we’re changing and make comments too. Or, fork the library yourself and send us pull requests.

Here’s an example: https://github.com/quick2wire/quick2wire-python-api/pull/22

We hope this will help avoid unpleasant surprises and make the evolution of the software more transparent to folks using it.