Review: Pimoroni/Cyntech Pibrella

There is no shortage of clip-on boards designed for the Raspberry Pi, almost all designed to make the tiny computer’s GPIO pins more accessible in order to ease the connection of devices to it, particularly ones that operate at voltages that are not Pi friendly.

For instance, I have a PiFace Digital which provides screw-lock wire attachments, switches, LED indicators and relays. It’s downside, perhaps, is that it doesn’t provide the Pi’s GPIO with better connectivity so much as use the GPIO to deliver its own different set of inputs and outputs. So projects for raw Pis need a little extra thought before they’re implemented on a PiFace.

Pibrella

Electronics kit: Pimoroni/Cyntech Pibtrella

Yet this ‘embrace and extend’ approach is the one Pimoroni and Cyntech have taken with the Pibrella, one of the latest Raspberry Pi add-on boards. If the PiFace Digital is the BBC Micro Model B of the Pi add-on world – big, expensive, feature-packed but possible function overkill for most users – then the Pibrella is the Sinclair ZX81: cute, cheap, cheerful but rather more rudimentary.

What we have is a small, purple board with a buzzer, three LEDs bulbs – a traffic light set comprising one each of red, green and yellow – a button and eight IO ports with female connectors. Four of the ports are inputs, the rest outputs; all are connected to on-board surface-mound LEDs.

Compare that to the eight LEDs, two relays, four switches, eight digital inputs, eight open-collector outputs and seven jumper blocks of the PiFace Digital. The PiFace looks like a serious bit of electronics; the Pibrella looks like a toy.

Pibrella

Pibrella provides four inputs, four outputs, three LED bulbs, a switch and a ‘buzzer’

But it’s not entirely unsophisticated. For example, Pibrella has an I²C bus header, though it’s currently pin-less and not readily usable. The board also has a micro USB port for driving connected devices that need more power than the Pi can provide but which, handily, will also drive the Pi the board is connected to, through the GPIO.

All of the Pibrella’s useable components are made accessible through a new Python library – just as PiFace’s are, incidentally – which neatly abstracts away all the Raspberry Pi GPIO stuff which you might otherwise need. This makes it very easy to target specific parts of the Pibrella, clearly and unambiguously.

The IO pins are all clearly labelled A through H, and this is how you address them in code, with no need to worry about pin numbering – pin location or chip GPIO assignments, all of which are different on the Pi itself – or which version of the Pi you have.

Pibrella

The Pibrella’s micro-USB port can power the Pi – or drive high-power connected devices

The buzzer comes with a couple of pre-defined tones, set in the library, though they didn’t sound very different from each other – or appealing – to me. It reminds me of the crude noise make that came with the electronics kit I got for Christmas 1981. A true tone generator it ain’t.

Just as the Pibrella library incorporates pre-defined noises, it also includes some set light patterns, including fades and blinks, which can be applied to each of the LEDs, so there’s some ‘my first project’ fun to be had here.

The four inputs and four outputs all feature both positive and negative terminals, effectively giving each one its own GND terminal. Like PiFace’s outputs, Pibrella’s outputs have activity LEDs to tell you when something is happening, but so do the inputs.

Pibrella

Attention to detail: the Pibrella has a pad to sit the add-on on the Pi’s capacitor

Watching out for, and responding to, occurrences has a deeper meaning with the Pibrella. What particularly appealed to me, as a programmer, is that the Pibrella introduces users to event-based programming techniques: the notion that code simply responds to external actions. This is, of course, how apps for modern operating systems are programmed: they do little or nothing until the user interacts with the UI, or data comes in from the network, say. But it’s not a common approach with embedded devices, such as Arduino.

The Pibrella introduces this, in a small, ‘ease you out of the shallows’ way, through a number of its library functions. These take the name of a function which will be called when a certain event takes place – if it ever does.

So rather than poll a pin to see if the Pibrella’s red button has been pressed, there’s a function, pibrella.button.pressed(), that waits until the button is pressed and, if it is, calls another function – a ‘callback’, in the jargon – you’ve defined and passed to pressed().

Pibrella

Serious and not-so-serious: PiFace Digital (left) and Pibrella

Likewise, the changed() function, available to any of the board’s eight IO pins, once registered with a callback function, will wait for the nominated pin to change its state and then call the named function.

To be fair, a lot of the event monitoring functionality comes from the regulation RPi.GPIO module for which the Pibrella library is a much more newbie-friendly wrapper. But top marks to Pimoroni for putting event-driven programming on the agenda in such a non-scary way. Understanding how this technique works is a big step toward being able to program desktop and mobile operating systems effectively.

Verdict

The £10 Pibrella is a nice little Pi add-on for young kids and it’s a fine basis for programming lessons where a teacher wants children to write code that makes things happen in the real world rather than on screen.

Older novices may find it appealing too, for the same reasons, but I suspect that once they’ve worked their way through the sample programs – which won’t take long – they’ll put the Pibrella aside and start working on more complicated projects with resistors, wires, motors and stuff.

Pibrella

That’s not to say such projects can’t be connected to a Pibrella, but that new Pi users growing in confidence are going to want to interact with their machines more directly and, not to put too fine a point on it, want to work with kit that looks a little less like the result of a kid’s electronics kit toy.

The Pibrella isn’t a toy – at least not entirely – but in hardware terms it’s a step to more interesting things not a destination in its own right. Just make sure you take advantage of its entry into the world of event-driven programming on the way.

Pibrella is available now from Pimoroni and Cyntech

Review: Pi-Supply Pi-Crust

I came across Pi-Supply’s Pi-Crust add-on board quite by chance, but it immediately caught my eye as quite possibly the most useful add-on for the Raspberry Pi there is. Having ordered one, received it and soldered all the parts together, I’m no longer sure that it is.

The notion behind the device is very sound indeed. It’s an internal breakout board that doesn’t merely replicate the Pi’s GPIO ports, it re-organises and labels them logically and clearly. It’s also intended to fit snuggly within the form-factor of the Pi itself. This is, frankly, a brilliant idea.

Pi-Crust

Pi-Crust on Pi: GPIO made really easy

As you can see from the pictures, the assembled Pi-Crust is a small L-shaped board which clips onto the GPIO pins and routes them to a set of well-spaced connectors clearly marked with their function: SPI, UART, I²C, GPIO and so on. This makes accessing the bus you want a doddle and saves you from either looking at a pin-out reference sheet every time you want to connect the Pi to something, or learning the whole GPIO array by heart.

No longer. Now I can simply drop my wires into clearly marked GND, 3V3, SDA and SCL and start sending bits and bytes back and forth between the Pi, a four-digit, seven-segment LED and a light-level sensor. Or SPI’s MISO, MOSI, SCLK et al. Or UART’s RX and TX.

Pi-Crust

All the Pi’s GPIO ports, clearly marked, plus extra power and ground connections

Another particular advantage the Pi-Crust offers is that it uses female connectors rather than male ones, just like the Arduino boards do. This means you can work with simple jumper wires – you don’t need gender-bending intermediary cables – and you’re not going to make contact with the adjacent pin by mistake.

The Pi-Crust doesn’t use the usual 25-pin female IDC connector on its base to grasp the Pi’s pins. Instead it uses an ingenious connector that allows it to sit just a few millimetres above the Pi’s own board. There’s a hole cut in the Crust to accommodate the Pi’s camera connector. The Crust’s own connector is ingenious because without it the female headers on the upper side of the board would reach well above the height of Pi’s own components, ensuring the device wouldn’t fit inside a Pi case.

Pi-Crust

The Pi-Crust in pieces. Source: ModMyPi

And that’s one of the Pi-Crust’s raisons d’etre: it’s supposed to lie sufficiently low to fit inside a case. Ergo, you can leave it in place. This appeals to me because, favouring neatness, I don’t like leaving my Pi lying around with an extender cable hanging off it. With the Pi-Crust, I reasoned, I could lose the cable, and just pop the top off my case and start plugging wires into those female headers whenever I needed to.

What sold me was ModMyPi’s claim: “If you have a case for your Raspberry Pi, this board should fit inside it.” This echoes a claim on the Github page of Joe Walnes, the guy who invented Pi-Crust. I’m currently using one of ModMyPi’s cases, selected because it has a readily removable lid, perfect for easy occasional GPIO access. Surely the Pi-Crust will fit into one of the seller’s own cases?

Like heck it will. An not many others either.

Pi-Crust

Overhang: the Pi-Crust (blue) extends past the edge of the Pi’s PCB…
even after it has been filed down as much as it can be

Here’s the problem: the Pi-Crust extends a millimetre or two past the edge of the Pi’s own circuit board. Because the Pi fits very snuggly in the ModMyPi case, for instance, this overlap leaves no room for the case’s upper half to close. The internal spars in Pimoroni’s Pibow case likewise get in the way of the Pi-Crust.

About the only good case I know of into which the Pi-Crust will fit without too much bother is Cyntech’s. But putting it in one of these defeats the object of having the Pi-Crust in the first place: the Cyntech case is designed to be held together with four metal screws. Good though it is, it’s not a case for Pi users who want frequent, ready access to the board.

Pi-Crust

The ‘ledge’ stops many a Pi case from closing, but it is lower than other Pi components

You can sand down the edge of the Pi-Crust, but this won’t get you very far. You can’t wear it away sufficiently for it to allow the ModMyPi case, for one, to close. If you did, you’d inevitably remove half of the pins by which the board’s novel GPIO connector is soldered to the board – not to mention the lines running from those pins to the female headers.

Verdict

The Pi-Crust is a good idea – a really very good idea indeed. It makes the Pi’s GPIO pins as accessible as they ought to be, by separating out pins by function and by labelling them clearly. At around £13 it’s a little expensive for what is just a circuit board, a PI attachment and 26-odd female connectors, all of which you have to solder together yourself, but it’s worth it for how well it presents the Pi’s GPIO.

The flaw for me is that it doesn’t fit into any of my Pi cases, so it’s not something I can leave sitting on the Pi, which is why I got it in the first place. I’ll certainly make use of it, but because it can’t be a permanent Pi attachment, its utility is unfortunately limited.

The Pi-Crust costs £13 and is available from ModMyPi. There’s more info at the Picru.st site.