# How to build a digital potentiometer with standard value resitors and MOSFETs?

I like to create a digital potentiometer with standard value resistors and MOSFETs.

The principle is easy: I put a lot of resistors in series and parallel to each resistor I have a MOSFET which shortcuts the resistor. Then I control the MOSFETs with digital signals from an Arduino.

I tried this with 3 resistors and 3 MOSFETs and in principle it works fine.

For my project I want results from 300 Ohm to 100k Ohm with 1% tolerance for each value. With 100k Ohm this means only 1k tolerance, no problem. But for 300 Ohm this means maximum 3 Ohm tolerance!

I guess the theoretical easiest approach is to use resistors like 1, 2, 4, 8, 16, 32, ... Unfortunately most of those values are not or very difficult available.

So my idea is to use standard 1% resistors like 10, 15, 22, 33, etc. They are easily available. But if I use every E6 series value between 3Ohm and 68k Ohm I end up with 26 resistors and 26 MOSFETs and 26 digital outputs. That's a lot!

So now my question is: Did anybody have a similar problem and figured out how many of those resistors are actually necessary to archive the goal to have the outputs mentioned above. I am sure I don't need all the values. But which once can I skip. I would be able to get reasonable results by letting my PC do the work and just try all combinations. But that's not very scientific and maybe there is a better way.

My question: Which commonly available resistor values do I need to archive accurate in series results between 300 Ohm and 100k Ohm with max 1% tolerance?

This question is similar to the following but it's not the same.

Logarithmically-spaced resistances using switches

Electronically switched decade resistance box design

I looked at available digital potentiometer. I didn't find what I want for two reasons. Many of those digital potentiometer ICs have 20% tolerance! Best case I found 4% tolerance. Most of what I found are linear, not logarithmic. And many, maybe all, allow only very little current. I found 1mA max current. That is not enough for what I need. I need at least 5mA current (long time).

I use MOSFETs because I read they are the perfect switches. My current test was with MOSFETs which I had already which have 22 mOhm resistance when closed. Now I ordered (still cheap) MOSFETs with 3.5 mOhm resistance (STP105N3LL). Maybe there are better options to switch just a few mA. Suggestions are welcome.

If I need lots of I/O lines I will use 16 bit I/O expander like these: MCP23S17-E/SP or MCP23017-E/SP

In my case I need this for max 5V DC and the switching speed is not critical.

Any suggestions are welcome. Thanks!

Edit: My application is that that I want to emulate a NTC. In my current case it's an existing NTC which is on one end on GND and on the other end connected to an electronic device which I can't change (black box). That device uses likely a 2.2kOhm Resistor on a voltage divider and then an ADC.

But in the future I want to be able to use this to emulate other NTC independently how they are connected. I want to be able to have a device which looks on the outside like a 353 Ohm resistor or a 43k1 resistor, independent on how the outside electronic actually works. These are just example values

• What are you going to control with this pot? Why not make a variable resistor using one FET? Commented Mar 31, 2019 at 12:25
• It sounds like you're talking about a variable resistor (2-terminal device) rather than a potentiometer (3-terminal device). What's the application? Commented Mar 31, 2019 at 12:56
• @Transistor: Truth to be told I don't know how to do this with just one FET and Arduino digital outputs with high precision. Maybe you can direct me to some sample or the right keywords. Commented Mar 31, 2019 at 13:27
• I note that you haven't answered two requests for details of your application. This will determine whether my suggestion would work in your application. It's important to read the comments carefully and try to answer them. Pop the information into your question rather than buried in the comments. Commented Mar 31, 2019 at 13:32
• I just edited the question with information what I want to do. Commented Mar 31, 2019 at 13:34