Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How do I trigger a flip-flop properly?

Status
Not open for further replies.

Plecto

Full Member level 5
Joined
Jan 4, 2012
Messages
315
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
4,979
Hi. I'm trying to have a comparator (set as a schmitt trigger) trigger a d flip-flop. The flip-flop is configured in such a way that it toggles and and it works great if I connect it to a 555 timer. My schmitt trigger also works fine, it turns a LED on and off as it's supposed to do, but the flip-flop and schmitt trigger isn't getting along. The schmitt triggers the flip-flop as it self see fit, so I'm guessing that the rising and falling edges of the clock isn't steep enough for it to trigger properly. So how can a 555 timer do the job, but not a comparator? The comparator is a LM393N and the flip-flop is a CD4013. There is also a 3k pull-up resistor from the output of the comparator to +V. Here's a video. The blue led is the clock of the flip-flop and the green led is the output of the flip-flop. Light=HIGH, no light=LOW.

https://tinypic.com/player.php?v=b8a91x&s=6
 

I wonder how you drive a LED from the comparator output and keeping a sufficient high level at the same time? Without a schematic that shows all component values it's hard to know.
 

Here's a schematic:
https://www.circuitlab.com/circuit/b9r3v3/nimh-fast-charger/

I tried removing the LED from the output of the comparator and it seems to work better, but still not ideal. It some times triggers when it should, other it doesn't. Some times I can also see it blink, like it triggers on and off real fast (even though it isn't supposed to).
 

The circuit should basically work. The slow rising edge of comaparator output may be a problem, also power supply ringing.
I would try two things:
- Reducing the 3k pull-up to 1k or even 470 ohm.
- Add power supply bypass capacitors near to comaparator and FF
- You could also increase the comparator hysteresis for test, in case the comparator is picking up hum and other interferences.
 

My power supply is a 9V battery so I guess there should be very little ripple. I tried what you said. I added 0.1uF caps from the +V pin of both the flip-flop and comparator to ground, I reduced the pull-up resistor from the output of the comparator to first 1k and then 470Ohm and I increased R2 from 5.1k to 10k. None of this made any different. One thing to mention though, I have a LED connected to the output of the flip-flop and sometimes it will start glowing a little dimmed down, but only for a very short moment (like a transition period).
 

I noticed the "glowing" thing from the start. It looks to me like the comparator is running wild, sending a burst of pulses. But there are different ways to achieve it, all are more or less related to bread board layout or weak power supply. Floating inputs of the CMOS FF could be another point. The schematic isn't complete, unfortunately.

Connecting all unused CMOS inputs to a defined voltage (GND or VCC) would be a good standard.

As a last suggestion, you can try to place a filter capacitor between comparator - input and ground. The Voltage divider has rather high impedance.
 

I'm using a dual flip-flop, are you saying that it's wise to connect Q, NOT_Q, clock, SET and RESET from the unused flip-flop to ground? If this is likely a bread board issue I could just try and solder this together and perhaps and a filter cap between comparator inputs and ground later if it still doesn't work. Yes my voltage dividers has a high impedance, I was thinking that the input impdedance of my comparator was so huge that this wouldn't matter, but I'd be happy to lower the impedance. I have resistors in all sizes aswell as a 10k thermistor aswell :)
 

A likely possibility is noise from the potentiometer as you adjust it. Pots can give a small erratic change in resistance or even open for a fraction of a second due to the wiper moving over the surface of the resistive track. That could cause your comparator output to change several times as you adjust the pot. A small capacitor across R1 will prevent the comparator from responding to multiple rapid input changes without affecting the risetime of the output transition.

Edit: The capacitor is only needed when you are testing the circuit by adjusting the pot. You should not have the problem when the thermistor is changing resistance due to a temperature change.
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top