Maker Pro
Maker Pro

Do I need some sort of delay between two latch circuits?

J

John Fields

Sorry. I am using two hall effect transducers to sense a magnet that
is mounted on a non-ferrous disc. It is important that the disc only
rotate in one direction. If the disc rotation reverses then an alarm
indicator needs to light up. The hall effect transducers pass a +5VDC
signal when the magnet passes them. If the disc itself were ferrous I
could just use a different kind of sensor entirely.
 
L

laylow

---
The circuit I posted for you won't work for that application.

I have a simple circuit that will, but how fast is the disc rotating
and how far apart are the sensors?

Why wouldn't it work? It seems simple enough. Anyway, the disc is
14' in diameter and rotates anywhere from 1/10th to 30 RPM. A strong
magnet is mounted on the outside edge of the disc. The sensors can be
mounted as far apart as needed but I prefer that they be as close as
possible.

LL
 
J

John Fields

Why wouldn't it work? It seems simple enough.

---
Too simple to do the job. :-(
---
Anyway, the disc is
14' in diameter and rotates anywhere from 1/10th to 30 RPM. A strong
magnet is mounted on the outside edge of the disc. The sensors can be
mounted as far apart as needed but I prefer that they be as close as
possible.

---
OK.

A 14' diameter disc rotating at 0.1 RPM will have its circumference
moving at a rate of 0.88 inches per second, so if your sensors were
spaced one inch apart it would take the magnet about 1.14 seconds to
get from one sensor to the next.

Here's the LTSPICE circuit list for something that'll do what you
want over the range of speeds you list:

Version 4
SHEET 1 2244 800
WIRE 352 -272 128 -272
WIRE 1104 -272 880 -272
WIRE 352 -224 352 -272
WIRE 1104 -224 1104 -272
WIRE 800 -208 480 -208
WIRE 976 -208 800 -208
WIRE 272 -176 -96 -176
WIRE 592 -176 432 -176
WIRE 976 -176 976 -208
WIRE 1024 -176 976 -176
WIRE 1248 -176 1184 -176
WIRE 272 -128 48 -128
WIRE 480 -128 480 -208
WIRE 480 -128 448 -128
WIRE 592 -128 592 -176
WIRE 800 -128 800 -208
WIRE 1024 -128 976 -128
WIRE 1248 -48 1248 -176
WIRE 256 -16 208 -16
WIRE 352 -16 352 -80
WIRE 352 -16 320 -16
WIRE 384 -16 352 -16
WIRE 592 -16 592 -48
WIRE 592 -16 448 -16
WIRE 208 32 208 -16
WIRE 1104 32 1104 -80
WIRE 1104 32 208 32
WIRE 592 64 592 -16
WIRE 688 64 592 64
WIRE -96 80 -96 -176
WIRE 48 80 48 -128
WIRE 208 80 208 32
WIRE 480 80 480 -128
WIRE 688 80 688 64
WIRE 976 80 976 -128
WIRE 592 96 592 64
WIRE 800 128 800 -48
WIRE 800 128 752 128
WIRE -96 208 -96 160
WIRE 48 208 48 160
WIRE 48 208 -96 208
WIRE 128 208 128 -272
WIRE 128 208 48 208
WIRE 208 208 208 160
WIRE 208 208 128 208
WIRE 480 208 480 160
WIRE 480 208 208 208
WIRE 592 208 592 160
WIRE 592 208 480 208
WIRE 688 208 688 176
WIRE 688 208 592 208
WIRE 880 208 880 -272
WIRE 880 208 688 208
WIRE 976 208 976 160
WIRE 976 208 880 208
WIRE 1248 208 1248 32
WIRE 1248 208 976 208
WIRE -96 288 -96 208
FLAG -96 288 0
SYMBOL voltage 48 64 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR Value PULSE(0 5 1 1E-6 1e-6 .1 2)
SYMATTR InstName V2
SYMBOL voltage -96 64 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR Value 5
SYMATTR InstName V1
SYMBOL res 576 -144 R0
WINDOW 0 -37 37 Left 0
WINDOW 3 -47 72 Left 0
SYMATTR InstName R1
SYMATTR Value 1e6
SYMBOL cap 576 96 R0
WINDOW 0 -37 33 Left 0
WINDOW 3 -48 63 Left 0
SYMATTR InstName C1
SYMATTR Value 1e-6
SYMBOL Digital\\dflop 352 -224 R0
WINDOW 0 28 -55 Left 0
SYMATTR InstName A1
SYMATTR SpiceLine trise 1e-6 tfall 1e-6 vhigh 5v
SYMBOL res 464 64 R0
WINDOW 0 -32 35 Left 0
WINDOW 3 -42 68 Left 0
SYMATTR InstName R2
SYMATTR Value 10k
SYMBOL Digital\\dflop 1104 -224 R0
WINDOW 0 30 -58 Left 0
SYMATTR InstName A2
SYMATTR SpiceLine trise 1e-6 tfall 1e-6 vhigh 5v
SYMBOL diode 448 -32 R90
WINDOW 0 0 32 VBottom 0
WINDOW 3 32 32 VTop 0
SYMATTR InstName D1
SYMBOL diode 256 0 R270
WINDOW 0 32 32 VTop 0
WINDOW 3 0 32 VBottom 0
SYMATTR InstName D2
SYMBOL voltage 208 64 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR Value PULSE(0 5 0 1E-6 1e-6 .1)
SYMATTR InstName V3
SYMBOL voltage 976 64 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR Value PULSE(0 5 2 1E-6 1e-6 .1 2)
SYMATTR InstName V4
SYMBOL res 1232 -64 R0
SYMATTR InstName R3
SYMATTR Value 10k
SYMBOL npn 752 80 M0
SYMATTR InstName Q1
SYMATTR Value 2N3904
SYMBOL res 784 -144 R0
WINDOW 0 -41 45 Left 0
WINDOW 3 -50 74 Left 0
SYMATTR InstName R4
SYMATTR Value 10K
TEXT -72 232 Left 0 !.tran 5
TEXT -80 264 Left 0 !.option noopiter
TEXT 216 168 Left 0 ;RESET
TEXT 64 168 Left 0 ;FWD
TEXT 984 168 Left 0 ;REV
TEXT 360 -248 Left 0 ;HC4013
TEXT 1112 -248 Left 0 ;HC4013

If you don't have LTSPICE you can get it at:

http://www.linear.com/designtools/software/#Spice

Do you need a circuit description?

Also, the question remains about how long you can wait to tell
whether the disk is rotating backwards or not.
 
J

John Fields

Here's the LTSPICE circuit list for something that'll do what you
want over the range of speeds you list:

---
Oops...

Don't let those CMOS inputs float when the diodes cut off!

Version 4
SHEET 1 2244 800
WIRE 352 -272 128 -272
WIRE 1104 -272 880 -272
WIRE 352 -224 352 -272
WIRE 1104 -224 1104 -272
WIRE 800 -208 480 -208
WIRE 976 -208 800 -208
WIRE 272 -176 -96 -176
WIRE 592 -176 432 -176
WIRE 976 -176 976 -208
WIRE 1024 -176 976 -176
WIRE 1248 -176 1184 -176
WIRE 272 -128 48 -128
WIRE 480 -128 480 -208
WIRE 480 -128 448 -128
WIRE 592 -128 592 -176
WIRE 800 -128 800 -208
WIRE 1024 -128 976 -128
WIRE 1248 -48 1248 -176
WIRE 240 -16 208 -16
WIRE 336 -16 304 -16
WIRE 352 -16 352 -80
WIRE 352 -16 336 -16
WIRE 384 -16 352 -16
WIRE 592 -16 592 -48
WIRE 592 -16 448 -16
WIRE 208 32 208 -16
WIRE 1104 32 1104 -80
WIRE 1104 32 208 32
WIRE 592 64 592 -16
WIRE 688 64 592 64
WIRE -96 80 -96 -176
WIRE 48 80 48 -128
WIRE 208 80 208 32
WIRE 336 80 336 -16
WIRE 480 80 480 -128
WIRE 688 80 688 64
WIRE 976 80 976 -128
WIRE 592 96 592 64
WIRE 800 128 800 -48
WIRE 800 128 752 128
WIRE -96 208 -96 160
WIRE 48 208 48 160
WIRE 48 208 -96 208
WIRE 128 208 128 -272
WIRE 128 208 48 208
WIRE 208 208 208 160
WIRE 208 208 128 208
WIRE 336 208 336 160
WIRE 336 208 208 208
WIRE 480 208 480 160
WIRE 480 208 336 208
WIRE 592 208 592 160
WIRE 592 208 480 208
WIRE 688 208 688 176
WIRE 688 208 592 208
WIRE 880 208 880 -272
WIRE 880 208 688 208
WIRE 976 208 976 160
WIRE 976 208 880 208
WIRE 1248 208 1248 32
WIRE 1248 208 976 208
WIRE -96 288 -96 208
FLAG -96 288 0
SYMBOL voltage 48 64 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR Value PULSE(0 5 1 1E-6 1e-6 .1 2)
SYMATTR InstName V2
SYMBOL voltage -96 64 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR Value 5
SYMATTR InstName V1
SYMBOL res 576 -144 R0
WINDOW 0 -37 37 Left 0
WINDOW 3 -47 72 Left 0
SYMATTR InstName R1
SYMATTR Value 1e6
SYMBOL cap 576 96 R0
WINDOW 0 -37 33 Left 0
WINDOW 3 -48 63 Left 0
SYMATTR InstName C1
SYMATTR Value 1e-6
SYMBOL Digital\\dflop 352 -224 R0
WINDOW 0 28 -55 Left 0
SYMATTR InstName A1
SYMATTR SpiceLine trise 1e-6 tfall 1e-6 vhigh 5v
SYMBOL res 464 64 R0
WINDOW 0 -32 35 Left 0
WINDOW 3 -42 68 Left 0
SYMATTR InstName R2
SYMATTR Value 10k
SYMBOL Digital\\dflop 1104 -224 R0
WINDOW 0 30 -58 Left 0
SYMATTR InstName A2
SYMATTR SpiceLine trise 1e-6 tfall 1e-6 vhigh 5v
SYMBOL diode 448 -32 R90
WINDOW 0 0 32 VBottom 0
WINDOW 3 32 32 VTop 0
SYMATTR InstName D1
SYMATTR Value 1N4148
SYMBOL diode 240 0 R270
WINDOW 0 32 32 VTop 0
WINDOW 3 0 32 VBottom 0
SYMATTR InstName D2
SYMATTR Value 1N4148
SYMBOL voltage 208 64 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR Value PULSE(0 5 0 1E-6 1e-6 .1)
SYMATTR InstName V3
SYMBOL voltage 976 64 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR Value PULSE(0 5 2 1E-6 1e-6 .1 2)
SYMATTR InstName V4
SYMBOL res 1232 -64 R0
SYMATTR InstName R3
SYMATTR Value 10k
SYMBOL npn 752 80 M0
SYMATTR InstName Q1
SYMATTR Value 2N3904
SYMBOL res 784 -144 R0
WINDOW 0 -41 45 Left 0
WINDOW 3 -50 74 Left 0
SYMATTR InstName R4
SYMATTR Value 10K
SYMBOL res 320 64 R0
WINDOW 0 41 39 Left 0
WINDOW 3 34 73 Left 0
SYMATTR InstName R5
SYMATTR Value 10e6
TEXT -72 232 Left 0 !.tran 5
TEXT -80 264 Left 0 !.option noopiter
TEXT 216 168 Left 0 ;RESET
TEXT 64 168 Left 0 ;FWD
TEXT 984 168 Left 0 ;REV
TEXT 360 -248 Left 0 ;HC4013
TEXT 1112 -248 Left 0 ;HC4013
 
L

laylow

---
Oops...

Don't let those CMOS inputs float when the diodes cut off!

Version 4
SHEET 1 2244 800
WIRE 352 -272 128 -272
WIRE 1104 -272 880 -272
WIRE 352 -224 352 -272
WIRE 1104 -224 1104 -272
WIRE 800 -208 480 -208
WIRE 976 -208 800 -208
WIRE 272 -176 -96 -176
WIRE 592 -176 432 -176
WIRE 976 -176 976 -208
WIRE 1024 -176 976 -176
WIRE 1248 -176 1184 -176
WIRE 272 -128 48 -128
WIRE 480 -128 480 -208
WIRE 480 -128 448 -128
WIRE 592 -128 592 -176
WIRE 800 -128 800 -208
WIRE 1024 -128 976 -128
WIRE 1248 -48 1248 -176
WIRE 240 -16 208 -16
WIRE 336 -16 304 -16
WIRE 352 -16 352 -80
WIRE 352 -16 336 -16
WIRE 384 -16 352 -16
WIRE 592 -16 592 -48
WIRE 592 -16 448 -16
WIRE 208 32 208 -16
WIRE 1104 32 1104 -80
WIRE 1104 32 208 32
WIRE 592 64 592 -16
WIRE 688 64 592 64
WIRE -96 80 -96 -176
WIRE 48 80 48 -128
WIRE 208 80 208 32
WIRE 336 80 336 -16
WIRE 480 80 480 -128
WIRE 688 80 688 64
WIRE 976 80 976 -128
WIRE 592 96 592 64
WIRE 800 128 800 -48
WIRE 800 128 752 128
WIRE -96 208 -96 160
WIRE 48 208 48 160
WIRE 48 208 -96 208
WIRE 128 208 128 -272
WIRE 128 208 48 208
WIRE 208 208 208 160
WIRE 208 208 128 208
WIRE 336 208 336 160
WIRE 336 208 208 208
WIRE 480 208 480 160
WIRE 480 208 336 208
WIRE 592 208 592 160
WIRE 592 208 480 208
WIRE 688 208 688 176
WIRE 688 208 592 208
WIRE 880 208 880 -272
WIRE 880 208 688 208
WIRE 976 208 976 160
WIRE 976 208 880 208
WIRE 1248 208 1248 32
WIRE 1248 208 976 208
WIRE -96 288 -96 208
FLAG -96 288 0
SYMBOL voltage 48 64 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR Value PULSE(0 5 1 1E-6 1e-6 .1 2)
SYMATTR InstName V2
SYMBOL voltage -96 64 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR Value 5
SYMATTR InstName V1
SYMBOL res 576 -144 R0
WINDOW 0 -37 37 Left 0
WINDOW 3 -47 72 Left 0
SYMATTR InstName R1
SYMATTR Value 1e6
SYMBOL cap 576 96 R0
WINDOW 0 -37 33 Left 0
WINDOW 3 -48 63 Left 0
SYMATTR InstName C1
SYMATTR Value 1e-6
SYMBOL Digital\\dflop 352 -224 R0
WINDOW 0 28 -55 Left 0
SYMATTR InstName A1
SYMATTR SpiceLine trise 1e-6 tfall 1e-6 vhigh 5v
SYMBOL res 464 64 R0
WINDOW 0 -32 35 Left 0
WINDOW 3 -42 68 Left 0
SYMATTR InstName R2
SYMATTR Value 10k
SYMBOL Digital\\dflop 1104 -224 R0
WINDOW 0 30 -58 Left 0
SYMATTR InstName A2
SYMATTR SpiceLine trise 1e-6 tfall 1e-6 vhigh 5v
SYMBOL diode 448 -32 R90
WINDOW 0 0 32 VBottom 0
WINDOW 3 32 32 VTop 0
SYMATTR InstName D1
SYMATTR Value 1N4148
SYMBOL diode 240 0 R270
WINDOW 0 32 32 VTop 0
WINDOW 3 0 32 VBottom 0
SYMATTR InstName D2
SYMATTR Value 1N4148
SYMBOL voltage 208 64 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR Value PULSE(0 5 0 1E-6 1e-6 .1)
SYMATTR InstName V3
SYMBOL voltage 976 64 R0
WINDOW 3 24 104 Invisible 0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR Value PULSE(0 5 2 1E-6 1e-6 .1 2)
SYMATTR InstName V4
SYMBOL res 1232 -64 R0
SYMATTR InstName R3
SYMATTR Value 10k
SYMBOL npn 752 80 M0
SYMATTR InstName Q1
SYMATTR Value 2N3904
SYMBOL res 784 -144 R0
WINDOW 0 -41 45 Left 0
WINDOW 3 -50 74 Left 0
SYMATTR InstName R4
SYMATTR Value 10K
SYMBOL res 320 64 R0
WINDOW 0 41 39 Left 0
WINDOW 3 34 73 Left 0
SYMATTR InstName R5
SYMATTR Value 10e6
TEXT -72 232 Left 0 !.tran 5
TEXT -80 264 Left 0 !.option noopiter
TEXT 216 168 Left 0 ;RESET
TEXT 64 168 Left 0 ;FWD
TEXT 984 168 Left 0 ;REV
TEXT 360 -248 Left 0 ;HC4013
TEXT 1112 -248 Left 0 ;HC4013

Well, that looks like it will work. I don't know if I ever would have
been able to come up with it. This is a circuit that you already
had? What was it for? I still wish I knew what was wrong with the
other circuit. I suppose I wouldn't find out without breadboarding it
first.

So just to be sure I have things straight, V1 is the 5V supply, V2
simulates the first hall sensor, V3 is a manual push button reset, and
V4 is the second hall sensor. The pulse from V2 causes A1Q to go hi
which starts to charge C1. I'm not sure what happens next with C1. I
suppose it just slows the signal that will clear A1. When A1 clears
then A1Q| goes hi so that A2Q will go hi when V4 sends its signal. I
guess it also shorts C1 to ensure that A1 doesn't somehow clear (I
never would have guessed that that was something that needed to be
done). Anyway, A2Q goes hi and then from what I can tell it stays
hi. The next time A1 receives a pulse both A1Q and A2Q will be hi at
the same time giving me an error. I suppose the circuitry from A1
could be repeated on A2 so that A2Q can go lo again. Is that how it's
supposed to work or am I looking at this wrong?

Nice catch on the floating input. I don't know if I ever would've
seen that. I would've just assumed it was alright since there were
wires connected to all the inputs.

Let's see... I just tried adding the circuitry to reset A2 but that
doesn't give me what I need either because then it wouldn't trip in
reverse. I suppose I could change the value of C2 so that A2Q stays
hi longer. I don't know, I'm pretty tired. Maybe the circuit is fine
and I just don't know how it's used. Or maybe you're waiting for me
to tell you how long we can wait while the disc rotates backwards.
Well, the sooner the better of course but I could allow the disc to
spin in reverse for 3 revolutions before having to send an alarm.

Thanks for all the help.

LL
 
J

John Fields

Well, that looks like it will work. I don't know if I ever would have
been able to come up with it. This is a circuit that you already
had?

---
No, I designed it for you.
---
What was it for? I still wish I knew what was wrong with the
other circuit. I suppose I wouldn't find out without breadboarding it
first.

---
Just simulate it. That's easier than having to explain it. ;)
---
So just to be sure I have things straight, V1 is the 5V supply, V2
simulates the first hall sensor, V3 is a manual push button reset, and
V4 is the second hall sensor. The pulse from V2 causes A1Q to go hi
which starts to charge C1. I'm not sure what happens next with C1. I
suppose it just slows the signal that will clear A1. When A1 clears
then A1Q| goes hi so that A2Q will go hi when V4 sends its signal. I
guess it also shorts C1 to ensure that A1 doesn't somehow clear (I
never would have guessed that that was something that needed to be
done). Anyway, A2Q goes hi and then from what I can tell it stays
hi. The next time A1 receives a pulse both A1Q and A2Q will be hi at
the same time giving me an error. I suppose the circuitry from A1
could be repeated on A2 so that A2Q can go lo again. Is that how it's
supposed to work or am I looking at this wrong?

---
Kinda...

What's supposed to happen is that the pulse from the first sensor
starts A1, which is a monostable multivibrator, and then if the
pulse from the second sensor happens before A1 times out, A2 Q will
stay low. However, if the disk is spinning backwards the signal
from the second sensor will occur before the signal from the first
one does and, since A2 D will be high under those conditions, A2 Q
will go high when the pulse from the second sensor occurs, signaling
the alarm.

In a little more detail... When V3 goes high momentarily, both A1
and A2 are reset. Thereafter, a pulse from V2 will cause A1 Q to go
high, charging C1 through R1 and causing the voltage at A1 CLR to
become more and more positive as time goes by.

Eventually the voltage on A1 CLR will rise to the point where it
will reset A1, and at that point A1 Q will go low and A1 \Q will go
high until the wheel completes another revolution and V2 generates
another pulse.

When \Q goes high it turns on Q1, which quickly discharges C1 and
also drives A2 D high. With A2 D high, if a pulse is received from
V4, A2 Q (the alarm signal) will be driven high, indicating that the
disk is rotating in the wrong direction.

The reasoning behind that is that if the disk was going in the right
direction, the pulse from V4 would occur while A1 was timing out
(while A1 \Q was low) and A2 D would be low, keeping A2 Q low.
---
Nice catch on the floating input. I don't know if I ever would've
seen that. I would've just assumed it was alright since there were
wires connected to all the inputs.
---
:)
---

Let's see... I just tried adding the circuitry to reset A2 but that
doesn't give me what I need either because then it wouldn't trip in
reverse. I suppose I could change the value of C2 so that A2Q stays
hi longer. I don't know, I'm pretty tired. Maybe the circuit is fine
and I just don't know how it's used. Or maybe you're waiting for me
to tell you how long we can wait while the disc rotates backwards.
Well, the sooner the better of course but I could allow the disc to
spin in reverse for 3 revolutions before having to send an alarm.

---
You shouldn't have to add anything to the circuit and, as shown, the
alarm will trip with less than one reverse revolution of the wheel
at any speed.
 
R

Rich Grise

Yes, except I was trying to stay away from using a clock.

I was only using the term "clock" in the sense of "the pulse that sets
(or resets) the latch". :)

Albeit, given your latest revelation(s), a clocked circuit could go
a long way here. :)

Cheers!
Rich
 
Top