minimal mosfet relay driver

Started by duck_arse, July 27, 2015, 10:44:20 AM

Previous topic - Next topic

duck_arse

I recently needed a relay latch/driver, and was looking at this 4069 based circuit by RG:




- this is the 5V relays at hand -

the datasheet for the 4069 says not enough current even with the spares paralleled, unless I'm !understanding the numbers. I could add a driver, but then there's all those unused invertors. I've never been keen on the boss flip-flop, so maybe I could just convert the invertors to mosfets, kill birds in hands with a bush, etc.



[for those who want black/white only: ]

and I did, and it does. I'll be using a 9V supply, and driving a 5V relay, so that is the config I've tested. the circuit works with a VN10K at Q2, so a 2N7008 should work if you need (even) higher current capacity, but has not yet been tested. using a micro-action pushbutton, C2 tested ok for values between 4n7 and 22nF. no catch diode is needed for that relay, as it has a polarised coil (I stand to be corrected on this point). anti-status can be shown with the same led-clr attached at !Q instead/as well (as could be an anti-relay, if you were so perverse, replacing R1).

comments, suggestions, engineering insights - all welcome.
You hold the small basket while I strain the gnat.

midwayfair

That's pretty cool. Not too much bigger than an optical circuit!
My band, Midway Fair: www.midwayfair.org. Myself's music and things I make: www.jonpattonmusic.com. DIY pedal demos: www.youtube.com/jonspatton. PCBs of my Bearhug Compressor and Cardinal Harmonic Tremolo are available from http://www.1776effects.com!

Groovenut

Great work Duck! I like it!



I've used this one with a 2N7000 mosfet successfully for a few years with standard non-latching relays. I think it has one more part that yours Duck if the start state parts are removed. A worthy trade off if concern for the difference in cost between 2N3904 and a 2N7000 is an issue (not for most DIY).

I do remember having to mess with the 1M/1uF combo to get the minimum switch time in good balance with the debounce for what I liked, but other than that, it's solid.
You've got to love obsolete technology.....

Transmogrifox

#3
Here are the circuits I have been tweaking over the past several months...maybe some more ideas here.  One resistor would go away if the pnp tranny was changed to a P-channel FET.  The extra switch debounce cap probably can go away, but abuse in simulation with switch bounce shows it's much more robust as drawn.

I think it's pretty much a wash in terms of simplicity, cost, parts count as compared to yours.  It's fun to see all the different permutations that come about from time to time on this simple function.  Nice work ;).

Driving a nonlatching relay.

Driving a latching relay (note this can be used with a dual-coil latching relay also. You just leave the second coil unconnected...unless it had an internal protection diode then you would need some external back-back diodes to connect the coils back-back.


There was another thread where I posted a variant of these but had not at that point simplified the LED status into the emitter of the pnp transistor, and they had an extra resistor that was not necessary.
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.

bool

"Simplicity is the ultimate sophistication." - Leonardo da Vinci

OK, so you guys are at mosfets.

I see absolutely no reason not to use darlingtons in their place (they're cheaper, but will most likely run hotter). Or is there some other catch I don't realise it yet?

2N7002's are also way cheaper than the thru-hole 2N7000's afaik.

Transmogrifox

#5
Quote from: bool on July 27, 2015, 04:46:30 PM
I see absolutely no reason not to use darlingtons in their place (they're cheaper, but will most likely run hotter). Or is there some other catch I don't realise it yet?
I agree.  I don't see any reason darlingtons couldn't replace the MOSFETs in any of these circuits with simple modifications.

Quote
2N7002's are also way cheaper than the thru-hole 2N7000's afaik.
This is correct.  In general SMT components run cheaper than TH -- I have been doing a lot more SMT lately.

Quote
Or is there some other catch I don't realise it yet?
I have a bunch of 2N7000's that I ordered years ago so I design my circuits to use them up.  Sunk cost is still cheaper than sunk cost + cost of new components (unless I could find a better use for my 2N700's).

For the circuit I posted there would need to be a current limiting resistor (like the pnp) to prevent overcurrent when it latches on.  The FET gate conveniently doesn't conduct current when the device is saturated.

Actually with the FETs, duck_arse's circuit doesn't even need R2 and R4.  Probably duck_arse's circuit doesn't even need darlingtons --- could be done with 2N2222's or similar.
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.

bool

Yeah but darlingtons cost the same - and have a bit more of a "knee" when turning on, and will saturate easier than a regular naked BJT.

Compared to a mosfet, they will run a bit hotter, dissipate a bit more but that may not be even noticeable when driving a small relay coil.

With SMD, I would therefore choose a mosfet over a darlington any day, but not so sure with tru-hole parts where a BC517 would get my preferential vote ...

duck_arse

thanks for the inputs, fellows. even less resistors, you say? I was simply thinking of beefed-up cmos, mosfets seemed logical (joke). I was just pleased that it worked.

further tests, all with the 5V relay, show that 2N7000 and 2N7008 at Q1 and 2 are both good, at either 9V or 12V. pay attention to the power rating of the dropper resistor! I added a relay catch diode anyway, it reduced the oversoot sighted at the C1//R5 junction.

if you wanted to drive the DS2Y- 1V5 or 3V relays, use 2N7008 or VN10K. I don't have any BS170 mosfets to test, they should handle the 5V relays at least. the 2N7002 is smd and rated 500mA, so you could do tiny and drive all those coils.

with a micro-action switch, I couldn't out-push a 10nF cap at C1, it toggled every time. with a non-micro, I still couldn't out-push a 2n2 cap. for reliable, fast toggling, don't go higher than 22nF here.

the most interesting viewing point on the cro is at the R//C junction. all the rest is pretty much square waves, at 0V or 9V. I haven't done any intial state tests. due care needs to be taken with supply bypass and isolation from audio sections, but you knew that already.
You hold the small basket while I strain the gnat.

Transmogrifox

Quote from: bool on July 28, 2015, 05:58:03 AM
Compared to a mosfet, they will run a bit hotter, dissipate a bit more but that may not be even noticeable when driving a small relay coil.

+1 power dissipation is not a deciding factor.  The only difference between MOSFETs and darlingtons relevant to this application is that the darlington (as with any BJT) will conduct virtually unlimited currents through the base once it saturates.  As long as the driving impedance is current-limited, this is fine.  For the duck_arse flip flop this will not be a problem.  My flipflop would latch into a destructive overcurrent condition if the MOSFET was replaced with a darlington.
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.

bool

But that can be easily remedied with a simple resistor. Cheap. Works.

Like, "Vive la résistance", sort of.

Transmogrifox

Anyway...I didn't mean to hijack the thread.

Really nice work duck_arse.  This will probably end up in one of my projects somewhere just to keep things mixed up ;).  Sometimes I like to do things differently just because there's an aesthetic/artistic aspect to circuits that can't be measured with a DMM or oscilloscope. 
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.

duck_arse

ahh, transmog, before you go: I was thinking about my "anti-relay" comment in the OP. do you see a way a latching relay could be fit into this circuit? just for curiousity sake, natch.
You hold the small basket while I strain the gnat.

PRR

> a way a latching relay could be fit into this

Use your front-end with R.G.'s back-end (or the same function in your N-MOSFET style).
  • SUPPORTER

Transmogrifox

#13
Quote from: duck_arse on July 29, 2015, 12:22:24 PM
do you see a way a latching relay could be fit into this circuit?
One way is as PRR suggested.  A second way is look at schematic I posted above with the "latching relay option".  In that schematic "M6", "D6", and "C9" consist of the latching relay driver.  You already have the equivalent of "M5" in your circuit and you can replace "R16" (4.7k) with an indicator LED + resistor.

It works like this:
When you power it on, R16 starts high by default.  This pulls up on gate of M6 and charges C9 through the relay coil.  If C9 is correctly sized to your relay coil energy requirements, it will cause it to latch into the set position (or reset depending on how you place relay polarity in the circuit).

Then when the latch changes state, M5 discharges C9 through the relay coil in the opposite direction through D6.

You could apply the same prinicple to a dual-coil relay and only use one of the coils or just do what PRR suggested.
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.

duck_arse

#14
I needed a softy bypass latch thing, so I modded the transmogrifox circuit above to this:


some resistor changes to reduce current, cause I like my leds dimmer (set with R200), and the cap across the switch is gone - it didn't work with that fitted. also, there is some sorting needed for the R//C values. with 470k the cap can be (on my bb, my switch, my thumb) between 22nF and 56nF for everytime operation. for a 220k - 33nF~100nF, but for a 1M, no cap would work.

the point marked "Q" served my purposes, namely the fet gate in a smalltime delay (boss-standard 1M series to 47nF to ground and gate diode), swinging from 0V~7V2 with the parts shown (BC558B showed hFE~300). the mosfet drain could serve as "bar-Q" as it swings from 9V~3mV.

possibly, a simpler replacement for the boss style flip-flop?

[edit :] switch is momentary, normally open pushbutton. micro action preferred.
You hold the small basket while I strain the gnat.