# Resistor chain substitute

We have to interface with a device that is expecting a chain of 34 Ω resistors with switches connected to the input pins as shown below.

There is no information on the internal schematics of the device, but there is 10 V present on the open circuit and when shorted the current is limited to 5 mA. The documentation mentions "maximum input voltage 34 V", which is weird, since we are not expected to supply voltage to those pins.

My first thought was to simply emulate the suggested circuit with analog switches (like ADG715) and a bunch of resistors. Then I thought of digital potentiometers (like AD5254), that do not need resistors.

The problem, however, is that all these chips have analog voltage limits pretty close to their digital supply lines. So, it seems I need either a way to add a high-voltage-tolerant output stage to the digital pot, or use a completely different approach, like a DAC + VCR (voltage controlled resistor). Unfortunately analog circuits are still my weak spot; I'm not sure I can design a FET-based linear VCR properly.

Any other options I have missed? I should also mention that simplifying the circuit and reducing cost are important to us.

• What do you know about the voltage that the device applies? Is it AC or DC? Maximum current? Is this some kind of automotive gauge? Dec 21, 2022 at 19:46
• @SpehroPefhany The measured voltage is 10VDC. The documentation mentions maximum input 34V, but I don't know what they mean. The device is powered by 24VDC, so this does not look like pull-up to power input. Could be current source or could be their internal working voltage. Maximum current when shorted out is 5mA. This is not a single device actually, this is wheelchair power system with several modules having control inputs for external switches. Dec 21, 2022 at 19:56
• So your schematic is wrong if it provides current, which makes any answer pointless. Dec 21, 2022 at 20:05
• @StainlessSteelRat I have no idea what you mean. Care to elaborate? It is not my schematics. It is the circuit suggested in device documentation. Dec 21, 2022 at 20:08
• We don't really know enough about the circuit, I think. It's possible a simple 0-3V voltage could replace all that stuff if it could sink the 5mA. The resistances are a bit low for analog switches that can handle >10V, and much worse if you try to put them in series rather than as shown. Dec 21, 2022 at 20:12

simulate this circuit – Schematic created using CircuitLab

Choose some suitable MOSFET and, as long as CI is always positive relative to CI return, it'll work. If CI can go negative, you'll need bidirectional switches instead of MOSFETs, for which you could use certain types of solid-state relay or SSR-type optocoupler.

• This should work. Although the goal was to reduce a number of components, not increase it. We have 4 channels, so 68 FETs and 68 resistors would be quite expensive, even if arrays were used. Dec 21, 2022 at 19:22
• @Maple Depending on precision needed, I can find 34 Ω resistors in bulk for less than $10 for 5,000 of them, and suitable MOSFETs for$16 for 100. That's not that expensive in my book. You'd be paying more on the circuit board (say \$150 from a cheap fab) than on the parts. Dec 21, 2022 at 19:31
• You are right, the cost would not be a factor in mass production. But the PCB size would grow unnecessary. I was rather hoping for some kind of "current mirror" type of circuit, only with voltage input on one side and variable resistance independent of the applied voltage on the other. Then one 4-channel DAC chip can drive four such stages Dec 21, 2022 at 19:46
• Oh, and yes, CI is always positive relative to return. In most devices the return is internally connected to ground (24V battery "-") either directly or via fuse, as far as we can tell from documentation. Dec 21, 2022 at 20:12

One option to cut down on the number of switches and resistors would be to use a binary chain like this:

simulate this circuit – Schematic created using CircuitLab

Start with all switches closed, then open them in a binary pattern to add in resistance. For example instead of 6 x 34$$\\Omega\$$ resistors to get 204$$\\Omega\$$ you would open SW2 and SW3.

The last resistor is 34$$\\Omega\$$ because the original has 17 steps, so you need one extra 34$$\\Omega\$$ step than a 4 bit arrangement would give, but it could also be 544$$\\Omega\$$ to get even more steps.

• Wow, very neat! Did not think of this. Dec 21, 2022 at 19:58
• @Maple If you use a micro and digitally controlled switches you can just program the correct patterns to open them for any multiple of 34 ohms. Dec 21, 2022 at 20:01
• Small downside to this one is that the switches now have to be floating; you can't use a simple FET driver for them as any switch could be at any voltage from 0 to 34 V. If that's fine (like if you're using optorelays), this is probably better than my suggestion, but it may mean using a few more parts than it looks like here. Dec 21, 2022 at 20:02
• Yes, I've noticed that part. It was original problem with both switches and pots. But if the number of components in the high-voltage output stage can be reduced to this then optocouplers or reeds can be a viable solution Dec 21, 2022 at 20:06
• @Hearth Yeah, that's the one thing with this, you need to use something that acts like a real mechanical switch, such as a relay. Dec 21, 2022 at 20:07

As for Digital Potentiometers, Microchip have some High-Voltage versions which have an analogue supply voltage of 10V to 36V, in the High Voltage (>10V) Digital Potentiometer Products.

E.g. a MCP41HV51T-502 with 8-bits and a 5 k$$\\Omega\$$ resistor will give a Step Resistance of 19.6$$\\Omega\$$. Some issues with using a Digital Potentiometer directly could be:

1. Finding a step size which allows all 34$$\\Omega\$$ steps to be reliably generated, allowing for tolerances.
2. At reset how the initial resistor string value is set and what effect that has on the device being controlled. This Microchip range are all have Volatile memory. At reset they default to a mid range resistance setting.

Also, since the application is for a wheelchair power system, are there any functional safety requirements which need to be met?

• Yes, I have found those chips myself too, as well as some 30V from AD/Maxim. And yes, there is the problem with getting the value right. Most chips begin at 10k or 20k, and very few of them have 1024 taps. One solution I've mentioned in the comments would be to put two (or more) pots in parallel and use them to fine-tune combined resistance. Dual/Quad chips are great for this. There are dozens of safety requirements, of course. I am working on those separately, trying to keep the question straight on one point only. This usually yields better results here. Dec 22, 2022 at 14:26
• Also, regarding safety, these ports are designed for user-operated button pads. The golden rule of any human interface is that if anything can be pressed in a wrong time, it will be pressed eventually. So, the safety is implemented on the device side, giving us an opportunity to properly initialize interface. Dec 22, 2022 at 14:49
• I did some calculations and a couple 5k Microchip would have worked. They skip first band due to high wiper resistance but the rest fits nicely. Unfortunately they are impossible to source nowadays. The AD/Maxim chips begin at 10 or 20k and cannot be used. Dec 24, 2022 at 15:44

Similar to GodJihyo's answer, but making it possible to use simple logic-level MOSFETs for control:

simulate this circuit – Schematic created using CircuitLab

The idea is to have a +15V supply, which is at least Vgs higher than the maximum voltage put out by the device (10V). I'm assuming logic-level MOSFETs that turn on at 3V and can take a 20V gate voltage (for example PJA3404).

Normally R1-R3 pull up the gates of Q1-Q3, resulting in a direct short. Device sees 0 ohm resistance, equivalent to S1 being closed.

If e.g. IO0 is turned high, Q4 pulls down the Q1 gate and the device sees 34 ohm resistance. Turning on all of IO0, IO1 and IO2 will result in 34 + 68 + 136 = 7 * 34 ohm resistance.

This schematic can be expanded to any number of bits. If infinite resistance is needed as option, one extra MOSFET should be added between the lowest resistor and ground (it can be driven directly by IO pin).

• I have to use GPIO expander to control a bunch of signals anyway. If I can find one with OD outputs that can tolerate 15V, then I can drive the gates directly. It would make this solution quite compact Dec 22, 2022 at 21:32
• I've accepted @Hearth answer because it was most cost effective and we already implemented it in a working device. However I'll keep this in mind because it is actually easier to interface with MCU, since digital value written into IO port will set port pins into binary combination suitable for direct driving of the FETs, no decoder necessary. Thank you. Aug 31 at 3:50