Author Topic: JFet switching with 3.3V logic  (Read 2409 times)

AdamB

JFet switching with 3.3V logic
« on: July 08, 2019, 12:56:48 PM »
Hi,

I'm working on a switching circuit that selects between audio signals, driven by a dspic. The pic's digital pins provide 3.3V TTL, wondering how I might go about rigging it up to replace the footswitch in this circuit that relies on a +9V supply for the JFETs;



I want to avoid using relays (too big) and haven't been able to find a switch IC that seems to do this job well/cheap/small TH footprint.

The schematic is from a unit I'm designing based around a dspic - the switching works fine driven by a 3PDT switch (with one pole used to control the dspic and the other 2 poles used to control the audio switching). However I want the ability to control whether the effect is latching or non-latching switching. So I'd like to simply use a SPST momentary switch to drive the dspic logic and then have the dspic control the audio switching side of things itself.

Any ideas?

Rob Strand

Re: JFet switching with 3.3V logic
« Reply #1 on: July 09, 2019, 04:52:34 AM »
I'm not sure if you just want to interface the 3V microprocessor to the existing 9V circuit, or, remove 9V altogether.

For the first case you just need to drive the gates with an open collector or open drain circuit.   You probably won't be be able to drive the gates directly from the microprocessor with an open drain/collector configured pin.  You will need to add a transistor or MOSFET. 

Take this ckt
https://www.hobby-hour.com/electronics/s/schematics/od1-overdrive-schematic.gif

(Roughly) imagine stripping out:
LED drive ckt
R19, R18, C10, C13, C14
C11, C12,
then break R22 from R20 and R23 from R21
then drive the micro into the now floating resistor ends of R22 and R23.
You will need to reduce the 2x100ks to at least 56k so the transistors will switch at 3V3.

The whole idea is to provide a floating collector output which can go upto 9V when the switched (Q2, Q4) are off.
The mind often distorts without gain.

AdamB

Re: JFet switching with 3.3V logic
« Reply #2 on: July 09, 2019, 11:11:25 AM »
Thanks for the reply, I'll try and figure my way through your answer!

Rob Strand

Re: JFet switching with 3.3V logic
« Reply #3 on: July 09, 2019, 06:56:30 PM »
This is a simpler version.



The extra resistors and caps on the Boss circuit help reduce ticks when switching over.
The simpler version doesn't have this but it will help you understand the main idea.

« Last Edit: July 09, 2019, 07:12:44 PM by Rob Strand »
The mind often distorts without gain.

AdamB

Re: JFet switching with 3.3V logic
« Reply #4 on: July 10, 2019, 04:55:15 AM »
Ok I think I understand that now - time to breadboard! Once I got it I'll copy it over to my schematic and repost for others to use.

Massive thanks for the help!

AdamB

Re: JFet switching with 3.3V logic
« Reply #5 on: July 16, 2019, 11:27:40 AM »
Seems to work OK on the breadboard.

Here's my schematic for it;



MetalGuy

Re: JFet switching with 3.3V logic
« Reply #6 on: July 16, 2019, 03:00:14 PM »
Quote
...and haven't been able to find a switch IC that seems to do this job well/cheap/small TH footprint.

How about Analog's ADG series CMOS switches?

Rob Strand

Re: JFet switching with 3.3V logic
« Reply #7 on: July 16, 2019, 07:24:55 PM »
Quote
Seems to work OK on the breadboard.
It should work.  The only thing you might have to watch out for is 'ticks' when changing over.   The extra caps on the Boss ckt help reduce that to a minimum.

Quote
How about Analog's ADG series CMOS switches?
Nothing wrong with that path either.
The mind often distorts without gain.

ElectricDruid

Re: JFet switching with 3.3V logic
« Reply #8 on: July 17, 2019, 02:30:17 PM »
Seems to work OK on the breadboard.

Here's my schematic for it;



I don't doubt that works, but is all that stuff *necessary*?

With the diode on the FET's gate, the pull-up to 9V doesn't do anything, does it? The diode is reverse-biased. I thought the original Boss idea was that the Gate floats high in this condition, but I might be wrong - never studied this stuff.
Also why drive the transistor bases from a voltage divider that reduces the voltage at the base? You can drop the resistor to ground, surely? If you're not getting enough current to switch them on, reduce the base resistor a bit.

I'm interested to see this succeed because this is something I've wanted to do too, so I hope my comments are useful and not just poorly-informed misunderstandings. Switching FETs on and off directly from a uP offers several interesting possibilities...;)

HTH,
Tom

Rob Strand

Re: JFet switching with 3.3V logic
« Reply #9 on: July 17, 2019, 07:41:00 PM »
Quote
With the diode on the FET's gate, the pull-up to 9V doesn't do anything, does it? The diode is reverse-biased. I thought the original Boss idea was that the Gate floats high in this condition, but I might be wrong - never studied this stuff.
It might work floating.  It's better to force the issue from a noise perspective and to avoid any weird behaviour related to the gate capacitances charging up and causing fizzyness.
[BTW:  In the Boss Vibrato thread a few months back a 10M pull-up had problems.]

Quote
Also why drive the transistor bases from a voltage divider that reduces the voltage at the base? You can drop the resistor to ground, surely? If you're not getting enough current to switch them on, reduce the base resistor a bit.
That will work for sure.   The resistors make the transistor switch at 1.2V or so roughly mid 3V3 rail.  There's cases where you should use base-emitter resistors but in this case you don't really need them.

Quote
Switching FETs on and off directly from a uP offers several interesting possibilities
If you look at professional products they often use circuits like the Boss circuit with the pull-ups, diodes, and RC networks to provide soft change-overs.
« Last Edit: July 17, 2019, 08:30:59 PM by Rob Strand »
The mind often distorts without gain.

AdamB

Re: JFet switching with 3.3V logic
« Reply #10 on: July 19, 2019, 06:24:25 AM »
Ordered a PCB prototype to test this revision so will confirm how well this solution works and then move onto the next revision. I've left out the extra caps from the boss design for now, will asses whether I need them once I hear this working as is and add them to the next revision if needed.

I'll let you know how I get on!

AdamB

Re: JFet switching with 3.3V logic
« Reply #11 on: July 19, 2019, 12:35:09 PM »
Quote
How about Analog's ADG series CMOS switches?

Good suggestion, however my issue is that looking around mouser I couldn't see any that are through hole to make designing with it easier for a simpleton like me! But, maybe I'm not looking hard enough. Whilst I am intending to use SMD in my project (the PCBs I have on order are the first that switch to SMD pics and RAM chips to reduce size, now that I know from previous revisions that my pic and ram stuff is working fine). But when designing each stage of the circuit I need to start first with through hole stuff to make prototyping easier and reduce the number of iterations I have to go through to get stuff to work, being as I don't really know what I'm doing!

That being said, assuming this switching stuff works as planned and I can move onto the next part of the project, I am faced with the daunting task of replacing the onboard ADC/DAC of the dspic with a codec chip of some sort, which are seemingly all SMD, too. So I'm gonna have to go through some pain there, building PCBs that might not work. Chip wise I'm looking at whatever is cheap/simple and supports SPI. SPI might not be ideal? But I have a good idea of how to wire up, so hopefully won't take too many revisions of rookie errors to get that working! The pic I'm using has 2 SPI modules, so I'm also kinda hoping it's speedy enough to do 16bit 48Khz audio as well as talking to the ram chips.

ElectricDruid

Re: JFet switching with 3.3V logic
« Reply #12 on: July 19, 2019, 02:24:42 PM »
For talking to a codec, you might be better with I2S rather than SPI. I2S ("Inter-IC Sound") is the standard for that type of job. While there are plenty of SPI DACs and ADCs out there, the ones aimed at audio tend to go with I2S.

Some of the dsPICs have an I2S interface built-in to make life easier for connecting up a codec. Coupled with the DMA, you can get cool stuff going on where your data miraculously arrives in RAM without your code having to do anything at all and without holding up the processor with interrupts.

AdamB

Re: JFet switching with 3.3V logic
« Reply #13 on: July 19, 2019, 03:03:05 PM »
Ok good to know! I just found this prototyping board;

https://www.mikroe.com/audio-codec-proto-board

that looks like it supports both spi and i2s so I can try both ways, and means I can breadboard and get data going in and out of the pic before committing it to PCB.

Then I suppose I just have to figure out the input/output conditioning for guitar signals for it.


AdamB

Re: JFet switching with 3.3V logic
« Reply #14 on: August 12, 2019, 07:24:17 AM »
Right, an update on this switching thing.

So breadboard tests went fine though I only tested 1 JFET switch attached to 1 pin on the dspic, but felt confident enough with it that I moved ahead and built a PCB version.

The PCB version is a fail, here's my problem; What I didn't test on the breadboard was two JFET gates operating together (one on the dry signal and one on the wet, controlled by separate logic pins) and it seems that somehow the 2 JFETs are interfering with one-another's operation;

I have 2 pins of 3.3V logic controlling the switching, one is the 'DRY_SWITCH' and the other is the 'WET_SWITCH'. Bringing this pin low should open the associated JFET gate. The idea with this setup is that the user can select whether the effect is latching/momentary, and whether the dry is muted while the wet is playing.

If you only have dry or wet, but not both, you get a useable signal. I can't be sure but I *think* it's slightly quieter than what it should be, which leads me to suspect the JFETs aren't opening up fully. However it "works".

But, if you try to un-mute both the dry and the wet together (pull both switch pins low) you get lots of buzzy heavy distortion of both signals. However, if you switch to bridge pickup and pick as hard as you can, then it seems to pop both the JFETs open (even the wet signal JFET, which is not playing any of the dry signal) and the distortion disappears completly (it also seems to go louder than the wet on its own or dry on its own, which is what leads me to believe the JFETs aren't opening properly when used independently).

Anyone have an idea what's going on here? Attached is the schematic, it's the same as what I posted earlier;



gena_p1

Re: JFet switching with 3.3V logic
« Reply #15 on: August 12, 2019, 07:38:42 AM »
Quote
...and haven't been able to find a switch IC that seems to do this job well/cheap/small TH footprint.

How about Analog's ADG series CMOS switches?

FET switching is fine with capacitor on gate , but CMOS switching is edgy , and without zerocross or kind of that at the input of reverb it's harsh

Rob Strand

Re: JFet switching with 3.3V logic
« Reply #16 on: August 12, 2019, 07:49:24 PM »
Quote
If you only have dry or wet, but not both, you get a useable signal. I can't be sure but I *think* it's slightly quieter than what it should be, which leads me to suspect the JFETs aren't opening up fully. However it "works".
To cut to the chase I think you might be better-off moving the JFET switches to the input of the opamp.  Increasing the resistors on the opamp from 10k to 47k might also help. 

In your current set-up the input voltages modulate the JFET drain and source voltages relative to VR.  The JFETs voltage are "flapping about".  This in turn modulates the Vgs voltage and hence the JFET resistance.   The 10k resistances on the opamp are quite low and that makes the problem worse as the JFETs resistance needs to be low relative to the 10k value.

By moving the switches to the opamp of the 10k resistors the voltages on the JFETs are pinned at VR on one side and only modulate a small amount on the other (basically the divider formed by the 10k input resistor and the JFET resistance on the other).   Now you can see by making those resistors 47k the voltage across the JFET is kept 5 times lower than 10k (and probably 100 times less than what you have now).

Look at some Boss circuits.  This type of thing,


« Last Edit: August 13, 2019, 02:44:24 AM by Rob Strand »
The mind often distorts without gain.

AdamB

Re: JFet switching with 3.3V logic
« Reply #17 on: August 13, 2019, 03:41:28 AM »
Ok I think I understand it, cheers for the help - will roll that into the next version and see how goes!

AdamB

Re: JFet switching with 3.3V logic
« Reply #18 on: August 13, 2019, 04:23:41 AM »
Just mocking this up, this is what I got from your post, Rob. Blue squares are where I've moved the 10K resistors to so that the switch is between the resistor and the op-amp input, and bumped them to 47K. I've also added in the capacitors (orange squares) to remove the clicks on switching (as you suggested earlier - can confirm this thing pops like crazy when you switch :P). I *think* I've put the capacitors in the right place, but I find that old boss schematic hard to read for some reason, something about the way it's laid out doesn't agree with me.



I'll hook up the wet side in the same way and then when I roll the next revision I'll let you know how it went!

Rob Strand

Re: JFet switching with 3.3V logic
« Reply #19 on: August 13, 2019, 05:20:03 AM »
The series caps won't work.   The Bass-Emitter cap might work but it's often not a good place to put timing caps.
I've mark up the schematic to be more Boss-like.
Notice you don't need to 1M at the terminal going to the opamp.



The mind often distorts without gain.