Connect with us

Need help with intermittent circuit failures - JK Flip Flops

Discussion in 'Electronic Basics' started by Jason S, Jun 6, 2006.

Scroll to continue with content
  1. Jason S

    Jason S Guest


    I designed this simple circuit where it controls a gearhead motor. The
    circuit is supposed to stop the motor for 1 sec (when triggered), and then
    upon reactivation, the motor is to change its polarity and spin the opposite
    direction, and so-forth.

    What the circuit should do:
    1) Motor spins (let's just say clockwise) until a timer is triggered.
    2) Timer cuts off power to motor breifly (enough time for it to stop
    spinning) for 1 sec.
    3) 1 sec lapses.
    4) Relay then changes state, changing motor polarity.
    5) At the same time, power is reapplied to the motor (should spin
    anti-clockwise this time).
    6) Cycle repeated until timer triggered again.

    The motor is to stop briefly before the polarity change-over for obvious
    reasons (needs time to stop spinning before changing direction!).
    The circuit consists of a 555 timer IC connected as a monostable which is
    triggered by a reed switch and magnet (when magnet is nearby, the reed
    switch closes and therefore activates the timer). The timer gives out a 1
    sec 'high' pulse and then changes back to low state until it is triggered
    again by the magnet. The timer's output controls transistors that affect
    the behaviour of a JK Flip Flop (for direction control of the motor, via a
    DPDT relay), and power for on/off of the motor.

    Because I need the JK Flip Flop to change the relay polarity *after* the
    motor stops for that 1 sec, I had to somehow invert the output from the 555
    so the JK would flip-flop at the right time. Instead of using a 4069
    inverter IC to do this, I connected up a couple of transistors with pull-up
    resistors to achieve this.

    The circuit works fine most of the time (like 80%), but it's unreliable, and
    I don't know what I can do to make it work properly every time. Most of the
    time the relay changes state 1 sec after motor stops (which is correct), but
    other times it does other wierd things, like the relay would act as if it's
    connected directly to the 555's output pin. Also, llthough very rare, the
    JK Flip Flop would even ignore the clock signals it receives and therefore
    the relay would do nothing - only the motor would stop for the 1 sec. Very
    annoying, being intermittent faults.

    I can forward a circuit schematic, but its too hard to draw in html format
    (it's a little too complex) to do. I have a proper schematic i could email
    though as a jpeg.

    Anyone have any ideas? I need this thing to be reliable. I may be doing
    something wrong?


  2. w2aew

    w2aew Guest


    Something simple to start with... Are you doing anything in your
    circuit to deal with the inductive kick-back voltage from the relay
    coil when de-energizing? How about the motor, are you doing anything
    to deal with the voltage it generates during spin-down? If not, these
    transient events can cause wacky things to happen.
  3. Rich Grise

    Rich Grise Guest

    Well, in addition to the bypassing and catch diodes that w2aew mentioned,
    I'd say, go ahead and post the schematic on
    ; I notice you're not posting from
    google, so I'm assuming you have a real newsserver and a real newsreader.
    Put something recognizable in the subject line, and call attention to it
    here, or even copy/paste the message ID.

    There are also free places where you can post an image, but you'd have to
    look them up.

    I'd really like to see this circuit, because it sounds like it could be
    simplified. One question: does this magnet go past some switch, which
    starts the "turn around" process, the motor coasts to a stop, the motor
    goes the other way, what happens when the magnet passes the switch again?

  4. Jason S

    Jason S Guest

    Thanks for the reply.
    Yes, I gathered it's something probably really basic, and you have a point
    there, relating to induction and motor voltages. The only thing I have
    connected to the relay is a diode in parallel to protect the switching
    transistor... I do not know of any other method to avoid kick backs.
    In relation to the motor, during testing, I did not have the motor connected
    at all, so the motor isn't the cause (at this stage anyway).
  5. Jason S

    Jason S Guest


    Hi Rich,

    Thanks for the reply.
    To answer your question about the magnet switching, the motor (or should I
    say 'Gearhead Motor', which spins maximum of 36RPM at the shaft) will be
    spinning slow enough that by the time it fully stops (which doesn't take
    long at all), the reed switch will still be magnetised. The magnet will be
    fairly powerful to keep it magnetized, and depends on what type of magnet I
    use and how. I think it won't be an issue for my project.... but it was a
    very good question =)
    Perhaps I should explain what sort of timer I am using and how the reed
    switch is connected to it? Well I am using a 555 timer IC configured as a
    monostable which self-triggers at power on. That is, when the timer circuit
    is powered up via the reed switch when magnetized, the output of the timer
    goes high for 1 sec, then goes low until power is reset.

    I've had a look at the schematics.electronic newsgroup, but are attachments
    allowed? I don't see too many of those so I'm a bit reluctant. Can I email
    it to you directly? It's so much easier to see the circuit rather than
    decsribe it right?

  6. John Fields

    John Fields Guest

    Why a couple? Just one should do it:

    [R] JK
    | +----
    555 | +----
    -----+ C
    OUT|--[R]---B NPN
    -----+ E

    If you're using a bipolar 555 you should bypass the voltage control
    input (pin 5) to ground with 0.01µF or so, and also the supply input
    (pin 8) with at least 0.1µF paralleled with a 1µF electrolytic per:

    Connect the supply bypass caps directly across pins 1 and 8.

    You may also have something going on with the reed switch bouncing.

    Can you post a schematic of your circuit and a little more detail
    about what happens when the reed switch switches? That is, does it
    stay made when the motor stops and then open when the motor reverses
    its rotation?
  7. Jason S

    Jason S Guest

    Hi John,
    You're right. This was fixed up just after I posted the original message,
    so don't worry about that. May end up using a 4069 anyway, otherwise just a
    single transistor =)
    Yes I've already got the voltage control pin 5 bypassed, but I'll check what
    value cap. I'll try the supply input bypass cap/s, as I currently don't
    have this connected.
    Not sure on that one... I've tried several different switching methods just
    to test it out (i.e. different switch types), and it doesn't seem to be the
    I am planning to do this, however the schematic is too hard for me to draw
    up in html format for posting on here.... i really don't have time to do
    that. I do, however, have a jpeg... just not sure where i can post it to
    without P Allison tellin me off!

  8. John Fields

    John Fields Guest

  9. Jason,

    I have a real problem in understanding the details of your circuit.
    (Although I understand very well what you want to achieve.) You can sent the
    ..JPEG to my address but you will have to remove the spamtrap which is in
    Dutch: laatditweg(at)enditook means: leavethisout(at)andthistoo.

    Meanwhile, the faults you describe are often caused by bad construction.
    Wires too long, no or insufficient decoupling, bad solderjoints and so on.
    Nothing to blame you. I learned it the hard way.

    Why do you need a JK flipflop? A D-type will do the same job unless you've
    something in your circuit I don't know about.

    Do you switch the polarity change-over and the power relay at he same time?
    May cause problems as electric current tend to be much faster than
    electromagnetic switches i.e. relay. :) I'd power the motor let's say 50ms
    after the switching of the change-over.

    One of the programs to draw ASCII circuits can be found:

    petrus bitbyter
  10. Rich Grise

    Rich Grise Guest

    Yes, posting attachments is what is for. (be sure it has the alt.binaries in front.) As long as the NG has
    "binaries" in the name, you can post anything you want to. (well, as long
    as the subject isn't illegal in your country. ;-) )

  11. Rich Grise

    Rich Grise Guest

    Actually, for a schematic (or any line art) it should be .gif format - it
    compresses line art better, and it's lossless. Jpegs are for photographs
    of natural stuff, and they use a lossy compression algorithm, which for a
    picture of a forest or a hot babe, or a hot babe in a forest, you eye can
    fill in a lot of detail. For schematics, that doesn't work as well, (they
    can get blurry) but RLE (.gif) is ideal. :)

  12. John Fields

    John Fields Guest

  13. Jason S

    Jason S Guest

    Hi guys,

    *** As requested, I have posted a schematic under
    alt.biniaries.schematics.electronic newsgroup (as an attachment).
    It will be titled: "Schematic ref 'sci.electronics.basics' thread dated
    6/6/06" ***

    Please continue to post under here and not the other newsgroup.

    John, I have added the two parallel caps directly across the 555's power
    supply (pins 1 and 8) as you suggested, and it *does* seem to work a lot
    better now... thank you.

    I accidentally blew a transistor that powers up the motor because the 1 sec
    delay didn't happen for some reason, where the motor was spinning in one
    direction, then all of a sudden it changed to the other direction without it
    stopping. The transistor fried. I was wondering if there is any way of
    preventing the transistor from getting damaged should this happen again.
    I'm not sure how to do this.

    Also I am pretty sure I am missing something around the motor ... diode?
    caps? I have very little experience with motors.

    I know you guys are probably asking yourselves why I did this and why didn't
    I do this, etc. but I am still learning. =) I only do this as a hobby.

    Thanks again
  14. Jason S

    Jason S Guest

    Hi there!
    Done. Refer to alt.binaries.schematics.electronic.

    I am using a breadboard for testing purposes at this stage, but yes, you're
    probably right about the long wires and stuff =)
    I am more familiar with JK flip flops, and don't know much at all about the
    A-D, that is why. Plus I have a few of the JK chips available at home.
    The motor spins in direction A. Power is shut down for 1 sec (in my case,
    this is enough time for it to fully stop). Relay contacts change over to
    change motor's polarity. At the same time motor is reactivated.
    I could, however, have another delay *after* the relay contacts change over,
    but this would be more complicated... not sure if it would be necessary??

  15. Jason S

    Jason S Guest

    no worries, thanks =)
  16. Rich Grise

    Rich Grise Guest

    True, and not yet. :)

    But, on Windows, Paint Shop Pro can convert image formats, and on Linux,
    The Gimp, so it's not all that hard. - it's shareware, but very
    old, but very good for what it does. :)

  17. John Fields

    John Fields Guest

  18. Nice but it does not appear on my screen. Nothing to blame you. My ISP,
    although claiming to be the best, apparently is not able to keep it's
    newsserver(s) fully up to date. For other newsgroups I go to the Google
    groups if I'm missing something but they don't do binaries.

    No, but that's one of the reasons I want to see the schematic. Generally, if
    you use the same signal to the change over relay and the power (transistor)
    the latter will be on before the former has changed. So your motor always
    get a (small) pulse in the wrong direction before it starts to turn in the
    right direction. This will do no good, even if it does not hurt. But the
    latter is not sure. Small pulses are known for causing disturbances that are
    difficult to trace. Moreover the change over relay will actually have to
    switch while current flows through the contacts. Which causes extra wear and
    petrus bitbyter
  19. Jason S

    Jason S Guest

    hmm, that's weird how you guys can't see the image. I am using Outlook
    Express and I am signed up for Newsgroups, if that makes sense. I'm not
    sure what I can do to help you see the image I posted =(

    I'll see what I can do. Maybe I'll make up a homepage through my ISP ??

  20. Jason S

    Jason S Guest

    OK, try this site:

    I might post some photos on there too if I have time, so that you get the
    idea of my project. But for now, I have only included the schematic. Let
    me know if it's successful or not =)

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day