Dual flip flop help needed - Page 1
Forum section: electronics / projects

author: Amercer
author_rank: Contributor
timestamp: March 01, 2015, 08:18:44 am
content: Hello, I'm hoping someone can help me here,I've designed and built a circuit to operate a display board from a home automation system, without going into detail about it l cut to the chase, my circuit utilises a 7473 dual jk flip flop, actuated by a relay grounding the clock pins (one relay per clock pin) the trouble I'm having is as follows...1. Both inputs operate intermittently from one input2. With a .47 uF cap across the pull up resister, when the relay operates (1 second pulse) the flip flop flips and when the relay turns off the flip flop flopsThe flip flop output 1 drives a mosfet whcth drives a relay which operates 5 dual LEDs (red green 2pin)Output 2 drives a mosfet which drives a relay which operates two strip LEDs drawing around 500mAI have noticed when there is no load and I have the .47uF caps in place it works almost flawlesslyCan anyone suggest anything that'll help isolate the inputs better, I'd upload a schematic but I've made changes to it and I haven't updated it in a while

author: Richard Crowley
author_rank: Super Contributor
timestamp: March 01, 2015, 09:12:21 am
content: You didn't say anything about how you are powering this circuit.Remember that relay coils produce large transients which must be thoroughly filtered to keep the noise out of BOTH the IC power bus, AND the logic-level signals.It seems really odd that you are using a weird combination of "relay logic" and TTL integrated circuits.Are you using "snubbing diodes" across the relay coils? Are you properly bypassing the power supply to the ICs?Many devices that use both relays and solid-state logic operate the relays from a separate power supply because the problem can be so severe.

author: Andy Watson
author_rank: Super Contributor
timestamp: March 01, 2015, 09:39:23 am
content: I would avoid clocking logic inputs directly from mechanical contacts - it's always a pain!But if you must:+1 to Richard's comments plus make sure there is some defined resistance between the .47 capacitors and the switch contacts - a few hundred ohms should work. Without the resistance, the closing of the contacts causes very high current pulses - even from relatively small capacitances.

author: Amercer
author_rank: Contributor
timestamp: March 01, 2015, 10:16:36 am
content: It's powered via a 12v wall wart, with some of the circuit operating at 12v and the flip flop and relays operating at 5v, reason for the relays is this was the only way I could think to interface these two devices, I have snubbing diodes across the relay coils, I hadn't tried a resistor in series with the input, currently pull up resistors to 5v on the inputs with the caps in parallel with those at the clk inputs, I had tried 22uF caps from the input to ground resulting in other glitchesAny ideas on a decent way to isolate the supplies??

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: March 01, 2015, 10:48:52 am
content: Why not provide a schematic of what your doing or trying to do?It very hard to figure out what you're trying to make?Generally speaking, driving a clock from a switch is a bad idea. Switches tend to bounce a lot, and your are person 100353958 trying to invent a "debouncing circuit".

author: Amercer
author_rank: Contributor
timestamp: March 01, 2015, 11:21:08 am
content: It's not switch bounce that is giving me issues, I'll upload a schematic tomorrow after work,Had I had more time I would have re designed everything knowing what I do now but time and money are a big issue. Basically the panel sends a one second pulse to drive a relay, and I need to take that higher voltage pulse and send it low level to a flip flop, I've also tried a transistor latching circuit which gave me the same issue of triggering both inputs/outputs at once, anyway I'll update and upload schematics tomorrow cheers

author: Amercer
author_rank: Contributor
timestamp: March 02, 2015, 08:42:26 am
content: Good evening, Here's the schematic, I've updated all I canCheers for the help

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: March 02, 2015, 08:55:14 am
content: Di you provide glasses with the schemaic?

author: Amercer
author_rank: Contributor
timestamp: March 02, 2015, 08:57:11 am
content: Download it and open with windows preview or something it's fairly high res

author: Andy Watson
author_rank: Super Contributor
timestamp: March 02, 2015, 09:09:08 am
content: C5, C6 ? What are they doing apart from coupling glitches into the positive supply? Consider where the current goes - keep loops as small as possible and avoid over-lapping loops.The contacts are to ground - re-instate C1 and C5to ground. Insert some resistance between C1, C4 and the contacts to prevent infinit current pulses!Also consider the capacitive feedback through drain-gate of the Q2, Q3 - it may be sufficient to unintentionally flip the outputs of U1. You may need to slow-down the switching of coils with a resistive-capacitive snubber (in addition to the diodes).I don't see any power supply decoupling - I'll assume that you omitted it from the schematic for clarityEdit: Also, you might want to check the datasheet for the 74HC73, there may be a minimum clock-transition time.

author: Amercer
author_rank: Contributor
timestamp: March 02, 2015, 09:42:29 am
content: Thanks andy, I forgot to add caps to the 12v and 5v rails to ground, they are there however.So resistors in series with c1, c4, c7, and c8??My understanding was the pulse width of the clock signal was a minimum of around 18ns it doesn't specify a max, therefore it isn't an issue? Tell me if I'm wrong though.C5 & C6 are doing exactly that, I got desperate and just through caps everywhere till something positive happened haha (it was late and it needed to be installed for the morning)Also I had a PCB made and I rushed that as well, had to bodge a number of things, lesson learnt: don't Rush it just costs more time n money laterHopefully tomorrow I'll get a chance to make these changes, and I'll post how I get on thanks

author: Andy Watson
author_rank: Super Contributor
timestamp: March 02, 2015, 10:03:04 am
content: Quote from: Amercer on March 02, 2015, 09:42:29 amSome logic will also have problems if the rise or fall time of the clock is too slow - I don't know about the HC73, you will have to check the datasheet.

author: Amercer
author_rank: Contributor
timestamp: March 03, 2015, 04:23:41 am
content: Update: so I made those changes and now it's slightly worse, same results just slightly different, I think I might use a series of mosfets instead of the relay, is there a relatively simple way to output a shortened pulse width from a roughly one second pulse??

author: codeboy2k
author_rank: Super Contributor
timestamp: March 03, 2015, 04:47:14 am
content: You've got some odd design decisions there..An input pulse triggers a relay, that uses the NC contacts to clock a flip flop, with the Q output triggering another 5V relay?So every time the pulse comes from the external event, you want to trigger and latch a relay, and when it comes again, you want to unlatch the relay? And you want isolation? I would simply use an opto-isolator here. The external event lights the LED in the opto-isolator, the transistor clocks the flip-flops. You can use a schmitt trigger on the opto-isolator output side to clean-up the pulse for the JK flip flop.This eliminates the first two relays completely.

author: Amercer
author_rank: Contributor
timestamp: March 03, 2015, 04:55:05 am
content: Was designed to be simple and as close to the real thing (home wiring) and then more things were asked for and I just added to what I already hadI actually don't know why that never occurred to me, I think that'll work great. I will try it out probably this weekend thanks!

author: Paul Moir
author_rank: Frequent Contributor
timestamp: March 03, 2015, 05:16:03 am
content: QuoteI think this is likely the problem. The max is a couple hundred nanoseconds, so you're probably going metastable. Either a better debounce circuit or a schmitt trigger.But you seem to have a better solution than adding more stuff now.

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: March 03, 2015, 08:05:27 am
content: This is a typical case of over designing. Instead of trying to solve things in hardware, it would be better to do this in software.I have designed my own industrial controller just for that. It fits in a nice small din rail enclosure, has some isolated input and outputs. The problem at hand is solved by changing the software in the microcontroller. It is even possible to put the Arduino ecosystem in it, so everyone can program a simple sketch for this problem in minuts.

author: SL4P
author_rank: Super Contributor
timestamp: March 03, 2015, 09:31:53 am
content: Quote from: Amercer on March 02, 2015, 08:42:26 amI zoomed it up - and from first glance - I can't think of a better project for a micro!I'm sure all the pieces are there, but the drawing is veryunintuitive - and should be redrafted to make the logic and signal-flow / functional relationships more 'obvious'.You know what it does, but it sure ain''t obvious to me!Sorry for being negative, but it looks to me like you could go a long way with (an Ardiuno) and a relay shield. And a redraw of the system.It probably can be done easily with simple logic, but only you will ever know.

author: Amercer
author_rank: Contributor
timestamp: March 03, 2015, 10:00:25 am
content: Actually a micro was my first choice but that was shot down as originally project was just LEDs turning on and off, then things were added. And once I've started on a path... HahaThe drawing is a mess, when I drew it i was only thinking about the pcb, and how quickly I could get it sent out, however, the circuit is really simple, it's input comes from 6 relays and two outputs to drive relays from a standalone board (home automation board) most of the resistors are current limiting resistors, the 555 and 4017 gets turned on from the input and flashes a bunch of LEDs, the 7473 takes an input and toggles other LEDs via a relay which also sends feedback to the home automation board.Thanks for all the feedback I appreciate it, I'll post again after I've added the optocouplers n Schmitt triggers

author: Amercer
author_rank: Contributor
timestamp: March 03, 2015, 10:02:46 am
content: Quote from: SL4P on March 03, 2015, 09:31:53 amDon't apologise, I appreciate all criticism and advice

author: SL4P
author_rank: Super Contributor
timestamp: March 03, 2015, 11:07:08 am
content: Take a look at these threads re: schematic styleshttps://www.eevblog.com/forum/projects/the-best-schematic-layout-standards/msg226703/#msg226703https://www.eevblog.com/forum/projects/schematic-layout/msg83947/#msg83947

author: Amercer
author_rank: Contributor
timestamp: March 03, 2015, 11:20:41 am
content: Thanks for that