Motor logic

Status
Not open for further replies.

ryanerb

New Member
Here's the project:
I press a momentary switch, it starts a motor moving until a limit switch is depressed. The motor then stops. When the momentary switch is pressed again, the motor moves in reverse until another limit switch is depressed.

IN- LimitSwitch1
IN- LimitSwitch2
IN- ActivateSwitch



I am a little confused on how to reverse the motor. I know i can just revrese the polarity, and it will switch directions. However, I will probably need a relay or something to drive the motor.

First off, how should i work with the motor? One idea is to have a output pin on the IC connected to the + lead on the motor, and another one to the - lead. When i want to go forward, i drive the + pin high, and when i want to go backwards, i drive the - pin high. Second, do i need a microcontroller for this or no? Any help would be appreciated. If you need more explanation from me, let me know.
 
What you need is motor driver L293B. Check out the datasheets. Look for bidirectional DC motor control.
 
Relay Logic Mototr Control

It might be possible to do this in relay logic ?

Looking at the circuit below...
the motor has travelled to the right limit, the right hand limit switch is open.

If you press the push button (top centre), the right limit will prevent R2 from energising but R1 will energise, causing the R1 N.O. contacts to make, this will keep power fed to the circuit when you release the button.
R1 has a change-over contact feeding one side of the motor, this will energise and cause the motor to run, leaving the right hand limit but as R1 is energised the N.C. contacts will now be open so R2 is still denied power.

When the motor reaches the left hand limit it will break the power to R1 resetting the circuit ready to push the button and run the motor in the other direction ...

Clear as mud ???
 

Attachments

  • reversingmotor.gif
    4 KB · Views: 522
Hi ryanerb,

While mechie's solution is excellent and well proven, I post another alternative simply because I already have it made earlier. Both designs work nearly the same while mine includes a bit of electronics components if that's would better suit your project requirement. You can also connect the resistor R3 and the push button directly to the microcontroller if you wish and do away with the CD4069.

There is a very small difference between the two circuits.

While mechie's circuit would run the motor left-right-left-right... if the person keeps his hand on the button. Mine would stop at each of the end limits and the person have to let go the button before he can move the motor again.

Both circuits works fine. Take your pick.
 

Attachments

  • servo_124.gif
    11.4 KB · Views: 496
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…