Help required to obtain alternate forward/reverse pulse from single push-button

Thread Starter

Deltech

Joined Feb 18, 2021
7
The following would be to use to replace a spring-to-centre toggle switch (which I don't like) with a single push-button.

I would like (if at all possible) to use a single push-button, which when pressed will send a short forward(?) pulse, and when pressed again will send a short reverse(?) pulse.

The final unit downstream requires pulses, NOT constant signal.

Could this be either by the push-button be momentary/non-latching and having 3 (or more?) pins for common(?), forward(?), and reverse(?), so that alternate presses would send forward/reverse pulses (if such a push-button is available, which I doubt);

OR,

it having only 2 pins, which would send a pulse to some an intermediate component/circuit, which in turn would send forward/reverse pulses downstream on alternate presses of the push-button.

Is such an idea possible, and if so, what other components would I require.

Thanks.
 

LesJones

Joined Jan 8, 2017
3,173
You could use the push button toggle a flipflop (Such as a CD4013). You could then differentiate the Q and not Q outputs. If you need to clean up the differentiator outputs you could feed them into a Schmitt trigger input inverter. (Such as a CD40106.) As you have given no details of pulse duration, amplitude and current drive requirements this is just the concept of one solution. If I was doing this I would probably use a microcontroller such as a PIC12F1840 or ATtiny13. This would be a single chip solution that could give pulse duration's from microseconds to may hours.

Les.
 

Thread Starter

Deltech

Joined Feb 18, 2021
7
LesJones,
thanks for quick reply.

Sorry I have limited electronics experience and never thought to provide the additional information.

This is to operate a set of motorised points on a model railway, which have a "common" connection plus 2 further connections for "normal" and "reverse" of the points.

The manufacturer states this can be 19-25v AC or DC, but I cannot find any information regarding the current draw.

These "normal" and "reverse" connections receive a "live" feed (AC or DC) from the switch (currently a spring-to-centre ON-OFF-ON 3-wire toggle switch). The live feed is only ever to "normal" OR "reverse", never both at the same time.

The points motor must only have a short "pulse" feed as a constant feed would burn it out. It is pretty quick acting (1/4s) , and I would say that the maximum time of the button being pressed is never more than 1 second.

I hope this information will help you to help me further?
 

LesJones

Joined Jan 8, 2017
3,173
If you are prepared to use them on DC then measuring the coil resistance would allow calculation of the current. The current when supplied from AC would be slightly less so it would be safe to assume the AC current was the same for selecting a suitable device to drive the coil. (Using DC would make the design easier.)

Les.
 

crutschow

Joined Mar 14, 2008
27,198
Below is the LTspice simulation of a circuit that operates on 24Vdc and should do what you want.
It alternately generates a pulse to the two coils for each push of the button.

U1 is a flip-flop that alternates states at each button press (R1 and C1 provide switch-bounce suppression).

The values of C4-R8, and C5-R11 determine the output pulse times.

U2 LM317 drops the 24V to 12V for the circuit (this could also be an LM7812 regulator).

The output MOSFETs M1 and M3 can be sized to drive your load. The ones shown will readily drive 4A or more.

1613662993998.png
 

eetech00

Joined Jun 8, 2013
2,352
The following would be to use to replace a spring-to-centre toggle switch (which I don't like) with a single push-button.

I would like (if at all possible) to use a single push-button, which when pressed will send a short forward(?) pulse, and when pressed again will send a short reverse(?) pulse.
1. If you use a single momentary pushbutton, how will you know the position of the turnout?

2. Be aware that if the circuit in post #7 is used, the turnout will be thrown to the state provided by the output of load2 at power up.
This means that if the turnout position were reverse (diverging) at power up, it will automatically change to normal position when power is applied to the circuit. If this is acceptable, then ignore this statement.
 
Last edited:

crutschow

Joined Mar 14, 2008
27,198
Be aware that if the circuit in post #7 is used, the turnout will be thrown to the state provided by the output of load2 at power up.
Actually it could be random since the real flip-flop can have an arbitrary state at power on.
An added power-on PRE or CLR circuit for the flip-flop could be used to define the state.
 

LesJones

Joined Jan 8, 2017
3,173
Two points. 1 I think the top end of C1 should be connected to the clock input of the the CD4013 rather than the D input.
2 The CD4013 could be kept powered up at a lower voltage from a lithium battery when the main power was off so it remembered it's state. This would only require a couple of diodes.

Les.
 

crutschow

Joined Mar 14, 2008
27,198
If you use a single momentary pushbutton, how will you know the position of the turnout?
You could add an LED indicator at the flip-flop output.
1 I think the top end of C1 should be connected to the clock input of the the CD4013 rather than the D input.
No, it works fine as shown.
R1-C1 delays the change in the D input until after the switch bouncing has stopped.
Thus multiple clock inputs during that delay have no further effect on the output state of the flip-flop.
So it doesn't suppress the switch bounces, it just ignores them.
 
Last edited:

crutschow

Joined Mar 14, 2008
27,198
I would add this feature, it will make that much better:)
I will if the TS says he wants it.

Alternately, remembering the state with a battery backup as Les suggested may be a better option.
The 4013 draws only leakage current in the static state so even a lithium coin cell should last about as long as its shelf life.
 

LesJones

Joined Jan 8, 2017
3,173
Deltech, Do you have the internal schematic of the points motor ? Now that you mention the two indicator LED's the output from these might give us some alternative ideas. The signals from the LED's may remove the need for a flipflop.
Crutschow. I now see how your de bounce circuit works. I think that will work better than the capacitor connected to the clock signal.


Les.
 

crutschow

Joined Mar 14, 2008
27,198
I now see how your de bounce circuit works. I think that will work better than the capacitor connected to the clock signal.
Yes, especially since the 4013 requires a fast clock rise-time for proper operation, and a capacitor at the clock input would slow that way down.
 

AnalogKid

Joined Aug 1, 2013
9,249
I'm not a RR guy, but I think there needs to be some kind of position feedback. It has not been stated what would happen if the device received two pulses of the same direction in a row. This is an issue at power-on. A fixed POR (power-on-reset) means that there is a 50% chance of the first pulse trying to move the device to a position it already is in. Again, I'm not a RR guy so I don't know if this is a fatal error.

One way around this is to change from a toggle flipflop to a single monostable followed by a 1:2 demultiplexor, with the demux selection coming from limit switches at the device. For maximum anal-ness, both limit switches would be SPDT, so botjh sets of contacts have to be correct before new action is allowed. This assures that the first pulse after power-up will be correct no matter which state the device is in, and that all following pulses will be acted upon lnly if the last pulse was a complete success (not only is the device off of the previous position, it also is completely in place in the new position). Let the motor be the memory.

ak
 
Last edited:
Top