Maker Pro
Maker Pro

Need help with intermittent circuit failures - JK Flip Flops

J

Jason S

Hi,

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?

Thanks,

Jason.
 
W

w2aew

Jason said:
Hi,

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?

Thanks,

Jason.

Jason,

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.
 
R

Rich Grise

Hi,

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?

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?

Thanks,
Rich
 
J

Jason S

w2aew said:
Jason,

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.

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).
 
J

Jason S

[snip]
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?

Thanks,
Rich


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?

Thanks,
Jason.
 
J

John Fields

---
Why a couple? Just one should do it:


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

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).

---
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:

http://web.mit.edu/6.s28/www/datasheets/LM555.pdf

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?
 
J

Jason S

[snip]
---
Why a couple? Just one should do it:


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

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 =)
---
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:

http://web.mit.edu/6.s28/www/datasheets/LM555.pdf <<<<< what page??

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

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.
You may also have something going on with the reed switch bouncing.

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
cause.
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?

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!

Jason.
 
J

John Fields

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!
 
P

petrus bitbyter

Jason S said:
Hi,

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?

Thanks,

Jason.

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:
www.tech-chat.de

petrus bitbyter
 
R

Rich Grise

[snip] (Rich Grise wrote:)
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?

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?

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. ;-) )

Cheers!
Rich
 
R

Rich Grise

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. :)

Cheers!
Rich
 
J

John Fields

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. :)
 
J

Jason S

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
Jason.
 
J

Jason S

[snip]
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.
Hi there!
Done. Refer to alt.binaries.schematics.electronic.

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.
I am using a breadboard for testing purposes at this stage, but yes, you're
probably right about the long wires and stuff =)
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.
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.
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.
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??

Thanks.
Jason.
 
J

Jason S

Rich Grise said:
[snip] (Rich Grise wrote:)
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?

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?

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. ;-) )

Cheers!
Rich

no worries, thanks =)
 
R

Rich Grise

Actually, since he _has_ a jpeg available and we don't know whether
or not he can convert it, I'd advise him to just go ahead and post
it and see what happens. It's not like losing a little detail is
going to matter anyway; can't you see the circuit in your head?

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.
http://www.abiengr.com/~sysop/Share/PSP412.EXE - it's shareware, but very
old, but very good for what it does. :)

Thanks!
Rich
 
J

John Fields

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" ***
 
P

petrus bitbyter

Jason S said:
[snip]
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.
Hi there!
Done. Refer to alt.binaries.schematics.electronic.

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.

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??

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
tear,
Thanks.
Jason.

petrus bitbyter
 
J

Jason S

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 ??

Cheers,
Jason.
 
J

Jason S

Jason S said:
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 ??

Cheers,
Jason.

OK, try this site: http://www.jason3712.zoomshare.com/

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 =)

Jason.
 
Top