Mindsensors PiStorms

The pistorms module provides drivers for most of the functionality of the mindsensors.com PiStorms including lego-port class instances for the input and output ports, an evdev driver (evdev is not to be confused with ev3dev) for the touchscreen and GO button, a power_supply driver for monitoring the battery and an leds driver for the multi-color LEDs.

Input Ports

The PiStorms has four LEGO MINDSTORMS EV3 compatible input ports. There are some differences though. Sensors cannot be automatically detected, so you must manually specify the mode of the port before using a sensors. And in many cases, you must also manually specify the type of sensor that is attached. Furthermore, all four ports share a single I2C adapter (master) instead of each port having its own.

General Info

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


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



The full address is in the format:


For example, if we are looking at the port labeled “BBS2” on the PiStorms, the address will be pistorms:BBS2.

[2]The generic nxt-analog driver will be loaded when this mode is set. You must manually specify thecorrect 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.

I2C signals are passed through the input port to i2c_arm on the Raspberry Pi. This means that all 4 input ports share the same I2C master and the devices must have different addresses even if they are connected to different ports on the PiStorms.

NXT/I2C sensors will be automatically detected, otherwise you must manually specify the sensor that is connected by using the set_device attribute.

[4]Only the LEGO EV3 Touch sensor is supported. The driver will load by default.
[5]Only the LEGO EV3 Ultrasonic, Color, Gyro, and Infrared sensors are supported. When this mode is set, a sensor device will be registered for the type of sensor that is attached (or was most recently attached).

Output Ports

The PiStorms has four LEGO MINDSTORMS compatible output ports. Unlike the EV3, motors cannot be automatically detected when attached. By default, the ports are configured with the NXT motor driver, which will work for most cases.

General Info

Module pistorms
Driver name pistorms-out-port
Connection types tacho-motor
Connection prefix M [6]
Number of modes 1


Name Description
tacho-motor NXT/EV3 Large Motor


[6]The full address will be something like pistorms:BAM1.

Touchscreen and GO Button

The pistorms module registers an input device node for the touchscreen an the GO button on the PiStorms.

The touchscreen provides ABS_X and ABS_Y events to indicate where the screen was touched and BTN_TOUCH to indicate when a touch event starts and stops.

The GO button is mapped to KEY_ENTER.


The pistorms module provides six LED devices for controlling the LEDs on the Pistorms. There are two tri-color LEDs. Each component (red, green, blue) is controlled separately.

The device nodes can be found at /sys/class/leds/pistorms:B<bank>:<color>:brick-status where <bank>> is A or B and <color> is red, green or blue.


Some models of PiStorms only have one LED. The driver will still provide controls for two, but only one will actually work.


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