Rotation sensor

Site map :

Various stuff
Rotation sensor
Security device
The Robot pages
Lego Ants
Robotarm v1.0
Robotarm v3.0
Tutorial 1
Tutorial 2
Physics of Lego
Measuring strength
Combining motors
Stepper motors
Lego ratchet
Electronic ratchet
1-to-2 multiplexor
2-to-7 multiplexor
RCX Mindstorms
Survey of RCX programming
The famous machines
Turing machine
New Page 1
References and links

Last upgrade to the site:
august 10th, 2002.

There has been 

access to my Lego pages since creation.

This is an unofficial LEGOŽ web site.
LEGOŽ is a trademark of the LEGOŽ Group of companies which does not sponsor, authorize or endorse this site.
You can visit the official LEGO website at:

Copyright 1996, 2000, Denis Cousineau


It is sometimes necessary (see Turing machine) to have a rotation sensors accurate for quarter of turns. Although the rotation sensor sold by Lego if perfect for that purpose, it is (i) difficult to obtain, not being included in the standard kits, and (ii) expensive, in case many rotation sensors are needed.

Mario Ferrari suggested a method to use a LEGO switch as a rotation sensor for detecting 180 degree turns (half turns). Here, we expand his method so that the LEGO switch is sensitive to 90 degree turns. As shown in the next diagram, it is easy to achieve using two wires, being placed back to back on the other end of the switch:

On this diagram, if you turn the red axle, the switch will turn on and off four times per turns. It is on when the axle is 45 degrees from the horizontal (or 135 or 225 or 315). It is off when the axle is 0, 90, 180 or 270 degrees. If it is connected to a Mindstorms RCX with the input configured as a switch detector, it will be 1 in the first cases and 0 in the other cases.

The beauty of this method is that it can be expanded to include as many rotation sensors as you need in serial. For example, in the next diagram, three are connected. If all the axles are 45 degrees from the horizontal, the sensor will be on (a reading of 1). If any axle is not in a 45 degree position, the overall sensor will be off (a reading of 0).


Below is the configuration used in the Turing machine. The only difference is that there is a small gap between the LEGO switchs. Because there is no electric plate that are 5-bump long, I used short wires instead.

sensor-8.jpg (527211 bytes)