0
\$\begingroup\$

I have two different potentiometers. Each sets different voltage reference signal for a current source. How can I make an Arduino or any digital signal to switch between these two potentiometers? (No I don't want to waste power on a relay to switch a simple signal) A simple schematic is below:

schematic

\$\endgroup\$

5 Answers 5

1
\$\begingroup\$

An analog switch is often referred to as a "mux", "signal switch", or "bus switch." Something like the Nexperia XS5A1T4157GWH may be a good part choice for this application.

EDIT: I just realized you have +7.5V supply rails, and the max supply voltage for this part is +6.5V. So please don't actually use that part here.

EDIT2: Try Vishay DG419LE instead

\$\endgroup\$
3
\$\begingroup\$

With an analog mux or analog switch.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks, with a quick search I've found this: ti.com/lit/ds/symlink/… But I would still like to know the comparison of analog mux vs analog switch for this type of application. \$\endgroup\$ Commented Mar 4 at 19:23
  • \$\begingroup\$ Either will work. You can think one as only an on-off SPST switch so you need two of them and the other as an on-on SPDT switch so you need one. \$\endgroup\$
    – Justme
    Commented Mar 4 at 19:26
2
\$\begingroup\$

An analog switch IC seems appropriate for this application.

\$\endgroup\$
1
  • \$\begingroup\$ I've never known about them before, I am glad I asked to the forum. \$\endgroup\$ Commented Mar 4 at 19:28
1
\$\begingroup\$

I agree with the answers recommending an analog switch IC for the general problem, but here you can quite easily avoid that using two pots and your GPIO:

Schematic

Setting the MPU pin to input (which makes it a high-impedance pin) makes the voltage at LD only be a result of R1 in series with RV2.

Setting the pin to an output in "high" configuration makes the voltage at LD a result of all three resistors. So, you set the first voltage by adjusting RV2 while the pin is "disconnected", and set the second voltage by adjusting RV1.

\$\endgroup\$
7
  • \$\begingroup\$ Many MCUs have also DACs, but the question specifically was about switching between two pots. \$\endgroup\$
    – Justme
    Commented Mar 4 at 19:24
  • \$\begingroup\$ @Justme yep, and remember that most GPIOs can be set high-Z ;) \$\endgroup\$ Commented Mar 4 at 19:24
  • \$\begingroup\$ But no, even I switch off one of the pots, it will still be connected to LD pin and will affect the equivalent resistance. \$\endgroup\$ Commented Mar 4 at 19:26
  • \$\begingroup\$ LD on your IC is described as voltage input. It's fair to assume that the current flowing in or out of LD is pretty much zero, compared to what flows through R1, R2, RV1, RV2. It doesn't care about the resistance attached to it, only about the voltage at it: see the "Internal Block Diagram" on page 8 of the datasheet. \$\endgroup\$ Commented Mar 4 at 19:32
  • \$\begingroup\$ By looking at your updated answer I understood what you meant. But still, the pots in the same position will give different brightness and that's confusing for the user. Am I right? And sizing the pots differently as a solution is confusing for the designer (me) :D \$\endgroup\$ Commented Mar 4 at 19:34
0
\$\begingroup\$

Cheapest approach is to use something like a CD4052 (okay for 5V supply) or 74HC4052 (better for 3.3V supply, good for 5V too). Power the analog mux with your Arduino supply.

With the series resistors your inputs will never exceed 258mV so it's fine. Kind of a waste though. If you have an ADC that covers 0 to Vdd then you could simply connect the pot elements from 0 to Vdd and multiplex the wiper voltages. No resistors required.

Then do whatever those 560kΩ resistors are supposed to be doing in your firmware.

Analog switches have some series resistance (from 1kΩ to a few ohms or less depending on the part) and that resistance varies somewhat with the voltage so it's best to not load the output much. They don't have any offset voltage to speak of (microvolts), and very little leakage typically, so they're pretty good switches.

\$\endgroup\$

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