0
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

LM358

positive rail: 24V

negative rail: -1.250V

Input voltage: -1.250 - ~20V

  • Is this the right way to switch between gain of 10 and no gain (simple buffer)?

  • \$G = 20/2.2 + 1 = 10.09\$ still not a 10, is there a better combination of standard resistors values to achieve gain of 10?

\$\endgroup\$
  • 1
    \$\begingroup\$ Why not simply use either a programmable gain amplifier that you control from the MCU, or simply a DAC, in this case, a multiplying DAC, following a fixed-gain amplifier? That would be very easy to do, since you already have an MCU pin. \$\endgroup\$ – Marcus Müller Nov 8 '19 at 18:34
  • 2
    \$\begingroup\$ It would help to provide requirements for the circuit: power supplies, input voltages, bandwidth, etc. As for choosing particular resistors, this voltage divider calculator is useful. \$\endgroup\$ – Null Nov 8 '19 at 18:35
  • \$\begingroup\$ @Null added some more information. \$\endgroup\$ – ElectronSurf Nov 8 '19 at 18:55
  • \$\begingroup\$ how do you deliver negative voltage here? \$\endgroup\$ – user2497 Nov 10 '19 at 21:54
2
\$\begingroup\$

Better approach:

schematic

simulate this circuit – Schematic created using CircuitLab

The control is opposite from yours — when the low, the gain is 1, and when high, the gain is 10 (note the modified resistor values). In this configuration, the MOSFET is perfectly happy to have both positive and negative voltages on its drain, as long as the signal voltage is not high enough to turn on the body diode. Otherwise, you'll need to use a bilateral switch (IC).

\$\endgroup\$
  • \$\begingroup\$ The voltage will be around 24V, is it too high? \$\endgroup\$ – ElectronSurf Nov 8 '19 at 18:51
  • 1
    \$\begingroup\$ Yes, that's too high for the body diode. It's also too high for any commonly-available switch IC, so the relay is probably your best bet. \$\endgroup\$ – Dave Tweed Nov 8 '19 at 21:47
2
\$\begingroup\$
  1. It's a pretty terrible way. The BJT has some offset and the base current will affect the output. A MOSFET would work better, but only for positive outputs, and the MOSFET has to have a low enough Vgs(on).

    I would suggest using an analog switch, but the details depend on the power supply rails and input logic level. In particular you should avoid running any current (other than op-amp bias current) through the switch, so something like an SPDT switch is best. You might also have to add a bit of capacitance in the negative feedback path to ensure good phase margin.

  2. 16.2K for R2 and 1.05K in series with 750 ohms for R1 has zero nominal error and uses standard E96 values. Alternatively 18K for R2 and 2K for R2 uses standard E24 values and only two resistors.

\$\endgroup\$
  • \$\begingroup\$ How about a relay? \$\endgroup\$ – ElectronSurf Nov 8 '19 at 18:31
  • 1
    \$\begingroup\$ Yes, a mechanical relay would work fine, provided it's a type designed to switch rather low voltages and currents reliably. \$\endgroup\$ – Spehro Pefhany Nov 8 '19 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.