Circuit memory

Thread Starter

Knarf180

Joined Jun 1, 2011
6
I'm just starting to get my feet wet with this whole circuit design hobby. I am starting to grasp a few things but recently ran myself into a knowledge gap.

I have a DC motor that I would like to be able to toggle backwards and forwards using a single button.

So they first time the button is pressed the motor will receive current. If the button is pushed again the positive and negative are switched and the motor will run backwards. Forwards - Backwards - Forwards - Backwards, switching every time the button is pushed. If the button is not depressed the motor receives no current.

I'm not even sure where to begin with this one. I've never attempted anything that had any sort of memory.

Could someone set me off on the right foot? Thanks much
 

crutschow

Joined Mar 14, 2008
34,284
The forward and reverse can be done by driving the motor with an H-bridge motor driver circuit.

The alternate action can be achieved by using the push-button to clock a FF such as a CD4013. The FF Q output controls one side of the bridge and the /Q (not Q) output controls the other side of the bridge. (You will need to use a anti-bounce circuit for the PB output).

To have the motor only running during the time the PB is depressed can be done using two AND gates, such as in the CD4081, to AND each FF output with the PB signal. The AND outputs go to the respective bridge input.

You'll probably have some questions about this. Just let us know.
 

Thread Starter

Knarf180

Joined Jun 1, 2011
6
Geez. I was hoping it was going to be a lot easier.

I was thinking that a 555 timer could be used to store the bit of memory such as in this set/reset 555 light example




Maybe I'm better off adding a second switch to work as a sensor and then passing it to a relay to handle the polarity switching. Wouldn't be as time consuming

- Correction. That wont work, as soon as the switch is no longer depressed the relay will switch back
 

crutschow

Joined Mar 14, 2008
34,284
You originally said one push-button. If you use two, then you can use a set/reset circuit such as the 555 circuit you show to drive the motor reversing relay (with a snubber diode across the relay, cathode to positive end).

So you use the relay to reverse the motor but how will you stop it when you release the push button?

For that you could use a PNP transistor with the emitter connected to V+, the collector drives the motor (through the relay contacts), and two parallel base resistors, one to each push button. (Make sure you connect a snubber diode from the transistor collector (diode cathode) to ground to suppress any motor spikes.
 

Thread Starter

Knarf180

Joined Jun 1, 2011
6
The push button is actually another circuit which is already timed to only allow current through for 3 seconds, so stopping it really isnt an issue.

I really dont want to have to use a switches as sensors. It leaves the possibility for mechanical error. However, my limited knowledge doesn't allow me to build the intricate circuit that you described.

I do have all the parts you listed. I'll try and breadboard it and keep my fingers crossed.

I think I may have found a resolution. I just pulled this off of wikipedia:

Latching relay

Latching relay with permanent magnet
A latching relay has two relaxed states (bistable). These are also called "impulse", "keep", or "stay" relays. When the current is switched off, the relay remains in its last state. This is achieved with a solenoid operating a ratchet and cam mechanism, or by having two opposing coils with an over-center spring or permanent magnet to hold the armature and contacts in position while the coil is relaxed, or with a remanent core. In the ratchet and cam example, the first pulse to the coil turns the relay on and the second pulse turns it off. In the two coil example, a pulse to one coil turns the relay on and a pulse to the opposite coil turns the relay off. This type of relay has the advantage that one coil consumes power only for an instant, while it is being switched, and the relay contacts retain this setting across a power outage. A remanent core latching relay requires a current pulse of opposite polarity to make it change state.
It looks as though a ratchet or cam single coil relay does exactly what I want. Sadly I don't have one on hand. I hope radio shack carries them. What do you think of this solution?

Quick shot of my bins - I hate not having parts on hand.
 

crutschow

Joined Mar 14, 2008
34,284
..................
I think I may have found a resolution. I just pulled this off of wikipedia:

It looks as though a ratchet or cam single coil relay does exactly what I want. Sadly I don't have one on hand. I hope radio shack carries them. What do you think of this solution?
Should work, if you can find one to buy.
 

t06afre

Joined May 11, 2009
5,934
@Knarf180 is it a microcontroller in one of your bins:) Then I have such problem I always reach for for my programmer and start to think code.
 

JDT

Joined Feb 12, 2009
657
You set me a challenge - how to do it with the minimum number of components. Actually the best way would be to use a small 8-pin micro-controller like a PIC12F508, 4 transistors and a button (and nothing else).

But if you have not got the PIC or the programming knowledge, here is a circuit that uses CMOS logic.

You are correct in your original post that a memory element is needed. Here I use a D-type bistable latch to remember the last state. Each time the button is pressed it toggles to the opposite state. The gates then operate one or other relay to run the motor. The resistors and capacitor connected to the button "debounce" the button and give a sharp edge to toggle the 4013.

Can anyone do it without a micro-controller but with fewer components?
 

Attachments

Thread Starter

Knarf180

Joined Jun 1, 2011
6
@JDT - Amazing work. I wish I had half your knowledge.

As for the micro controller route. Would a pic18f2550 be sufficient? I have a burner which I've never used (money well spent) this might be a good time to give it its first run
 

t06afre

Joined May 11, 2009
5,934
@JDT - Amazing work. I wish I had half your knowledge.

As for the micro controller route. Would a pic18f2550 be sufficient? I have a burner which I've never used (money well spent) this might be a good time to give it its first run
A pic18f2550 will do more than fine. Just remember using micros like PIC. May be overwhelming in the beginning. But do not give up. You will quickly learn the ropes. Ask for help in this forum. Then needed
 

SgtWookie

Joined Jul 17, 2007
22,230
<snip>
It looks as though a ratchet or cam single coil relay does exactly what I want. Sadly I don't have one on hand. I hope radio shack carries them.
I can guarantee you that Radio Shack does not carry ratchet nor cam single coil relay; they didn't even carry them back in the 1960's-1970's when they had a rather large collection of components.
 
Top