Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

cd4027 latch (help needed)

Status
Not open for further replies.

naren

New Member
When the "ON/OFF" button is pressed once, the equipment goes on and stays on. It goes off when the button is pressed again. The circuit is straight forward. It uses a JK CMOS FlipFlop to with its JK terminals tied high to achieve the toggling action. The clock is provided by the push button used for on/off action. The resistor and the capacitor near the on/off switch debounces the contacts.
Note that when the circuit is switched on, the relay may land in a on or off state. It can be brought to the off state by pressing the RESET button.

I have tried the circuit in the attachment using electrolytic capacitor, but it is not working. Pls advice if anyone could help me or if there is any other simpler circuit out there.

Thanks

naren
 

Attachments

  • 1_137.gif
    1_137.gif
    5.7 KB · Views: 2,473
  • 1_135.gif
    1_135.gif
    5.7 KB · Views: 2,530
  • 1_107.gif
    1_107.gif
    5.7 KB · Views: 4,252
I see several problems:

1. The maximum allowable clock risetime is 10 usec. Your risetime is nearly 50 msec. You need two Schmitt triggers (CD40106) between your debouncer and the 4027 clock pin.

2. Reset is a logic high level. If you have a normally open switch as shown, you need to connect the switch between +9v and the reset pin. Add a 47k pull down resistor between the reset pin and gnd. If your switch is normally closed, you can leave it where it is, but you still need to add a 47k resistor from the reset pin to +9v.

3. For minimum dissipation, tie all unused INPUT pins on the unused flip-flop to gnd.

4. You need more base drive for your transistor. As drawn, you have less than a milliamp of base drive (remember that the 4027 Q output has some internal resistance). The SL100 has a minimum beta of 40, and this is with a Vce of 10 volts. Beta at saturation (Vce<0.5v or so) will be considerably less. A good rule of thumb is to make Ic/Ib=10. This is very conservative, so you can probably get away with a 1k resistor in the base in place of the 8.2k.

5. Add a 1N4001 diode across the relay coil, cathode to +9v. This will protect the transistor from breakdown due to the flyback pulse from the relay coil that will occur when the transistor turns off.
 
If you just need a momentary pushbutton circuit for turning a relay on and off, theres a far simpler way. You can use a simple SR flip-flop circuit, like the one below. This one uses a 7400 but just about any inverting logic gate IC will do such as a 7401,7402,7403 etc.

**broken link removed**
 
You can't make a S/R latch out of noninverting gates such as 7408 and 7411. You can use NOR gates (7402), but the polarities of set and reset must be inverted (input must go high to initiate state change).
Input pull up resistors are a must on CMOS gates controlled by switches. They are recommended for bipolar (74LS00, 7400, 74F00, etc.), but not absolutely necessary for low noise environments.
 
You can't make a S/R latch out of noninverting gates such as 7408 and 7411.

Ive never tried using AND gates in a flip-flop circuit before, i read in a post somewhere that they would work. So i just bread boarded a flip-flop circuit using a 7408 IC to find out for sure and yep, your right Ron , AND gates DO NOT work as flip-flops.

Thanx for the info Ron...noted and fixed.




Input pull up resistors are a must on CMOS gates controlled by switches. They are recommended for bipolar (74LS00, 7400, 74F00, etc.), but not absolutely necessary for low noise environments.

I agree. Yes I usually put pull-up resistors on the inputs (set/reset) but it didnt seem to make much difference in this simple setup, so i left them out just for clarity.
 
i would agree that that reset is floating, but you do not need and schmitt trigger because the JK has a schmitt on the inputs. And if he used that SR latch that would not toggle at all :?:
 
e said:
i would agree that that reset is floating, but you do not need and schmitt trigger because the JK has a schmitt on the inputs. And if he used that SR latch that would not toggle at all :?:

I looked at CD4027 datasheets from 3 different manufacturers, and none mentioned Schmitt trigger inputs. In fact, the maximum clock risetime for a 10 volt supply was 5 usec for 2 of them and 10 usec for the other. This is why I said a Schmitt was needed. Of course, there are other types of Schmitt triggers and even other types of debouncers that could be used.

And you're correct about the cross-coupled NAND latch. It's not a toggle FF, because it requires 2 inputs.

The Reset switch seems redundant to me. You can accomplish the same thing by pressing the Toggle switch. If you want a POWER ON reset, replace the reset switch with a resistor and connect a cap from the Reset pin to +9v. The time constant of this RC combination needs to be considerably longer than the risetime of the power supply voltage.
 
opps your right i was looking at the HEF family http://www.philipslogic.com/products/hef/pdf/hef4027b.pdf[/url]
and it states: "Schmitt trigger action in the clock input makes the circuit highly tolerant to slower clock rise and fall times."

I agree i think the reset switch is worthless, why not just put a cap there to reset it upon power up no matter what?

I built this exact type of circuit a few weeks ago to toggle a relay, and it works just perfectly, no problems with the rise and fall times as long as it is debounced well.
 
urgent

i am a beginner in the world of electronics. i want to work on a project in which i will use the CD4027 to sustain the output signal over a certain amount of time. could you please send me a schematic of how to interface the ff with my circuits. i need this as soon as possible
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top