Touch Sensor Multiplexer

The HiTechnic Touch Sensor Multiplexer (or Touch Mux for short) is a device that allows up to four (4) Touch Sensors to be connected to a single sensor port on a LEGO NXT brick. This significantly increases the number of Touch Sensors that you can use in your designs.

A Touch Sensor is an Analog device. This might seem strange because it should only have two states: Pressed and Not Pressed (or Released), which is binary and therefore seems like it should be a Digital sensor. However, it uses the Analog to Digital (A/D) converter in the brick to sense whether it is pressed or not. Therefore it returns a raw value of 1023 when not pressed, and some low value when pressed. (The actual value it returns when pressed is irrelevant as long as it is, say, less than half of 1023).

You can view the state of the touch sensors attached to the Touch Mux using a web browser. The following diagram shows what this should look like:

Click for larger image

Notice that the state of each Touch Sensor is listed on the web page. This is also represented diagramatically so you can see at a glance which sensors are depressed.

The "Switches" value is a binary representation of the touch sensors that are depressed. Sum up the values 1, 2, 4 and 8 for each corresponding depressed sensor (1, 2, 3 or 4) to obtain the total. If you are using the data from another service this allows quicker comparisons for combinations of touch sensors that are depressed simultaneously.


The way that the Touch Mux works is that it combines the outputs of the four Touch Sensors in a non-linear way so that it is possible to tell from the raw A/D reading exactly which sensors are pressed and which ones are not. (If there is no sensor attached to one of the four inputs, then obviously it is not pressed). The exact calculations are in the service code.

See the general note on Polling.

Last edited Mar 2, 2010 at 6:56 AM by TrevorTaylor, version 5


No comments yet.