Author Options:

the motor driver L293D controlling the direction of motor, i want to use limit switch to control two position of motor Answered

I am developing a automatic gate project. I want the DC motor stopped as soon as the gate closed or opened completely. I use IC L293D to control the motor forward or backward. This project is also using Arduino. I plan to use a limit switch to control the movement of  DC motor.



2 years ago

Just to demo the other way, or maybe to prevent motor stall burn out when the micro goes to La-la land ! .


thanks a lot! it works...I've simulated the circuit, but the motor can only rotate in one direction and not in the other direction. after changing direction diode then I can drive the motor in two directions, and limit-switch works as well as I wanted.

You are correct !

Please tell me, what is the name of your simulation software.


im using Proteus 8

the simple simulation circuit i made

two way with limit swtich.JPG

Feed limit switches into digital inputs on Arduino.

Then use software to control the barrier.

From your diagram if pin 2 is high and pin 7 low the motor turns 1 way - if pin 2 is low and Pin 7 high it turns the other way.

if pin 2 and 7 are both high or low the motor stops.

thanks a lot sir. very helpful idea! ☺