Author Topic: 4013 as a relay flip flop.  (Read 1958 times)

0 Members and 1 Guest are viewing this topic.

Offline geobeeTopic starter

  • Contributor
  • Posts: 47
  • Country: au
4013 as a relay flip flop.
« on: July 16, 2022, 09:46:11 pm »
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.
« Last Edit: July 16, 2022, 09:49:41 pm by geobee »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15425
  • Country: fr
Re: 4013 as a relay flip flop.
« Reply #1 on: July 16, 2022, 09:59:54 pm »
Judging from the actual pinout of a CD4013, it doesn't look right to me indeed.
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1688
  • Country: gb
Re: 4013 as a relay flip flop.
« Reply #2 on: July 16, 2022, 10:03:01 pm »
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?
 

Offline geobeeTopic starter

  • Contributor
  • Posts: 47
  • Country: au
Re: 4013 as a relay flip flop.
« Reply #3 on: July 16, 2022, 10:16:37 pm »
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.
 

Offline glentek

  • Regular Contributor
  • *
  • Posts: 56
 

Offline mag_therm

  • Frequent Contributor
  • **
  • Posts: 783
  • Country: us
Re: 4013 as a relay flip flop.
« Reply #5 on: July 17, 2022, 01:21:24 am »
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 harm
Also 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.
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1688
  • Country: gb
Re: 4013 as a relay flip flop.
« Reply #6 on: July 17, 2022, 04:20:30 am »
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.
« Last Edit: July 17, 2022, 04:23:22 am by Buriedcode »
 

Offline geobeeTopic starter

  • Contributor
  • Posts: 47
  • Country: au
Re: 4013 as a relay flip flop.
« Reply #7 on: July 17, 2022, 05:48:31 am »
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.
« Last Edit: July 17, 2022, 05:52:44 am by geobee »
 

Offline eblc1388

  • Frequent Contributor
  • **
  • Posts: 400
  • Country: gb
Re: 4013 as a relay flip flop.
« Reply #8 on: July 17, 2022, 01:28:13 pm »
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.

The 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.



 
The following users thanked this post: geobee

Offline jfiresto

  • Frequent Contributor
  • **
  • Posts: 876
  • Country: de
Re: 4013 as a relay flip flop.
« Reply #9 on: July 17, 2022, 02:35:19 pm »
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.
-John
 
The following users thanked this post: geobee

Offline geobeeTopic starter

  • Contributor
  • Posts: 47
  • Country: au
Re: 4013 as a relay flip flop.
« Reply #10 on: July 17, 2022, 10:05:39 pm »
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.
 

Offline jfiresto

  • Frequent Contributor
  • **
  • Posts: 876
  • Country: de
Re: 4013 as a relay flip flop.
« Reply #11 on: July 18, 2022, 06:51:01 am »
A rectifying/switching diode across the coil slows the opening of the relay contacts which can rapidly wear them out. This helpful paper gives some delays and suggests faster-opening alternatives.
« Last Edit: July 18, 2022, 06:53:12 am by jfiresto »
-John
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf