Circuit memory

Discussion in 'The Projects Forum' started by Knarf180, Oct 28, 2011.

  1. Knarf180

    Thread Starter New Member

    Jun 1, 2011
    6
    0
    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
     
  2. crutschow

    Expert

    Mar 14, 2008
    13,014
    3,234
    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.
     
  3. Knarf180

    Thread Starter New Member

    Jun 1, 2011
    6
    0
    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

    [​IMG]


    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
     
  4. crutschow

    Expert

    Mar 14, 2008
    13,014
    3,234
    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.
     
  5. Knarf180

    Thread Starter New Member

    Jun 1, 2011
    6
    0
    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:

    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.
    [​IMG]
     
  6. crutschow

    Expert

    Mar 14, 2008
    13,014
    3,234
    Should work, if you can find one to buy.
     
  7. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    It can be very simple, you just need one DPDT toggle switch and wire it like this.
     
  8. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    @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.
     
  9. JDT

    Well-Known Member

    Feb 12, 2009
    658
    85
    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?
     
  10. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    If you could use DPDT relay, you can loose one transistor and probably even the 4093.
     
  11. Knarf180

    Thread Starter New Member

    Jun 1, 2011
    6
    0
    @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
     
  12. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    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
     
  13. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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.
     
Loading...