Using limitswitches with diodes

DC motors are often used in electronic projects and a special case is when a DC motor needs to be brought to a certain begin or end position without going further. Typically limit switches are then used. Such a switch is pressed by the motor when that motor reaches its end position. Similarly such a switch can be used when a motor reaches its begin position again.

Obviously, when a limit switch is pressed an action needs to be taken to stop the motor. The solution for that is in fact simple and old news, but surprisingly many hobbyists don’t know about that solution or struggle with it, and that’s why I will explain it here (with apologies to all people who do know it)

Motor in middle position

Rotating movement

In the picture above there is a typical circuit for a motor with limit switches. Let’s presume the left switch is opened when the motor comes to its desired left position and the right one opens when the motor comes to its desired right position. Let’s also presume that the motor in that picture is in between left and right position.

It is easy to see that the electrical circuit is closed and that it doesn’t matter what polarity is used.

We then apply a positive voltage to the top wire and a negative voltage to the bottom wire. The motor starts turning left, until it reaches, presses and opens SW1.


Motor in leftmost position

At that moment, the electric circuit is open: Switch S1 is open and the left diode blocks a positive voltage. The motor stops.

To make the motor go back to its original position, we need to reverse polarity, so now the left most diode sees a negative voltage on its cathode and will conduct current: the motor turns reverse. After it traveled a fraction, SW1 will close again (as in the first picture)…but that only becomes relevant later. We let the motor travel reverse till it comes to its desired right position, where it opens SW2.



Motor in desired right position

As soon as SW2 is open, the circuit gets broken again, no current will flow and the motor stops. As SW1 has closed again after the motor started traveling, the circuit will now conduct for a positive voltage on the top connector. Though SW2 is open, the right-side diode will conduct.

Linear Actuators

I explained this using example of a rotating movement but of course this also can be used with linear actuators: one switch to be activated at the extended position and one at the retracted position. The diodes should be put in as follows:
Say putting the positive voltage on the top line would make the actuator go to its extended position. Then Switch SW1 should be activated (actually ‘interrupted’) in that extended position and SW2 in the retracted position.
Explanation is that when SW1 is interrupted, the entire circuit is interrupted no current will flow and the motor stops. If you then reverse the polarity 9witj negative on the top wire) SW1 will still be interrupted, but the current can flow through the diode and the motor will spin backwards. Once it has done that enough SW1 will be closed again and the current will now flow through both switches….till the actuator comes to its retracted position and interrupts SW2 and thus the circuit.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.