Dexter Industries BrickPi3

This page describes the drivers that are specific to Dexter Industries BrickPi3 These controllers are LEGO MINDSTORMS compatible addon boards for Raspberry Pi. Unlike the previous versions of BrickPi, the BrickPi3 uses the SPI interface on the Raspberry Pi to communicate.

You can confirm that the brickpi3 module has loaded successfully by checking dmesg. You should see something like this:

[    3.053862] brickpi3 spi0.1: Mfg: Dexter Industries
[    3.060030] brickpi3 spi0.1: Board: BrickPi3
[    3.063114] brickpi3 spi0.1: HW: 3.2.1
[    3.076690] brickpi3 spi0.1: FW: 1.2.0
[    3.090078] brickpi3 spi0.1: ID: FAD3CABB504B5354392E314BFF0F2C38

Input Ports

The BrickPi3 has four input ports, labeled S1, S2, S3 and S4. These ports are similar to the input ports on the EV3, but lack the ability to automatically detect sensors.

General Info

Module brickpi3
Driver name brickpi3-in-port
Connection types NXT/Analog, NXT/I2C, EV3/Analog, EV3/UART
Connection prefix S [1]
Number of modes 6

Modes

Name Description
none No sensor
nxt-analog [2] NXT/Analog sensor
nxt-color LEGO NXT Color sensor
nxt-i2c [3] NXT/I2C sensor
ev3-analog [4] EV3/Analog sensor
ev3-uart [5] EV3/UART sensor

Notes

[1]The full port name includes the parent device node. So, the address attribute will return something like spi0.1:S1.
[2]The nxt-analog driver will be loaded when this mode is set. You must manually specify the correct driver for your sensor using set_device if you want to use another driver. Any driver with a connection type of NXT/Analog is allowed.
[3]No sensors are loaded by default. You must manually specify the sensor that is connected and its address by using the set_device attribute. This is equivalent to manually loading I2C devices. The sensor port address will be the BrickPi3 port address with :i2c and the decimal I2C address appended.
[4]Only the LEGO EV3 Touch sensor is supported. The lego-ev3-touch sensor driver will load automatically when this port mode is set.
[5]Only the LEGO EV3 Ultrasonic, Color, Gyro, and Infrared sensors are supported. They cannot be automatically detected, so you must specify the sensor manually using the set_device attribute. No sensor drivers are loaded by default.

I2C Adapters

The brickpi3 modules creates one I2C adapter for each input port. These are available at /dev/i2c-X where X is the number of the input port plus 2. The adapters can only be used when the port is set to nxt-i2c mode. Only SMBUS messages are supported and are limited to 16 bytes.

Output Ports

The BrickPi3 has four output ports, labeled M1, M2, M3 and M4, for driving motors or other devices. The ports are similar to the output ports on the EV3, except that they cannot automatically detect when a motor is connected. By default, the lego-nxt-motor driver is loaded, so you don’t need to manually set the mode or device unless you want to use something else.

General Info

Module brickpi3
Driver name brickpi3-out-port
Connection types tacho-motor, dc-motor, led
Connection prefix M [6]
Number of modes 3

Modes

Name Description
tacho-motor NXT/EV3 Large Motor
dc-motor RCX/Power Functions motor
led RCX/Power Functions LED

Notes

[6]The full port name includes the parent device node. So, the address attribute will return something like spi0.1:M1.

LEDs

The BrickPi3 has one user-controllable LED. It is turned on by default when the brickpi3 module is loaded. It uses the mainline kernel LEDs class subsystem. You can find it in sysfs at /sys/class/leds/brickpi3:amber:ev3dev.

Battery

  • This driver is used to get information about the BrickPi battery.
  • It uses the power_supply subsytem.
  • It registers a sysfs device node at /sys/class/power_supply/brickpi-battery/.
Sysfs Attributes
scope Always returns System.
voltage_now Returns the battery voltage in microvolts.

Voltages

The BrickPi3 monitors four different voltages for the on-board regulators (these are coming from the BrickPi3 itself, not the Raspberry Pi). There is one for 3.3V, one for 5V, one for 9V and one for direct battery voltage.

These voltages are read using the mainline kernel Industrial I/O driver. You can read the values at /sys/bus/iio/devices/iio\:device0/in_voltage_N_input where N is one of 3V3, 5V, 9V or VCC (battery).

Tip

You can use the Battery driver for monitoring the battery instead of using this driver.