News:

SMF for DIYStompboxes.com!

Main Menu

Relay TBP driver updated

Started by Transmogrifox, February 17, 2006, 10:33:15 PM

Previous topic - Next topic

Transmogrifox

Hi all.  I have been noticing that a number of people have been actually using and asking questions about the single coil latching relay driver schematic I have on my site.  I whipped up a more neat and complete pair of schematics this evening on AutoCAD and made a PDF of it.

For those still interested, you can access it at:

www.geocities.com/transmogrifox/relay

With much regard!
TFOX
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

Transmogrifox

Added an MCU-based diagram.  It works well.  I haven't had the long term testing on it yet to find out if it eventually fries the MCU outputs, but it's there for those interested.

Same link as above.  The PDF file link should be self-explanatory.  I also got the PWM pin to output a triangle LFO last night.  Now to make it tap tempo enabled.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

Ethan

Took a look at your MCU circuit. Looks interesting.  I tried your circuit using a 22uf charge cap instead of 4.7uf, trigerring it with a pic10f200. It worked but I was getting some pops.  I also tried using 2 lines off a pic12f508 and used some zener diodes protection circuit.  In my code, I just pulsed opposite side of the relay coil for a few mS to trigger.   Wondering if you could elaborate on the testing and matching of gp4 and gp5 theory. 

I'll post ciruit my if your interested.  This worked well but I figured I'd try RG keens circuit since 2n3904 are cheaper than zener diodes(I think). I had to use a dual coil relay but it seems to cause least amount of click in my circuit. 

Transmogrifox

Here's the guts of  the code:

;Interrupt pin is GP2
;2 output pins are GP4 and GP5

;Interrupt Subroutine:
*********************************

call         delay          ;Make sure switch bounce is settled
;(call delay 4 or five more times)  delay = ~ 1.5 ms

btfss       GPIO,2        ;Test input bit
retfie                        ;If noise or random blip (dropped pedal or brushed top of switch or something odd like that): return to main prog


movlw   b'00100000'
xorwf    GPIO, f          ; Toggle GP5  (at this point, GP5 and GP4 become mismatched)

call       delay

btfsc     GPIO, 5
bsf       GPIO, 4
btfss      GPIO, 5
bcf        GPIO, 4             ; Match GP4 to GP5

;call delay & loop until GP2 is settled to 0 so bounce on release doesn't re-trigger interrupt

;clear interrupt flag

retfie
;*************************************************;end ISR

As you can see, GP5 just toggles on and off.  After a 1.5ms (or so) delay, then GP4 follows GP5 to the same logic level.  This allows you to use either GP4 or 5 for the LED indicator.

I used no Zeners for (2) reasons:

1.  The PIC chip outputs have clamping diodes built in.  It is more likely that in the event of kickback, the voltage would not rise much, and the resultant current would toast the IC before the output reached the Zener voltage.

2.  The PIC chip outputs are low impedance, so this is a voltage source driving an inductor.  There is only a brief moment where the output has a high impedance characteristic such the the current in the relay would be instantaneously interrupted.  That's during the transition of the output from high to low, or low to high.  The energy released from kickback during this time is probably not going to damage the chip.  Mine hasn't fried from driving directly yet (though I haven't extensively tested it).  Even so, the Zener voltage would not be exceeded before it toasted the chip through the clamping diodes.


Finally, I didn't show it on the schematic, but it's a good idea to have your power supply well bypassed to prevent the uC from chomping your supply chain during switching.  It will grab about 10-15mA for that 1.5ms interval.  That could create a pop.  I'm operating my chip on the internal clock at 8 MHz, so I'm not concerned about steady state operation bothering the audio path otherwise.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

Transmogrifox

Thanks for moving it Peter.  It definitely turned digital once I added the MCU schematic to the page.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

Peter Snowberg

You're welcome and thanks for posting the code! 8) 8) 8)
Eschew paradigm obfuscation