Author Topic: Can someone please make me a circuit using a 4013b d flipflop to do the followin  (Read 1750 times)

0 Members and 1 Guest are viewing this topic.

Offline AstaldoathTopic starter

  • Contributor
  • Posts: 31
  • Country: us
All i need is for it to turn a momentary push button in to a latching switch. No matter what I try I cant get it to work. Ive tried a ton of tutorials ive found online, none work.  Im using a 9v as my power supply also, its all I have.


I just want 1 single button, press once, turns the led on, press again it turns it off. If possible with switch debounce.

Im trying to do this in hardware, in arduino ive done it already but I need to make it very compact, as compact as possible.

The only chip I have right now is the 4013b from my radio shack kit which is a d flip flop and I have read it can be set up just like the 555 push button circuit but without
much parasitic draw (which is a problem for me because of batteries) I may end up using LI PO or Li Ion  later on but I dont have any nor the battery holder with the leads and I have no money at the moment. I have various resistors, leds, some Capacitors, mostly electrolitic, some ceramic. A few diodes (not sure what specs) I do have 1 relay left also one I tore apart to see how it worked lol.


Please guys this problem is making me feel worthless that I cant figure out this simple problem in hardware. Im about to sell my meter, my soldering iron and all my arduino kits because I feel like an utter failure. If anyone could help Id appreciate it. Im not great at reading schematics, i mean I think I can do it correctly. If you could take a picture of it built that would help out also. If anyone does this I thank you so much and I will be so greatful.
 

Online Tom45

  • Frequent Contributor
  • **
  • Posts: 556
  • Country: us
What are you using for the input to the D flipflop CLK input? Do you have Q' connected to the D input? Have you put a meter on the Q output?
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
This works, built and tested just now.

(I googled "4013 latching switch circuit" and looked at the Images and found one that I understood, used 9V and used components I had to hand.)

« Last Edit: October 29, 2018, 03:10:40 am by alsetalokin4017 »
The easiest person to fool is yourself. -- Richard Feynman
 

Offline bson

  • Supporter
  • ****
  • Posts: 2497
  • Country: us
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
As we can see there are many ways to skin a cat, and they are all the same, in principle.

In the schematic I posted, Q1 can be just about any NPN, and D1 can be just about any small signal diode like 1n914 or whatever. Using the Q1 transistor allows higher current LEDs or other downstream devices.

And of course it's good practice to tie the unused CLK to ground, as well as putting in a decoupling cap across the chip's power pins. I did neither of these on my breadboard and the circuit worked fine nevertheless.
The easiest person to fool is yourself. -- Richard Feynman
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
The circuit I posted starts with the LED on when power is first applied. Bson's circuit starts with the LED off, but I think it needs more debouncing, at least on my breadboard I get occasional false triggering. Also with Bson's circuit the LED changes state when the button is released after being pressed, not when pressed.
« Last Edit: October 29, 2018, 04:19:42 am by alsetalokin4017 »
The easiest person to fool is yourself. -- Richard Feynman
 

Offline basinstreetdesign

  • Frequent Contributor
  • **
  • Posts: 466
  • Country: ca
So the problem is that the switch supplies very dirty edges.  After trying several schemes involving both FFs in the package I settled on the following.  It's the same basic strategy as you guys have offered but with a mod.  That is that the FF is prevented from changing state more than once, once it has been clocked - regardless of whether the Q output went high or low.  The RC networks on the Clear and Set inputs provide a 50 mS pulse on to those inputs to hold the FF in the selected state when a transition occurs.  On negative edges of the outputs I will rely on the internal clamp diodes to hold the Set and Clear to ground.  It should work but I cant breadboard it now.

If you need to make sure that the LED is off at power up then an additional RC from VDD to the R input will take care of that.  But that R should be >> 100K.

EDIT:  OOPS, I just realized that this circuit doesn't protect from fuzzy voltage at the clock pin as the clock signal falls when you take your finger off the switch.  Oh well.
« Last Edit: October 29, 2018, 06:23:25 am by basinstreetdesign »
STAND BACK!  I'm going to try SCIENCE!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf