I use CD4013BE for my design and I am having these questions, please help:
I use only half of the CD4013BE:
Pin 1: Q
Pin 2: Q_bar
Pin 7 and Pin 14: GND and VDD +12VDC respectively
Pin 3: Clock
Pin 5: Data
Pin 4, Pin 6: Tied to GND
The output Pin 1 Q and Pin 2 Q_bar is tied to my circuit consisting of a simple 2N3906 transistor. The base of the transistor I put a 22KOhm between the output pins (1 for Q and 2 for Q_bar), the Emitter of the 2N3906 is tied to a 10Kohm to GND. The collector of 2N3906 is connected to an red LED with about 1KOhm resistor to VCC. What I want to do is when ever the output of Pin 1 Q is set, the LED is ON telling me something, for example something that is wrong. The same is for Q_bar output, if the 2N3906 circuit turn on my other green LED, I know everything is normal. In general, my circuit works but i see intermittent sometimes. What is mean by "intermittent" is that sometimes both of the LED blinks which I can not tell whether or not something is wrong or right. The CLOCK input to Pin 3 of the CD4013BE is from a rotating disc (wheel) and an Optical Slot (interrupter) to detect the revolution of my small DC motor when ever the wheel passes by the Optical slot hence giving me the CLOCK signal. The DATA pin 5 is from my other input signal I want to compare.
Should the IC's all other pins be tied to GND too? The problem I have is intermittent. I sometimes see the Output of Q and Q_bar on at the same time but they are not supposed to be. Is that could be my timing between the CLK and DATA or no?. Please help and any suggestion to improve my circuit is appreciated.