4

I'm looking for an analog SPDT switch which will block reverse current if in open state.

The circuit operates in two modes:

  1. LED on (SW1 and SW2 in closed state)
  2. LED off (SW1 in closed, SW2 in open state)

In mode 1 both switches are closed, forcing the LED to emit light fed by the current flowing from the power rail to GND. In mode 2 SW1 is open (blocking the power rail) and the LED is used a a current source feeding the photo current into a multi-stage transimpedance amplifier. Naturally, the photo current flows in the opposite direction (from GND to the negative input of the transimpedance amplifier).

schematic

simulate this circuit – Schematic created using CircuitLab

My design uses a matrix of LEDs (common cathode) to detect incoming rays of light and a microcontroller turns the switches on and off. Scanning through the sensor rows requires selecting a single row (turning on SW1 for that row) while turning off the SW1s of all other rows.

I'm currently using SN74LVC1G3157DCKR analog switches which work pretty good for mode 1, but don't work in mode 2, as reverse currents are not blocked by open switches. So I'm unable to turn off all rows but the one that should get measured and instead the photo current flows through all open SW2s.

The problem can be seen here when feeding AC current through a closed and through an open SW2.

switch closed - current flows in both directions - all good switch open - forward current is blocked, but reverse current is still flowing

Woyzeck
  • 51
  • 4
  • What speed do you need? A dual-MOSFET SSR is easy to control. – tobalt Feb 11 '24 at 12:44
  • Very moderate, in the lower kHz range. The current is about 250mA. – Woyzeck Feb 11 '24 at 21:14
  • Sounds like a textbook case for a SSR then. They cost below 1€. 60 V, 0.5 A is a very usual rating and you can easily toggle them with a GPIO pin, they take about a microsecond to turn on/off and do so pretty gracefully. Off-state capacitance can be on the order of 10 pF though, so check if that is good enough – tobalt Feb 12 '24 at 07:14

2 Answers2

6

CMOS analog switches can only switch voltages within their supply voltage range. The 74LVC1G3157 is a single-supply type, so it can only be used to switch signals between GND and VCC (likely 3.3V in your case). It can't handle negative voltages, which are generated by your photodiodes when they're disconnected.

You need to use an analog switch that can be used with bipolar supply rails, i.e. the DG419, and then provide it with a proper negative voltage rail. You could go for +/-5V, for example.

Jonathan S.
  • 18,288
  • 34
  • 56
  • Thx for the reply. Unfortunately my board has only a single 3.3V supply. For the opamp part I work around this with bias voltages, but I have no solution for the switch so far. – Woyzeck Feb 09 '24 at 20:08
  • 2
    @user1576088 since you probably don't need very much current, you could use very low-BOM-count switched cap converters to generate both +5V and -5V. – uint128_t Feb 10 '24 at 04:50
5

You can use a JFET or specialty MOSFET that doesn't have a body diode. Alternatively, you can use two standard MOSFETs back to back, like so:

schematic

simulate this circuit – Schematic created using CircuitLab

  • Thx, that's a good approach. Is there any integrated version of such switch available (with single rail supply) ? – Woyzeck Feb 10 '24 at 09:51
  • @user1576088 CMOS ICs can't accept input voltages lower than their lowest supply voltage due to substrate back-bias. It'll trigger SCR latchup if you try anyway. If you want to use an IC, you need a negative voltage. If you don't want a negative voltage, you need discrete FETs. – Jonathan S. Feb 10 '24 at 17:29
  • @JonathanS. - it might not be the most elegant solution, but would it work to place two SN74LVC1G3157DCKR in series, back to back ? – Woyzeck Feb 12 '24 at 10:37
  • @Woyzeck No, unfortunately that's not going to work either. The LVC1G3157 connected to the photodiode will still cause current to flow to ground. The parasitic current you're seeing is not flowing through the analog switch itself, but rather from the switch terminal to the IC's GND. This won't change as long as you expose any LVC1G3157 to a negative voltage. – Jonathan S. Feb 12 '24 at 13:33
  • @JonathanS. - thx for this explanation - that makes sense – Woyzeck Feb 12 '24 at 14:38