Limit Switches:  Theory and application
Go to Home Page

Many mechanical devices have a limit, beyond which they can not move without damage.  An example of this is the steering wheel of your car.  You can turn the wheel to a certain point, and then it stops.  If you force it beyond this point, something will break.  This problem is usually handled by one of three possible methods:

  1. The mechanism can be constructed stronger than the force applied.  Electric windows on a car usually work this way.  When the window reaches the top or bottom, the motor stalls.  Power is still applied, but the motor is not strong enough to break anything.
  2. The mechanism can be constructed to disengage when it reaches the end.  On an old gas powered lawn mover, or toy gyroscope,  the starter rope will disengage when you reach the end of the rope.
  3. Some form of sensor can detect when the mechanism reaches it's limit, and turn off the power.  This is usually done with an electrical switch.  In this application, the switch is known as a limit switch.
All three methods above can be used with Lego mechanisms.  The Lego motors can be stalled if your mechanism is strong.  The micro-motor has a built-in slip clutch.  Rack-and-pinion drives can be designed so the pinion is ejected (disengaged) from the rack when it reaches the end.
The most common solution with Mindstorms is to use a sensor that turns off the electrical power.  A sensor watcher can be set to turn off a motor when a switch sensor is pressed.  Unfortunately, this method requires a sensor input, that may not be available.
It is possible to build a limit switch that does not use a sensor input !

When you understand how limit switches work, you can build your own limit switch.
If you prefer, Techno-stuff makes an adapter that lets you use Lego switches as limit switches.

Theory of operation

The simplest limit switch is just a switch in series with a motor, as shown in drawing A.  The switch has "normally closed" contacts, meaning the switch is "on" when the button is NOT pressed.  When the switch button is pressed, the switch turns off. The switch is positioned so that when the mechanism reaches it's end of travel, it pushes the switch to the "off" position.  The problem is that when the switch is off, the motor can not be reversed.  The mechanism must be reset by hand.
 

Simple limit switch
 

DC motors like the lego motors can be reversed by reversing the direction of current flow.  With the circuit in drawing A, revesing the power does nothing because the switch is open.  This problem can be fixed by adding a diode.   A diode is an electronic component that allows current to flow in one direction, but not the other.  The symbol for a diode is an arrow with a perpendicular line across the tip.  Current flows in the direction of the arrow.   Drawing B shows a diode in parallel with the switch.  When the switch is closed, the diode has no effect.  When the switch is open, the motor can run in one direction but not the other.  Choose the direction of the diode such that the motor can be reversed when it has stopped at it's limit.

Limit switch for one direction only

Sometimes you may want to stop a mechanism at both ends of travel.  To do this, add a second switch and diode, as shown in drawing C.
Place a switch at each end of the mechanism, with diode direction chosen so the motor may be reversed when it is stopped by the switch.

Limit switch schematic for two directions


Timed operation

The position of a mechanism can be set fairly well by simply running the motor for a set amount of time.  If a mechanism is cycled back and forth many times, small errors from each cycle will acumulate to create an error that grows large.  Error can be prevented from acumulating by using a limit switch to reset the error on each cycle.  Instead of moving the mechanism back for a set amount of time, apply reverse power for a longer time, and let it be stopped by a limit switch.  This way it will always return to the same starting position.


Example

The picutre below shows a motorized gate.  The sliding gate is white, with grey toothed plates on top.  A limit switch detects when the gate is fully open, and stops power to the motor.  In this example, there is no limit switch for the gate closed position.  The gate is closed by running the motor for the right amount of time.

If the closing time is set properly, this gate can open and close forever with no porblems.  If the closing time is set too long, the toothed plate on the gate will go past the drive gear, stopping motion.  A rubber band may be used to pull the gate back to where the drive gear will re-engage.  This forms a purely mechanical limit mechanism.  An alternative is to add a second limit switch, that would stop the motor when the gate is fully closed.

. . . 
 
 

jordan 11 legend blue legend blue 11s jordan 13 black infrared 23 jordan 11 legend blue jordan 11 legend blue legend blue 11s black infrared 13s jordan 13 black infrared 23 legend blue 11s jordan 13 black infrared jordan 11 legend blue jordan 11 legend blue legend blue 11s jordan 11 legend blue legend blue 11s legend blue 11s jordan 13 black infrared 23 black infrared 23 13s legend blue 11s jordan 11 legend blue jordan 13 black infrared 23 legend blue 11s jordan 11 legend blue legend blue 11s jordan 11 legend blue jordan 11 legend blue jordan 11 legend blue jordan 11 legend blue jordan 11 legend blue jordan 11 legend blue jordan 11 legend blue black infrared 23 13s black red 13s legend blue 11s legend blue 11s legend blue 11s legend blue 11s jordan 13 black infrared 23 jordan 11 legend blue black red 13s michael kors black friday michael kors black friday michael kors black friday michael kors black friday michael kors black friday uggs Black Friday lululemon cyber monday juicy couture cyber monday hollister cyber monday Abercrombie and fitch black friday coach black Friday bose black friday pandora black friday burberry cyber monday under armour black friday burberry black friday kate spade cyber monday canada goose cyber Monday michael kors cyber monday north face cyber Monday uggs black Friday uggs cyber monday canada goose black friday true religion cyber monday michael kors cyber monday moncler black friday uggs black Friday beats by dre cyber Monday jordan black friday beats by dre cyber Monday kate spade cyber monday canada goose cyber Monday beats by dre black Friday north face cyber Monday beats by dre cyber Monday beats by dre black friday uggs black friday uggs black friday lululemon cyber monday Uggs Black Friday nike black friday nike cyber monday uggs cyber monday Babyliss black Friday michael kors black Friday michael kors cyber Monday michael kors cyber Monday michael kors cyber Monday michael kors black Friday Juicy Couture cyber monday uggs black friday north face black friday michael kors black Friday Polo Ralph Lauren cyber monday polo black friday michael kors cyber Monday michael kors black friday mcm cyber monday uggs cyber monday north face black friday michael kors cyber Monday north face cyber monday coach black friday uggs black friday Juicy Couture black friday north face cyber monday uggs cyber monday black friday jordans uggs cyber monday Victoria Secret cyber monday uggs cyber monday Juicy Couture cyber monday canada goose cyber monday michael kors black Friday north face cyber monday michael kors cyber Monday pandora cyber Monday canada goose cyber monday canada goose cyber monday uggs cyber monday beats by dre black Friday north face black friday michael kors black Friday michael kors cyber Monday north face black friday uggs black friday michael kors black Friday uggs black friday uggs black friday michael kors black Friday uggs black friday uggs black friday michael kors black Friday michael kors black friday uggs black friday michael kors black Friday beats by dre cyber Monday michael kors cyber Monday north face cyber monday michael kors cyber Monday michael kors cyber Monday beats by dre black Friday michael kors cyber Monday beats by dre black Friday beats by dre cyber Monday beats by dre cyber Monday michael kors black friday michael kors cyber monday uggs cyber monday michael kors black friday uggs cyber monday michael kors cyber monday michael kors black friday michael kors cyber monday michael kors cyber monday michael kors black friday north face black friday uggs cyber monday north face black friday north face cyber monday uggs black friday north face cyber monday uggs cyber monday north face cyber monday uggs black friday uggs cyber monday