What have I done wrong here?

Started by Sage, February 02, 2015, 06:15:10 PM

Previous topic - Next topic

Sage

I put together this relay driver using a CD4013 (IC1) and a ULN2803 (IC2), using a momentary SPDT switch.  I'm using it to drive a single-coil 9V relay.  It works, and it works reliably, except for one little detail... when I first power the circuit up, it's a crapshoot as to whether the relay coil is activated or not.  Sometimes it powers up "on" and sometimes it powers up "off."  I want to guarantee that it will be off when I first power it up... does anyone have an idea how I'd modify this to that end?


Quackzed

#1
oops-disregard, sorry...
nothing says forever like a solid block of liquid nails!!!

PRR

Try this:



Idea is: the rapid rise of power supply jerks a selected S/R input high, forcing the flop to that state.

But in general any simple trick will be unreliable. In this case a soft-start power supply won't couple enough signal through the R-C.

More elaborate initializations will wait for power to become stable, then pulse the desired state; or sense wrong states and insert pulse.
  • SUPPORTER

Sage

I'll try it, but I don't think the left-side flop is the one that's causing the problem.  Only the reset pin is connected to voltage when the circuit powers up; the set pin is left floating until the momentary switch is pressed.  I don't see any way for Q to go high until that switch is pressed.  Maybe it could start up high, but the clock pin it's connected to on the other side only detects the rising edge; starting high shouldn't be enough to trigger it, I would think.  Am I wrong here?

I suspect that the other side is the problem; either the set/reset pins both being connected to ground are in contention with each other during powerup, or... something else.  Any second opinions?

Quote from: PRR on February 02, 2015, 10:17:11 PM
More elaborate initializations will wait for power to become stable, then pulse the desired state

I like this idea; it would be keen to pulse the reset pin on the right side of the 4013 once on power up... but how would I accomplish that?  Do you know of any examples?  I could connect the reset pin to ground via a resistor instead of a jumper in order to facilitate returning it to ground after the initial pulse, but... how do I generate that initial pulse?

PRR

> but how would I accomplish that?

Did I forget to link the picture with the added capacitor? (Or are you blocking external images?)
  • SUPPORTER

Sage

Quote from: PRR on February 19, 2015, 05:05:10 PM
Did I forget to link the picture with the added capacitor? (Or are you blocking external images?)

You mean this one?


You've got a cap connecting voltage source to the reset pin of the left-side flop (pins 1-6 on IC1)... but because that's an SPDT momentary switch, the reset pin is already connected to voltage by default.  So I don't understand what the cap accomplishes.  Besides, the left-side flop is only being used for switch debounce.  I was talking about pulsing pin 10, on the right-side flop (pins 8-13 on IC1), because that's the flop that's holding the state of the toggle.

PRR

> because that's an SPDT momentary switch

Ah, I was stupid.

How do commercial pedals get consistent start-up?
  • SUPPORTER

Sage

Maybe I can replace the jumper that connects pins 8 and 10 with a resistor, and put the cap between pin 10 and voltage?  My thinking is that the voltage would hit the pin until the capacitor is charged, after which the pin would go to ground...

Sage

Here's what I've done:


It appears to work.  I've plugged it in and unplugged it a couple dozen times now and it always comes up in the right state.  Doesn't seem to affect the switching performance either.  Can you think of any reason *not* to do this?

Thanks for the hint that got me this far. :)