Problem with D flip-flop based relay switching

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

flaheu

Well-known member
Joined
Feb 15, 2005
Messages
470
Location
Land of the chicon south - yep
Hello folks,

I've just set-up relay switching system driven by a Transistor which is driven by a D-type flip-flop (4013 dual D flip-flop).
This sytem is connected to a spare psu output which is 0V / -5V (-5V being my "0v").
Everything works well except that when I put my psu ON all my 4013 output are "high", which is anoying.
This set-up is for a preamp, and I've got 4 relays for "Pad In", "48V", "polarity" and a "Pad out".
So it's not convenient, when I put my preamp ON all my flip-flop activate my relays, that means I have to switch them off by pressing all the buttons.
It also means that I have 48v on my inputs when I put my preamp ON, it's not good for the machine that is plugged to the inputs at line level.

I would like that my flip-flop are "off" when I put my preamp ON.

How I wired it:

The momentary switch goes to the clock input, then Data is connected to the inversed output, the output goes to the transitor which puts the relay on, also I've put the Set and Reset input to ground (-5V as above).

Any suggestion are more than welcome.

THX
 
Maybe you can connect the reset to ground via a RC combination to keep the flip flop resetted for a few ms after powerup?
Code:
(+)-------+
          |
          C
          |
          +--- reset
          |
          R
          |
GND-------+
Just an idea...
[/code]
 
Another option is to use the inverting output (There are two outputs: normal and inverted). If the normal output is high when power switched on, then the inverting output is low.
 
If you use the R-C reset approach, it's a good idea to clamp the reset pin with a small-signal diode so that when the power goes down the charged cap doesn't blast the input pin too much. The gates do have a little clamping of their own but you don't want to push it.
 
Have you considered using a microcontroller for this task?

It's relatively simple code.
- Detect Button Press
- Wait for the debounce to finish
- check if the button is still pressed
- Toggle status
- Update outputs

We will be releasing a microcontroller based product like this soon. I am currently waiting for layout to be checked by Keith and to debug some of the software.

Cheers

/R
 
:shock: A micro-controller for debouncing 4 switches driving 4 relays? :shock:

1) microcontroller proto board
2) software dev tools
3) imbedded software dev ability
4) debugging
5) digital noise garbage spewing around inside your pristine analog environment

For 4 switches and relays? :roll:

Sorry, I'm not buying it. Simplify! Why not ditch the F-Fs and use the RC network trick between the switches and the relay drive transistor bases? Small lag in response, but most bounces eliminated (for little cost and no PSU burden).

A P
 
AP,

i know,,, i know!!!! :grin:
Seriously, 2 months ago, I would have been standing next to you, telling the guy that wanted to debounce 4 switches to do it discretely. I've been scratching my head on what/how to control the front end board that I put together too.

I spent most of the time in the last few months thinking of doing it with flip flips, schitt triggers and RC's. I spent some time with SonicMook in LA, where he'd done the same thing.

However, by the time you've put in your flip flop device, and your schmitt triggers, and the RC's for each component, you've added PCB space as well as more room for error and potentially higher costs.

Plus, a basic processor board with 4 switches (push to make buttons) would allow me to do some clever stuff in the future if needed (like send serial commands to ADC's etc).

My MSP430 Dev tools (including the USB connection, software etc) was $20. That was everything to get going. The MSP4302001 comes in a through hole package too.
I spent a weekend merging code from 2 examples on ti.com (the one that deals with interrupts/button presses and another that toggles the output pin).
By Sunday afternoon, I had some code running, and working with the switches I plan to use on expat audio's next product.

Single quantity pricing on those from mouser is $1.65. It has an internal oscillator (no nasty clocks on the board) and has two external components - a power decoupling cap, and a resistor to hold the reset pin high.

This is most probably a branch to another thread... but I just wanted to share with you, and any other that read this thread that the whole basic microcontroller thing really isn't as big and scary as you may think.

BTW -- I chose the MSP430 for obvious reasons. You could very easily use any other small micro - a PIC, AVR or Ardunio etc. I don't want to appear _too_ biased :)

Cheers

/R
 

Latest posts

Back
Top