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.

latch, toggle circuit

Status
Not open for further replies.

harps

Member
hello

i have built this circuit below , it is a latch circuit , if the user clicks the button, the 555 timer goes on, and then with a second clik of the same button the 555 timer goes off.

https://www.flickr.com/photos/todbot/4368987730/

it works well , but i am trying to replace the button with a transistor or an optoisolator so that i can trigger the latch from a short pulse logic 1. a mechanical relay may work but is a bit large for my project, i was hoping for a smaller cheaper solution.

For some reason when the button is replaced with a transistor or opto isolator , it does not work?

any ideas on this would be great,

thanks : )
 
Last edited:
Unless you are driving a very heavy load, there are simpler ways of making a toggle flip-flop, if you have a clean logic input. The beauty of the 555 circuit is that it is totally immune to normal switch bounce. If your input doesn't have bounce, a D or JK flip-flop is simpler.
 
Unless you are driving a very heavy load, there are simpler ways of making a toggle flip-flop, if you have a clean logic input. The beauty of the 555 circuit is that it is totally immune to normal switch bounce. If your input doesn't have bounce, a D or JK flip-flop is simpler.

thanks , i was looking at the circuit in the first post because it has just one button to latch on/ off. the jk and D that i have seen, appear to have 2 buttons. one for on and one for off.

i am just driving an led on the output. so no heavy loads.

I hopes there is a simpler circuit though : )
 
thanks , i was looking at the circuit in the first post because it has just one button to latch on/ off. the jk and D that i have seen, appear to have 2 buttons. one for on and one for off.

i am just driving an led on the output. so no heavy loads.

I hopes there is a simpler circuit though : )
Where is your pulse coming from? What are the low and high voltage levels?
I can show you how to use it to toggle a D or JK FF.
 
thanks

it is a very short logic one , from a multiplexer circuit.

the anode and cathode come on very breifly ,and needs to latch only wehn both the correct anode cathode are triggered.
because sometimes just the anode is triggered, and sometimes just the cathode. as multiplexers do.


I have a working circuit , but it is a little large just to toggle on. maybe it could be simplified with thge idea you suggest?

As for voltages i use a 5v regulator and a transistor for each lane/colum. with a current limiting resistor for each colum/lane also.
: )
 
Last edited:
Here are two ways to do it. Note that each part has two flip-flops, so you will have a spare. All unused inputs (not outputs) need to be connected to ground.
If you use CD4013, connect pin 14 to vcc (+5V) and pin 7 to ground.
If you use CD4027, connect pin 16 to vcc (+5V) and pin 8 to ground.
Connect a 100nF ceramic cap from vcc to GND, as close to the IC as you can get it.
To drive an LED, add an NPN such as 2N3904 or PN2222, with a base current limiting resistor and an LED current limiting resistor. Set Ib≈Ic/10. Rb≈(vcc-0.7)/Ib.
 
Last edited:
thanks canadaelk,
thank you also Roff

Roff, great, so half a flip flop is used to create the latch effect. : ) all inside a nice ic. thanks buddy i shall give it try : P
 
hi Roff : )

I got hold of some CD4013BEE4 flip flops from RS components found here:

https://uk.rs-online.com/web/p/flip-flop/7091968/?searchTerm=709-1968&relevancy-data=636F3D3126696E3D4931384E525353746F636B4E756D6265724D504E266C753D656E266D6D3D6D61746368616C6C26706D3D5E5C647B337D5B5C732D2F255C2E5D5C647B332C347D2426706F3D313426736E3D592673743D52535F53544F434B5F4E554D424552267573743D3730392D313936382677633D4E4F4E4526

i am using a 5v regulator to power it all with a 470uf cap and a 1uf cap on to smooth things out

i then built this circuit which i think is just like the one your describe ( i may be wrong as im still a beginner)
View attachment 62935

i placed an led on each output with a resistor of the first flip flop, just so i could see what was happening.

i find with this, that when i turn on the flip flop, it starts at one output then i apply some logic 1 and then it flips over to the other output , but then it wont go back , unless i power the IC down for about 4-5 seconds and back on again.

i tried a .1uf cap close to VCC but to no avail. i also have a few of these, so i double checked i didnt blow anything with another fresh IC.

perhaps its the model i have? might be slightly diffrent to the IC you had in mind.

any help would be cool. : )
 
Last edited:
my bad... i did not read the OP fully

Your 4013 is configured correctly, however, I am not sure what you have going on with the clock input? That is likely the problem.

Early on Ron mentioned:

Unless you are driving a very heavy load, there are simpler ways of making a toggle flip-flop, if you have a clean logic input. The beauty of the 555 circuit is that it is totally immune to normal switch bounce. If your input doesn't have bounce, a D or JK flip-flop is simpler.

That was good advice and right on target. You mentioned:

it is a very short logic one , from a multiplexer circuit.

Now if you have very clean pulses from a good 5 volt source the circuit you posted will work fine feeding the clock input of the 4013 directly. However, as drawn using a push button to clock the 4013 you will have switch bounce. It looks like you are trying to eliminate switch bounce with the capacitor and resistors you have out there. The 10K resistor really isn't doing anything? Not that I can see. If the circuit is to do what you want using a push button and not as you mentioned earlier the clock input will need a good debounce circuit out there.

Using the 4013 configured as it is you actually have a divide by 2 circuit. Push the button and for each push the 4013 Q output will toggle. So it looks like the 4013 is configured correctly, however, depending on what you want the clock in needs work.

Ron
 
hi, im a bit amature at all this, for the original 555 circuit i was just touching two wires together to opperate the flip flop ( whilst i was testing having some fun)

so agian for the 4013 for testing the circuit i was again just touching two wires together (5v and the junction where the 10k and 100k are), i wasnt even using a switch. so do you think this is the problem?

i shall try an output from my micro contorller : )
 
Just touching two wires together will, like switch bounce, probably produce a series of rapid pulses instead of the intended single pulse. As a result the flip-flop toggles repeatedly and its ouput state is unpredictable.
 
when i touched the wires it would toggle once , then when i touch the wires again , nothing, not a flckier, no matter how fast or slow i hold the wires or flick them , only when i reset would it flop back, then when i touch thw wires it would flip , but it would never flop with the touch of the wires : /
 
Last edited:
Again, what is that combination of resistors and capacitor for on the clock input? Try something, remove everything from the clock input. Now just tap the clock in to 5 volts. What happens at the Q out? You should be seeing something happen.

Ron
 
i took out the parts off the clock input ( i found circuit this on line ) i thought they were there to reduce input voltage?

so now i turn it on. both outputs are on , one led is very dim the other bright , when i touch the clk input to 5v , the bright one just becomes brighter ,but it doesnt flip or flop. : /

i might stick with my first design 555 timer, it does work, but a few more components,
 
Have you got a current-limiting resistor in series with the LED? If not, it is possibly pulling the +5V line down and causing spurious results.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top