Circuit help - cut off when microswitch changes state - not just opens

Thread Starter

Yakshaver

Joined Oct 9, 2014
4
I would like to build the following circuit. A user holds down a button for a few seconds that then powers a motor to position 1 where a microswitch is trggered and cuts power to the motor. the user then releases button. Then again the user holds down a button for a few seconds that then powers a motor to position 2 where a microswitch is trggered and cuts pwr to the motor. user then releases button. then the next operation it's back to position 1.

I have built the 1st part where the motor stops when the microswitch opens but I am stuck on how to get the behaviour above. Any help appreciated.

Thanks.
 

sirch2

Joined Jan 21, 2013
1,037
OK so you seem to have 0 ---- 1 ---- 2

it starts at '0', the user presses the button and the motor runs until something driven by the motor hits '1'; do they hold the button down until the motor stops or is it a momentary press and it runs until '1'?

They then press the same button again and it runs until it hits '2'

The next press causes it to go from '2' to '1', I assume this means running the motor backwards?

What sort of technology do you have in mind, relays, transistors, logic gates, micro-controller?
 

ErnieM

Joined Apr 24, 2011
8,377
The solution that makes most sense to me is a state machine as you have a number of states here:

1- Do nothing till button press
2- Power motor till trip sensor
3- Do nothing till button press
4- Power motor till trip sensor
5- Not sure what happans here as the description peters out, eventually get back to #1

A counter can accomplish this, though a shift register may be a cleaner approach as each state is defined by a single output.

No further suggestions are offered until the fuzzy step 5 is defined.
 

Dodgydave

Joined Jun 22, 2012
11,302
A cd4017 counter, button press clocks the outputs, triggers a timer to run motor till it stops, last stop resets counter.
 
Top