4013 as a relay flip flop. - Page 1
Forum section: electronics / projects

author: geobee
author_rank: Contributor
timestamp: July 16, 2022, 09:46:11 pm
content: Hi all, simply cannot get the following schematic to work, I feel, with my past experience being all analogue, that there is something not correct with it. I have connected it up three times, to no avail. Any help to get this going would be much appreciated.

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 16, 2022, 09:59:54 pm
content: Judging from the actual pinout of a CD4013, it doesn't look right to me indeed.

author: Buriedcode
author_rank: Super Contributor
timestamp: July 16, 2022, 10:03:01 pm
content: Yeah that schematic isn't right, pin2 is an output of the first flipflop, which should never be connected directly to GND (or VCC) as it'll just fry the output pin. Looks like someone has copied the scehmatic and changed the pin numbers around without checking the actual pinout.What is it you are trying to do with the relay? A latching control circuit with active high input?

author: geobee
author_rank: Contributor
timestamp: July 16, 2022, 10:16:37 pm
content: Many thanks for the help, I am trying to trigger a DPDT relay, which is used to reverse the voltage supply to a model train track, when a low level trigger is applied to the 4013 from an IR sensor. I need the relay to latch on with the first trigger, then off with the second.

author: glentek
author_rank: Regular Contributor
timestamp: July 16, 2022, 11:22:56 pm
content: Use google image search:http://www.trainelectronics.com/LED_Articles_2007/LED_103/images/schematic_4013.gif

author: mag_therm
author_rank: Frequent Contributor
timestamp: July 17, 2022, 01:21:24 am
content: Is that a good example though? It is dumping the +9V supply straight into a discharged 0.1 uF. "Infinite" current on the tracks right when they can do the most harmAlso doesn't have a RC delay around to D. That delay prevents retrigger in case of HF ringing on the active zone of clk transition.

author: Buriedcode
author_rank: Super Contributor
timestamp: July 17, 2022, 04:20:30 am
content: The 4013 is positive edge trigger on its clock, a negative edge does nothing. It can however be inverted with an NPN transistor (or PNP). If your input is noisy, from a button/switch, then it will need filtering to prevent extra clock transitions from changing the flipflop state randomly. If it's a nice clean high/low then it should be fine. Is this IR sensor like a beam-break type thing? Will it be prone to brief transitions on the output?The original schematic had at least one thing right: it used a resistor/cap on the reset line on the output flipflop that guarantees it powers up with its output low - so the relay doesn't trigger on power up.Although it's an extra chip, a simple 555 can be used to convert a falling edge to a nice clean positive edge output pulse for the 4013 to latch the relay.

author: geobee
author_rank: Contributor
timestamp: July 17, 2022, 05:48:31 am
content: Thanks to all for the replies, so basically, to get that schematic to work, pin 2 should not be grounded, other than that, I am a little confused about pin 3, it shows it linked to pin 12 at the top of the schematic,yet pin 3 is also shown down the bottom as being grounded, which would also ground pin 12? The trigger input is a low from an IR obstacle detector, but there are no ''short interruptions'' to the trigger, just a clean low pulse.

author: eblc1388
author_rank: Frequent Contributor
timestamp: July 17, 2022, 01:28:13 pm
content: Quote from: geobee on July 17, 2022, 05:48:31 amThe original schematic has the pins number messed up badly. I have drawn you a revised one. Note that the 4013's clock input does not work from a falling signal but a rising one instead. That is why I have added a general PNP transistor to invert the sense of the signal. You can use any general silicon PNP transistor for 2N3906. Cheers.

author: jfiresto
author_rank: Frequent Contributor
timestamp: July 17, 2022, 02:35:19 pm
content: Or instead of a 4013, you could use a 4024 ripple counter, which has a failing edge clock and a simpler layout, just 5 connections: clock, reset, Q1, VDD and VSS.

author: geobee
author_rank: Contributor
timestamp: July 17, 2022, 10:05:39 pm
content: Thank you all kindly for the time and effort taken to help with this. I have been using little modules from Ebay to do the job, but they seem to have a high failure rate, and very difficult to buy with DPDT relays, usually just single pole, so you need to either modify the original, or end up using an extra relay to get the required result. The appear to use the protection diode across the relay pins, but for some reason they don't last very long.

author: jfiresto
author_rank: Frequent Contributor
timestamp: July 18, 2022, 06:51:01 am
content: A rectifying/switching diode across the coil slows the opening of the relay contacts which can rapidly wear them out.This helpful papergives some delays and suggests faster-opening alternatives.