Brainibrick: a programmable controller with an 8-bit computer running at 20MHz, 8K instructions of FLASH Program Memory, 368 bytes of Data Memory.

Programming Language

The Brainibrick runs BrainProg, a graphical programming language. The language is based on Rodney Brooks's subsumption architecture.

It is described in brainprog.htm.

You can download a copy of the BrainProg programming system.

The BrainProg compiler produces native code which runs on a PIC processor (typically the PIC16F877).


In one incarnation, the Brainibrick is integrated into a mobile robot. The two robot motor-drivers are built into the Brainibrick using two of the "ports". The chassis of the robot is the pcb of the Brainibrick.

The Brainibrick has 16 I/O "Ports" each of which has a 4-pin socket: two Input/Output bits, power and ground. Some of the ports can be used as Analogue-to-Digital Convertors, others can transmit and receive serial data. Serial communications can be used to talk to other processors allowing users to build networks of controllers.

Each Port is connected to a sensor or effector. Sensors can measure "touch" (on/off), light, temperature, sound, acceleration, metal detector, pressure, weight, vibration , position, etc. An effector can control a motor (all the usual robot arms, legs, wheels and tracks), sounder, mains lights, etc.

The Brainibrick can be used as a re-programmable mobile robot controller or industrial controller.

Serial communications can be used to talk to other processors allowing users to build networks of controllers.

There is also a jack socket to recharge the batteries.

Prototypes of (almost) everything described in this document have been built. The compiler is complete but has not been thoroughly tested and requires documentation.


Each Port (two bits) can be connected to "periperal": a sensor or effector. The connector is a 4-pin 0.1" Molex:

Each peripheral is self-contained. For instance, the motor-driver transistors are on a small pcb fastened to the back of the motor.

A peripheral can be as simple as a pair of on/off switches (e.g. bump sensors or antennae) or a pair of LEDs. It can contain extra hardware to drive an effector, e.g. an H-bridge for a motor.

More complex peripherals can include their own processing chips. For instance, an ultrasonic sonar peripheral would contain all the intelligence needed to emit and detect ultrasonic pulses and convert them into a distance measurement. A protocol has been developed to simplify communications between the central BrainiBrick and an intelligent peripheral. It is a synchronous serial protocol which allows a rendezvous between the two processors. Both processors can spend most of their time doing other things but occasionally they will rendezvous and exchange a few bytes. (A simple serial protocol such as RS232 or I2C is unsuitable as such a receiver has to be capable of receiving at any time; it must contain a hardware UART or similar.)

The protocol will be published and sample peripheral PIC code will be made freely available. Developers do not have to use the BrainiBrick peripheral protocol but writing an I/O behaviour that uses the protocol is much simpler: the code is already in the BrainiBrick.



The user plugs peripherals into the Brainibrick then sets up a graphical table to specify the connections.


A keypad is an intelligent peripheral which allows the user to enter values into a program running on the processor.


A digital readout is an intelligent peripheral which allows the user to display values available to the processor - for instance a light level or a sonar distance.


An intelligent peripheral that measures distances up to 1m.

Motor driver

The motor-driver transistors are on a small pcb fastened to the back of the motor.


Simple touch sensors.

Any switch can be connected to a port.

Passive light sensor

Passive light sensor

Any resistive sensor can be connected to a port.

Active Light Sensor

Active Light Sensor Measures reflectance colour of a surface.


RS232 controls comms to a PC or other hardware.

Shaft encoder


Questions or comments ? E-mail me at

No part of this web page may be reproduced in any form or by any means, including photocopying and recording, for any purpose without the express written permission of Analogue Information Systems Ltd.

This web page is copyright © 2008 Analogue Information Systems Ltd., 1 Warrender Park Crescent, Edinburgh EH9 1DX, Scotland, UK, Tel: +44 (0) 131 228 6008. All Rights Reserved