Using 2N5457 JFET as a signal switch in a switchbox.

Started by alparent, February 02, 2011, 08:12:25 AM

Previous topic - Next topic

alparent

OK I've been working on a switchbox using my new Arduino. And for some reason I've had my mind stuck on using CD4066's.
But after some reading I've learned that I'm going to need a transistor to provide proper voltage to the CMOS gate.

I've been help by a lot of people and that problem is solved.
http://www.diystompboxes.com/smfforum/index.php?topic=89555.0
But.......
This got me thinking......If I need transistors to control the CMOS.......why not just use transistors?

Could I use something like a 2N5457 (got lots of those) to switch the audio signal in and out?

Use the Arduino pin to control the JFET that would cut the signal in or out. I that plausible?
I would I set that up?

I there a better way?

Lot of questions, I know! :icon_redface:

Thanks for your help.

R.G.

It does work, kind of.

The "kind of" depends on which JFET you use - 2N5457 is not the best for your particular design - and how complicated your switching is.

To use a JFET most naturally in your design, run a 100K to 1M resistor from each of the drain and source to your +5V supply. The signal going into the JFET goes through a DC blocking capacitor into the drain (or source) and out of the source (or drain in this case). You drive the gate with a 1M from the output pin of the microcontroller and include a 0.01uF capacitor to ground.

The uC can then drive the gate from ground to +5V and back. A JFET turns on as a switch when its gate is at the same potential as the source (actually channel, for you purists) and off when the gate is pulled (negative for N-channels) away from the source by at least Vgsoff.  The 2N5457 has a maximum Vgsoff which is too large to be used easily here with only 5V available for turning it off. Other JFETs like the 2N5485 do have a Vgsoff of less than 5V and will work in this circuit.

Notice that you may have to produce a specially filtered "5V" for biasing the drain and source. Otherwise, the power supply noise of the uC may ride through.  A 10K with a 10uF paralleled with a 0.01uF ceramic cap to ground should work.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

alparent

Thanks for that R.G.

OK now the real question....in your opinion what would you do for this switchbox?
CMOS, FETs, other approach i didn't think about in my limited knowledge?

4 inputs and 4 outputs

3 modes.
First mode = I select the input  all outputs are on.
Second mode = I select the input and only the corresponding output is on.
Last mode = All inputs are on and I select the output.

R.G.

I think for where you are in the learning process, the best thing to do is to make as clean a mental break between digital and analog as possible.

To do that, I would use the Arduino outputs to drive the gate of a MOSFET which would then drive the control of a CMOS switch.

I say this for the following reasons:
1. A single MOSFET can be driven directly from the output of the Arduino, no other components.
2. You can test your Arduino code by putting an LED+resistor from +9V to the drain of the MOSFET, and develop *all* of your switching code without ever needing to hook up a single analog switch. The LEDs let you see if your code works without wondering whether the analog stuff is correct.
3. When you get the digital/logic code working just right, you can then face the problems of getting an analog switch to work correctly for you. In the case of the MOSFETs as a logic level translator, this does give you the problem of having to use inverted logic at some point. That is, the output pin on the Arduino is high when the LED comes on, but the MOSFET drain you'll use later is low. So you have to either add another logic inversion from active-high to active low somewhere. This can be in the Arduino or in the external logic.

The screaming advantage here is that you can simplify your code development by not considering the analog part at all - just read switches and look at LEDs. That is an enormous advantage for programming, even for experienced programmers.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

alparent

Thanks a million R.G.

You input and advice is greatly appreciated.  :icon_smile: