# Garage Door Logic - Help needed!

#### Bubbaboufstavson

Joined Jan 13, 2016
2
Hello all!

This circuit may seem relatively simple to you guys, but I seem to be struggling. My assignment is to create a ladder diagram of a garage door using only control relays and a push-button. The button will move the door as follows

Press 1: Down
Press 2: Stop
Press 3: Up
Press 4: Stop
-Repeat-

I understand the concept of a flip flop circuit but adding in the stop function is hurting my brain. Any help would be greatly appreciated.

#### GopherT

Joined Nov 23, 2012
8,012
Use the switch to trigger a flip flop1, flipflop1 triggers flipflop2

Flipflop1 turns on or off a master power (simple on/off relay).

A second dpdt relay is triggered by the second relay (arranged as a motor-reversing h-bridge)

#### WBahn

Joined Mar 31, 2012
26,398
I understand the concept of a flip flop circuit but adding in the stop function is hurting my brain. Any help would be greatly appreciated.
Is it hurting your brain because it is a "stop" function? If so, forget about the specifics of the function and think of it more generically:

Push once - Function A
Push once - Function B
Push once - Function C
Push once - Function D
Push once - Function A
and so on...

You have four states that you have to keep track of. You can do this with two relays (which this problem lends itself to) or it might be easier to implement it using three or even four relays. Your fundamental goal is to first figure out how you can cycle through four distinct states via successive pushes of the button. After that it is a matter of using each state to implement the task associated with that state. It often helps if you first decide the practical meaning of each state. As GopherT described it above, if you use two relays then you can think of one relay controlling whether the drive has power and the other controlling what direction the motor will drive the door in when powered.

#### MikeML

Joined Oct 2, 2009
5,444
Four states, one input, one output; pretty simple state machine.

Let's see, log(base 2) of 4 = 2, therefore you can do it with two flip-flops or two relays...