Drivers MLK Input Devices


A library of over 250,000 device drivers, firmware, BIOS and utilities for Windows.

The EV3 has four input ports for connecting sensors and other devices (likesensor multiplexers or motor controllers). If you are trying to use somethingthat plugs into one of those ports, you are in the right place.

Driver Description Download drivers for Realtek Input Device sound cards (Windows 10 x64), or install DriverPack Solution software for automatic driver download and update Are you tired of looking for the drivers for your devices? In computing, an input device is a peripheral (piece of computer hardware equipment) used to provide data and control signals to an information processing system such as a computer or other information appliance. Examples of input devices include keyboards, mice, scanners, digital cameras and joysticks. Remnant USB device drivers can remain and interfere with the installation of Dictaphone input devices such as GoMD, PowerMic, USB footpedal, and the Olympus and Grundig portables. This article provides a troubleshooting procedure to eliminate drivers for non-present devices on client workstations.

Supported Sensors¶

This is a list of sensors that currently have drivers available in the ev3devkernel. The Part Number column links to the vendor website. The Namecolumn links to the sensor’s entry in Appendix A.

Part NumberNameDriverTypeAuto-detect
Generic EV3 Analog Sensorev3-analog-XXEV3/AnalogY
Generic NXT Analog Sensornxt-analogNXT/AnalogY
Charmed Labs
Pixy LEGOPixy (CMUcam5) for LEGOpixy-legoNXT/I2CY
Dexter Industries
dFlexFlexible Sensor for Mindstorms NXTdi-dflexNXT/AnalogN [5]
9DOF Sensor9DOF Sensorfcl-9dofEV3/UARTY
ADC AdapterADC Adapterfcl-adcEV3/UARTY
Altitude SensorAltitude Sensorfcl-altitudeEV3/UARTY
Gesture SensorGesture Sensorfcl-gestureEV3/UARTY
Humidity SensorHumidity Sensorfcl-humidityEV3/UARTY
IR ReceiverIR Receiverfcl-irEV3/UARTY
Light SensorLight Sensorfcl-lightEV3/UARTY
NXT Color Sensorht-nxt-colorNXT/I2CY
NAA1030NXT Angle Sensorht-nxt-angleNXT/I2CY
NAC1040NXT Acceleration / Tilt Sensorht-nxt-accelNXT/I2CY
NBR1036NXT Barometric Sensorht-nxt-barometricNXT/I2CY
NCO1038NXT Color Sensor V2ht-nxt-color-v2NXT/I2CY
NEO1048NXT EOPDht-nxt-eopdNXT/AnalogN [2]
NFS1074NXT Force Sensorht-nxt-forceNXT/AnalogN [2]
NGY1044NXT Gyro Sensorht-nxt-gyroNXT/AnalogN [2]
NIL1046NXT IRLink Sensorht-nxt-ir-linkNXT/I2CY
NIR1032NXT IRReceiver Sensorht-nxt-ir-receiverNXT/I2CY
NIS1070NXT PIR Sensorht-nxt-pirNXT/I2CY
NMC1034NXT Compass Sensorht-nxt-compassNXT/I2CY
NMS1035NXT Magnetic Sensorht-nxt-magNXT/AnalogN [2]
NSK1042NXT IRSeeker V2ht-nxt-ir-seek-v2NXT/I2CY
NSX2020NXT Sensor Multiplexerht-nxt-smuxNXT/I2CY
SPR2010NXT SuperPro Prototype Boardht-super-proNXT/I2CY
45504EV3 Ultrasonic Sensorlego-ev3-usEV3/UARTY
45505EV3 Gyro Sensorlego-ev3-gyroEV3/UARTY
45506EV3 Color Sensorlego-ev3-colorEV3/UARTY
45507EV3 Touch Sensorlego-ev3-touchEV3/AnalogY
45509EV3 Infrared Sensorlego-ev3-irEV3/UARTY
9581WeDo USB Hubwedo-hubUSBY
9583WeDo Motion Sensorwedo-motionWedo/AnalogY
9584WeDo Tilt Sensorwedo-tiltWedo/AnalogY
9668Energy Displaylego-power-storageNXT/I2CY
9749NXT Temperature Sensorlego-nxt-tempNXT/I2CY
9843NXT Touch Sensorlego-nxt-touchNXT/AnalogY [1]
9844NXT Light Sensorlego-nxt-lightNXT/AnalogY
9845NXT Sound Sensorlego-nxt-soundNXT/AnalogN [2]
9846NXT Ultrasonic Sensorlego-nxt-usNXT/I2CY
CruizCore XG 1300LDigital Gyroscope And Accelerometermi-xg1300lNXT/I2CN [4]
AbsoluteIMU(-A/C/G)Gyro, MultiSensitivity Accelerometer and Compassms-absolute-imuNXT/I2CY
EV3SensorMUXEV3 Sensor Multiplexerms-ev3-smuxNXT/I2CY
IRThermometerIR Temperature Sensor for EV3 or NXTms-ir-thermometerNXT/I2CY
LightSensorArrayLight Sensor Arrayms-light-arrayNXT/I2CY
LineLeaderLine Follower Sensorms-line-leaderNXT/I2CY
NXTCam-v4Vision Subsystem v4 for NXT or EV3ms-nxtcamNXT/I2CY
NXTCam-v5Vision Subsystem v5 for NXT or EV3 (with fixed lens)ms-nxtcam5NXT/I2CY
NXTMMX-v2Multiplexer for NXT/EV3 Motorsms-nxtmmxNXT/I2CY
NxtServo8-channel Servo Controllerms-8ch-servoNXT/I2CY
PCF8574-NxSensor building kit for NXT with PCF8574 ICpcf8574Other/I2CN [3]
PCF8591-NxSensor building kit for NXT with PCF8591 ICpcf8591Other/I2CN [3]
PPS58-NxDigital Pneumatic Pressure Sensorms-pps58-nxNXT/I2CY
PixyAdapterPixy Adapter for MINDSTORMS EV3 or NXTms-pixy-adapterNXT/I2CY
RTC-Nx-v3Realtime Clock for NXTds1307Other/I2CN [3]
TouchMuxTouch Sensor Multiplexer for NXT & EV3ms-nxt-touch-muxNXT/AnalogN [2]
[1]Only touch sensors that shipped with the NXT 2.0set can be automatically detected. Older touch sensors that shipped withthe original NXT sets are missing an electrical connection (pin 2 is notinternally connected to pin 3) and cannot be automatically detected.
[2](1, 2, 3, 4, 5, 6) The automatic detection algorithm detects this sensoras an NXT/Analog type sensor but it cannot determinethe exact sensor type. The generic analog driver (nxt-analog) will beloaded by default for this sensor. See the The lego-port Subsystem forinformation on how to manually load the correct driver.
[3](1, 2, 3) The automatic detection algorithm detects this sensoras an I2C sensor and the port is automatically put into I2C mode. However,the sensor does not follow the LEGO MINDSTORMS convention for I2C sensors,so the exact type of sensor cannot be determined. See Appendix C: I2C Devices forinformation on how to manually load the correct driver.
[4]The automatic detection algorithm detects this sensoras an I2C sensor and the port is automatically put into I2C mode. However,this sensor only partially follows the LEGO MINDSTORMS convention for I2Csensors, so the driver must be loaded manually. See the sensor’s page formore information.
[5]The Dexter Industries dFlex sensor cannot be automaticallydetected (because pin 2 is not connected to pin 3). In order to use thissensor, you must manually set the port to nxt-analog mode and then setthe driver to di-dflex.

Unsupported Sensors¶

One of the goals of ev3dev is to support as many sensors as possible. In fact,even if a manufacturer’s documentation says that a device does not work withthe EV3, chances are it will work with ev3dev.

If you have a sensor that is not supported yet, let us know about it byopening an issue on GitHub. For many sensors adding a driver is trivial -even if you are not a “kernel hacker” or a “c programmer”. For the non-trivialsensors, see the contributing page for information on how to write a driveror how to donate hardware to someone who will.

Using Sensors¶

Automatic Detection¶

The EV3 has “smart” sensor ports that can identify most sensors. Beware!Full automatic detection works on EV3 only. And even on EV3, some sensors cannotbe automatically detected. See notes below in the table of supported sensors.

For sensors that cannot be automatically detected, you can manually controlthe input port mode. Read more about it on Input / Output Ports page.

On FatcatLab’s EVB, EV3/Analog and EV3/UART sensors can be automatically detected.For NXT/Analog sensors, you must manually set the mode. Most NXT/I2C sensors shouldbe automatically detected.

On BrickPi, BrickPi+ and BrickPi3, sensors cannot be automatically detected atall. You must manually configure the input ports for all sensors.

On PiStorms, detection of EV3/UART, EV3/Analog and NXT/I2C sensors issemi-automatic. If you put the input port into ev3-uart, ev3-analog,or i2c-thru mode, the specific type of sensor will be automatically detected(assuming it is a LEGO compatible sensor). So you usually don’t have to write tothe set_device attribute of the port for these sensors.

MINDSTORMS Compatible Sensors¶

Most of the supported sensors are designed to work with LEGO MINDSTORMS. Thesesensors use the LEGO sensor class. You can find thesein sysfs at /sys/class/lego-sensor/. The sensors have modes that selectwhat type of data is read from the sensor. Generally, you will select a modeand then read the data value from the sensor. Follow the link above for moredetails.

Other Sensors and Advanced Usage¶

Many sensors that were not specifically designed for LEGO MINDSTORMS can be usedwith ev3dev too. You can read more about the “Other” sensor types below. Also,some MINDSTORMS compatible sensor may have advanced features that are notaccessible using the lego-sensor class.

When using sensors this way, often automatic detection will not work correctly,therefore it is usually best to manually select the mode of input port (e.g.other-i2c or other-uart).

For more information on using I2C sensors, check out Appendix C: I2C Devices.

Types of Sensors¶

When dealing with sensors in ev3dev, it is useful to know how it communicateswith the EV3 brick. There are three basic kinds of communication that the inputports can use to get information from the sensor, Analog Sensors, I2C Sensorsand UART Sensors, plus one special type for LEGO NXT Color Sensors.

Analog Sensors¶

These are the simplest type of sensor. The measured value is converted to avoltage (0-5VDC) that is read by the EV3.

EV3/Analog Sensors¶

These are sensors that were designed specifically for the EV3 and will not workon the NXT because the pinout is different. They contain an ID resistor so thatthe EV3 can tell different types of sensors apart. The actual analog value ismeasured on pin6.

NXT/Analog Sensors¶

These sensors are designed for the NXT, but also work on the EV3. The EV3 cannotdifferentiate between most of these sensors though, so you have to tell itwhich one your have or just use the generic driver.

RCX/Analog Sensors¶

RCX sensors also fall into this category, but do not work with the EV3 - atleast not with the converter cable described in the NXT Hardware Developerskit. This is due to a difference in the input port pins between the EV3 andthe NXT. If someone wants design a new converter cable, we could make them work.

WeDo/Analog Sensors¶

WeDo sensors are also analog sensors. They are actually electrically similar toEV3/Analog sensors (require 5V power and have ID resistor). Currently, we onlysupport WeDo sensors attached to a WeDo hub, but if someone would like to designa cable and modify the wedo-sensor and lego-ports drivers, we couldeasily make them work with the input ports on the EV3.

LEGO NXT Color Sensors¶

The LEGO NXT Color Sensor is in a class of its own. It uses a hybrid of analogand (non-standard) digital communications. The NXT Color Sensor is not usableat this point in time. We can detect it with the auto-detect, but we don’thave a driver for it yet.

I2C Sensors¶

I2C sensors are sensors that communicate with the intelligent brick via theI2C protocol. In the NXT documentation, they are referred to a “digital”sensors. These sensors can be sorted into two categories.

NXT/I2C Sensors¶

These are sensors designed using LEGO’s guidelines for NXT digital sensors.NXT/I2C sensors can be automatically detected because they contain vendor andproduct IDs at specific I2C registers.

Other/I2C Sensors¶

These can be any off-the-shelf I2C device or 3rd party sensors that are designedfor LEGO MINDSTORMS, but do not follow the guidelines of NXT/I2C sensors.

UART Sensors¶

The EV3 has a UART transceiver connected to each input port that canbe used to communicate with many devices using this widely used standard.

EV3/UART Sensors¶

These is a new type of sensor that is designed specifically for the EV3 (theydon’t work with the NXT). These sensors are a bit “smarter” in that in additionto sending the data of what they measure, they also send information about theircapabilities. This means that any new EV3/UART sensors should “just work” withoutus having to write new drivers.

Other/UART Sensors¶

In addition to sensors designed to work with EV3, any UART device can be connected.But, be careful of voltage levels. The EV3 uses 3.3V I/O. It is safe to connectother devices that use 3.3V or 5V I/O. But, don’t connect anything with highervoltage!

The lego-sensor Subsytem¶

The lego-sensor class provides a uniform interface for using most of thesensors available for the EV3. The various underlying device drivers willcreate a lego-sensor device for interacting with the sensors.

Sensors are primarily controlled by setting the mode and monitored byreading the value<N> attributes. Values can be converted to floatingpoint if needed by value<N> / 10.0 ^ decimals.

Identifying sensors¶

Since the name of the sensor<N> device node does not correspond to theport that a sensor is plugged in to, you must look at the addressattribute if you need to know which port a sensor is plugged in to. However,if you don’t have more than one sensor of each type, you can just look for amatching driver_name. Then it will not matter which port a sensor isplugged in to - your program will still work.


Sensors can be found at /sys/class/lego-sensor/sensor<N>, where <N>is incremented each time a sensor is loaded.


The number <N> is not related to the port address.

Sysfs Attributes
addressread-onlyReturns the name of the port that the sensor is connected to, e.g.in1. I2C sensors also include the I2C address (decimal), e.g.in1:i2c8.
bin_dataread-onlyReading the file will give the unscaled raw values in the value<N>attributes. Use bin_data_format, num_values and the individualsensor documentation to determine how to interpret the data.

Returns the format of the values in bin_data for the currentmode. Possible values are:

  • u8: Unsigned 8-bit integer (byte)
  • s8: Signed 8-bit integer (sbyte)
  • u16: Unsigned 16-bit integer (ushort)
  • s16: Signed 16-bit integer (short)
  • s16_be: Signed 16-bit integer, big endian
  • s32: Signed 32-bit integer (int)
  • s32_be: Signed 32-bit integer, big endian
  • float: IEEE 754 32-bit floating point (float)
commandwrite-onlySends a command to the sensor. See the individual sensor documentationfor possible commands.
commandsread-onlyReturns a space separated list of the valid commands for thesensor.
directread/writeAllows direct communication with the sensor for using advancedfeatures that are not otherwise available through the lego-sensorclass. Returns -EOPNOTSUPP if the sensor does not support this.Currently this only works with I2C sensors. For I2C sensors, use:c:func:`seek()` to set the register to read or write from, then read orwrite the number of bytes required.
decimalsread-onlyReturns the number of decimal places for the values in thevalue<N> attributes of the current mode.
driver_nameread-onlyReturns the name of the sensor device/driver. See the list ofsupported sensors for a complete list of drivers.
fw_versionread-onlyReturns the firmware version of the sensor if available. Currentlyonly NXT/I2C sensors support this.
moderead/writeReturns the current mode. Writing one of the values returned bymodes sets the sensor to that mode. See the individual sensordocumentation for a description of the modes available for each typeof sensor.
modesread-onlyReturns a space separated list of the valid modes for the sensor.
num_valuesread-onlyReturns the number of value<N> attributes that will return avalid value for the current mode.
poll_msread/writeReturns the polling period of the sensor in milliseconds. Writingsets the polling period. Setting to 0 disables polling. Returns-EOPNOTSUPP if changing polling is not supported. Note: Settingpoll_ms too high can cause the input port autodetection to fail.If this happens, use the mode attribute of the port to force theport to nxt-i2c mode. Values must not be negative.
unitsread-onlyReturns the units of the measured value for the current mode.May return empty string if units are unknown.
value<N>read-onlyReturns the value or values measured by the sensor. Checknum_values to see how many values there are. Values withN >= num_values will return an error. The values are fixed pointnumbers, so check decimals to see if you need to divide to getthe actual value.
text_valueread-onlyReturns a space delimited string representing sensor-specific textvalues. Returns -EOPNOTSUPP if a sensor does not support textvalues.


In addition to the usual add and remove events, the kernel changeevent is emitted when mode or poll_ms is changed. The value<N>attributes change too rapidly to be handled this way and therefore do nottrigger any uevents.


Sensor Modules¶

The sensor drivers are implemented in the following modules:


The ev3-analog-sensor module provides all of the drivers for EV3/Analogsensors.

You can a list of the the devices implemented by this module by reading thedriver_names attribute in the /sys/bus/lego/drivers/ev3-analog-sensor/.


The ev3-uart-sensor-ld module is a tty line discipline that runs ontop of a tty. It listens for the information data that is sent from EV3/UARTsensors. When it receives valid data, it negotiates with the sensor, tellingthe sensor to enter data sending mode.

This line discipline has been assigned the number 29. To attach this linediscipline to a tty, run ldattach29/dev/tty<N> where <N> is the nameof the tty you want to connect to.


Input Devices Of Computer

This driver works with any tty, which means the sensor does notnecessarily have to be plugged into one of the input ports on the EV3.

EV3/UART sensors do not require individual driver implementations like othertypes of sensors. Instead, all of the needed info to sent from the sensor ina common format. As a result, the name returned by the driver_nameattribute may not be a real driver name. For well-known sensors (the LEGOEV3 sensors and FatcatLab sensors) it will return a name like lego-ev3-color.For unknown sensors it returns ev3-uart-<N>, where <N> is the type idof the sensor.

Output Devices

The ev3-uart-sensor module provides all of the drivers for EV3/UARTsensors. This module is only used on devices that can’t use the linediscipline.

You can a list of the the devices implemented by this module by reading thedriver_names attribute in the /sys/bus/lego/drivers/ev3-uart-sensor/.


The nxt-analog-sensor module provides all of the drivers for NXT/Analogsensors. These drivers scale the analog voltage read from the sensor to auseful value.

You can a list of the the devices implemented by this module by reading thedriver_names attribute in the /sys/bus/lego/drivers/nxt-analog-sensor/.


The nxt-i2c-sensor module provides all of the drivers for NXT/I2C sensors.

Input Mapper

Module Parameters
allow_autodetectSetting to N disables probing of sensors. Default is Y.
default_poll_msThis provides the default value for the poll_ms attribute. A valueof 0 will disable polling by default. Changes only affect sensorsplugged in after the change was made. Default is 100 msec. Values mustnot be negative.


These parameters can be changed at runtime by writing to/sys/module/nxt_i2c_sensor/parameters/<parameter>.

Drivers Mlk Input Devices Definition

You can a list of the the devices implemented by this module by reading thedriver_names attribute in the /sys/bus/lego/drivers/nxt-i2c-sensor/.