Original URL: https://www.theregister.com/2014/05/08/review_cyntech_pimoroni_pibrella_r_pi_add_on_board/

Hungry for humbler Pi? Check out kid-friendly LED-laden Pibrella

Cyntech/Pimoroni GPIO add-on board sets Raspberry Pi alight

By Tony Smith

Posted in Devops, 8th May 2014 08:03 GMT

Review 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.

Pimoroni/Cyntech Pibrella

Jump to the beep: the Pibrella from Cyntech and Pimoroni

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.

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.

Four inputs, four outputs, three LED bulbs, a switch and a beep

Four inputs, four outputs, three LED bulbs, a switch and a beep

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.

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

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

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

The main event

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.

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

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().

Serious and not-so-serious: PiFace Digital (left) and 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.

The Pibrella: not a toy but worth toying with

The Pibrella: not a toy but worth toying with

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.

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.

This review first appeared at the Tech Tonic blog. The author asserts his rights.