Help using a operational amplifer as a 2 position latch circuit

Thread Starter

sornjs

Joined Dec 29, 2017
29
Thanks all for the assistance.
As i said, I believe my 30 year younger mind "adapted" from Mr. Mimms OP AMP book.
#15 is "elegent" enough to have been what I used. ellegent = simple = few parts.
I will review the following couple of posts, buid soething and let y'all know how I do.
Please check back if interested. will need to purchase parts, etc.
 

Thread Starter

sornjs

Joined Dec 29, 2017
29
I guess I didn't know as much as I thought!!
I will be using this circuit on numerous turnouts on my Model Railroad and the "Club" may adopt it for some of their turnouts. Either way, we will need a few. I plan on using quad opamp IC's to lower unit cost.
1. The 5K(?) resistior goes anywhere between SW1, terminal 1 and VCC?.
2. Can the power-on reset capacitor be located to set the preferred initial state of the circuit? Say in line with pin 3 or pin 2 of the op amp? Next to the switch, next to the opamp or where? Recommended specs for capacatior please.
3. Since I know near nothing about components, what will work for a quad op amp"
4. How do I "treat" any unused opamp bearing in mind what is unused today may be used tomorrow?
5. What will work for a printed circuit board. I can use one ic per board and feed up to 4 turnouts, or I can use more ic's per board and run more wire. I prefer 1 ic, 1 board I think. Less wire running around the layout.
4. Treatment of any unused opamp.
Again thanks!
 

AnalogKid

Joined Aug 1, 2013
10,986
1. Nope. Between SW1 pin 2 and Vcc. Note that there is a separate resistor for each circuit.

2. Nope. Between pin 3 (or whatever the non-inverting input is) and either Vcc or GND. Something in the 0.22 uF - 0.47 uF will give a time constant of about 1 millisecond, long enough to establish the power-on state but not enough energy storage to damage the switch contacts (if you are using extra-delicate switches).

3. LM324. Old, robust, cheap, robust, reliable, and robust.

4. If it might be used tomorrow for this circuit, connect the non-inverting (+) input to the output with 10 K; connect the inverting input to GND. This is a variation of the standard practice.

5. Think granularity. One quad opamp per board means that a component failure will take out four outputs when the board is removed for repair. An LM358 would affect only two circuits per board. Think about what is the right level of granularity for the system.

Note: For a quad opamp in four identical circuits, you do not have to repeat R1 and R2 four times. The inverting (-) inputs of all 4 opamps can be connected to a single R1-R2 divider. Putting a small capacitor across R2 as a noise filter is optional; you can use the same value as the opamp power pin decoupling capacitor.

The standard recommendation for an unused opamp is to connect the - input to the output (to form a voltage follower) and tie the + input to something within the input voltage range. For many opamps this rules out both power rails, but the LM324 is different; grounding the + input is fine. Do it with a thin trace so it is easy to cut if you need to isolate the pin for later use.

I'm not clear on what the output of this circuit drives. That could change things.

ak
 
Last edited:

ebeowulf17

Joined Aug 12, 2014
3,307
***EDIT: AK beat me to it, which makes this post look kind of silly now. Oh, well.

We'll see what AK says, but here's my take:

Given that you're only talking about a few resistors and one cap per op amp, if I were in your shoes, I might just populate everything for all four op amps on each board you make. The same components that make it work are also suitable treatment for unused op amps.

Also, I'm almost positive you can share the same node between R1 and R2 for all four op amps' inverting inputs.

So, for each unused op amp, connect its inverting input to the 1/2VCC node between R1 and R2, and add one extra resistor (like R3) per amp from output to non-inverting input.

Then, if you want to use them later, you can add the two buttons, the resistor to protect buttons from shorts, and the POR cap.

Sorry I'm no help on the other questions. I'm learning from this project too!
 
Last edited:

ebeowulf17

Joined Aug 12, 2014
3,307
Everything that agreed with me is correct.

ak
I'd like a button that generates that response automatically!

Regarding parts that didn't agree with you, since the board will already have an R1/R2 node available, is there any harm in tying inverting input to that instead of ground?

I know it's one step father away from standard practice, but these amps aren't necessarily being left unused forever, so why not allow board traces to be permanently assigned the way you'd eventually need them?

When the board is first powered up, it's a coin toss as to which output state any unused amp will latch into, but once it latches it's stable, so no worse off than if it had started with a grounded input, right?
 

Thread Starter

sornjs

Joined Dec 29, 2017
29
I never expected such good and prompt response.

The output of this circuit is intended to drive "Circuitron" Tortise switch machine and might be used to drive "gutted" Radio Contrtol Serovs or if I can work out other details to keep the electronics.
The "Tortise" is uses a dv motor to move a "fitting" back and forth and stall at each end of it's travel.

The fitting moves back and forth and causes one end or a wire to move accordingly.
The wire goes through a pivot point on the tortoise and other end of the wire moves.
The end of the wire causes jthe turnout to go from left to right or back.

By the way I believe I will populate everything so if i add a turnout all i have to do is basically connect ti

according do mfg documentation (unless I canpt read}
applied voltage. 8 - 12 vdc. (AC voltage to 12v will not hurt. won't operate though)
draw moving 4ma
draw stall 15 - 16 ma
 

AnalogKid

Joined Aug 1, 2013
10,986
Now that I see what the load is, the circuit we've been discussing needs some help. The output latches high or low, but that is not enough - you still need something to reverse the polarity of the DC power to the tortoise motor. There are a couple of ways to do this.

One is to use another opamp section as an inverting driver. The LM358/324 easily can supply 4 mA to the motor. Two opamps would make what is called a full H driver, with one motor lead going to each opamp output. This works *only* if neither motor lead has to be connected to the overall system power or ground. The nice thing about this approach is that it takes *zero* extra passive components. I'll see if I can whip up a modified schematic.

Another variation of the H driver is to use two 555's. I'm not a big 555 fan, but its output stage is beefy (200 mA) and it is a timer. I know the datasheet says the tortoise motor can run stalled indefinitely, but that makes my teeth hurt. Two 555's, each configured as a 5 second monostable, with the motor connected between them as above, gets you a circuit that can drive 0.2 A and shuts itself off at the end of travel. You don't need that much current for the tortoise, but it might work well for something else in the system.

ak
 

AnalogKid

Joined Aug 1, 2013
10,986
Here you go. C2A and C2B are the power-on state capacitors. Populate one or the other (not both), depending on which output state you want at power on.

ak
OpAmp-Latch-2.gif
 
Last edited:

Thread Starter

sornjs

Joined Dec 29, 2017
29
I hate it when i don't describe things adeauately.
I should have asked about a circuit would chang the voltage polarity with the pushbuttons.

I still recall the circuit being ele;elegant.

In the beginning I said I recalled an opamp circuit. To be honest, it could have meen anything.
 

AnalogKid

Joined Aug 1, 2013
10,986
I hate it when i don't describe things adeauately.
I should have asked about a circuit would chang the voltage polarity with the pushbuttons.
If the opamp in post #1 is powered by +/-12 V, it can drive one end of the motor directly if the other end of the motor is tied to GND. Pretty elegant.

ak
 

Thread Starter

sornjs

Joined Dec 29, 2017
29
I may not have been as crazy as i though although i still had trouble in the explanation.
Will you please provide circut details.

1. Can a power-on reset capacitor be used?
2. How do I "treat" any unused opamp bearing in mind what is unused today may be used tomorrow?
3. I like the option of popluating all op amp circutis in an ic.

thanks
 

ebeowulf17

Joined Aug 12, 2014
3,307
I may not have been as crazy as i though although i still had trouble in the explanation.
Will you please provide circut details.

1. Can a power-on reset capacitor be used?
2. How do I "treat" any unused opamp bearing in mind what is unused today may be used tomorrow?
3. I like the option of popluating all op amp circutis in an ic.

thanks
Unless I'm misunderstanding something pretty drastic here, you can simply build out each board (one quad op amp, which is good for two switching circuits now that each circuit requires two of the amps) all the way, whether you use all of it or half of it.

If you don't connect switches and a motor to the second half, it'll behave exactly the same as it would if you had switches there but hadn't pressed them yet. We know it's safe to power up the circuit without immediately pressing one of the buttons, so why should it be any different powering up the circuit with no buttons?

The number of connections and components to terminate the unused op amp is the same as the number to build it as a ready-to-use circuit, except for the extra caps. If you wanted to leave the switch caps and POR cap off of unused amps until you were ready to use them, you probably could, but as cheap as passive components are, I'd just build it out all the way except for switches and motors.
 

xox

Joined Sep 8, 2017
838
So would the above circuit work off of a single supply by simply terminating the motor at 1/2 Vcc instead of ground?
 

AnalogKid

Joined Aug 1, 2013
10,986
So would the above circuit work off of a single supply by simply terminating the motor at 1/2 Vcc instead of ground?
Yes, but that termination would have to be a very low impedance since all of the motor current is running through it and will dissipate a lot of power. Plus, you don't want the midpoint to move very much; if it changes when the motor is running, that change decreases the power available to the motor.

For bidirectional motor movement in a circuit where one end is switched and the other end is tied to a fixed voltage point, there has to be a midpoint somewhere. It is far more efficient to put it in the low current control side rather than in the high current motor side.

ak
 

xox

Joined Sep 8, 2017
838
Yes, but that termination would have to be a very low impedance since all of the motor current is running through it and will dissipate a lot of power. Plus, you don't want the midpoint to move very much; if it changes when the motor is running, that change decreases the power available to the motor.

For bidirectional motor movement in a circuit where one end is switched and the other end is tied to a fixed voltage point, there has to be a midpoint somewhere. It is far more efficient to put it in the low current control side rather than in the high current motor side.
I was thinking more along the lines of a unity gain follower referenced to a voltage divider. Either way you're pulling current from an op-amp output, right?

One thing I didn't think about though was the fact that an op amp has a maximum positive and negative voltage. A single supply design would effectively cut that range in half, obviously. Could be a deal-killer.
 
Top