External pull-up and pull-down using I/O extender?

I have an arduino data logger design with 8 analog pins/digital I/O pins. I have 10kohm external pull-up resistors on some of the pins to sense resistance, such as thermistors. 10kohm 1% resistors are a lot better than the arduino internal pullup that is kind of 40kohm but not exactly it.

Plus, when I run one-wire sensors, a 10kohm will work in place of 4.7kohm required value but internal pullup doesn't work.

In a newer design, I have 8 arduino pins that I want to have one 10kohm resistor connected to each one of them. First I thought of having an 8-bit dip switch on board to enable/disable these pullup resistors. There isn't enough space for that and plus, you have to open the data logger's case and flip the switches in order to reconfigure. So I thought why not using an 8-bit I/O expander? I can have one end of the resistor connected to an arduino pin, the other end to one I/O pin on the expander. The expander is I2C interfaced. So if I want pullup, I tell that I/O pin to be output and high, or if I want pulldown, I will tell that pin to be output and low. If I don't want the resistor, I tell the pin to be input. This way I can programmatically change the pullup/down settings.

I thought this should work. Anyway, there is no shame in asking for advice from the community. So is this a correct solution?

FYI, here is the chip I am considering: http://www.adafruit.com/products/593

Open the datasheet. Navigate to the D090. I read that as there will be as much as a 0.7V drop from VDD at a modest 3mA current. That may be OK for 1-Wire but that is probably not OK for thermistors. It certainly makes it pointless to use 1% resistors.

You really need MOSFETs with an especially low on resistance. That way they essentially turn into a wire when enabled so you can ignore them.

That figure means the pin has a maximum output resistance of 233 ohms when high, so if you add a 10k resistor it will behave anything from 10000 to 10233 ohms.

Thanks CodingBadly. That number seems to be the minimal voltage for HIGH. I happen to have a couple of these ICs in PDIP packaging. I’ll give them a test with thermistors. I thought about transistor arrays for a moment but I couldn’t find what I really need with too many parameters on digikey. On my data logger board, I use this to slowly switch on the 5V rail when the logger is inserted into USB:


Figure 3 and 4 on page 3 seem to indicate a fraction of ohm for low current and 5V system. Will this work?

MarkT, I’ll do some measurements with 10kohm resistor and 10kohm thermistor so I will get some realistic numbers to report back.


Got results:

Testing MCP23008

Meter: Fluke 187 Supply voltage: 5.030V Logic HIGH: 5.030V Logic LOW: 0.000V Logic HIGH with 10kohm resistor and 10kohm thermistor: 5.017V Logic LOW with 10kohm resistor and 10kohm thermistor: 0.000V With 10kohm resistor and thermistor, the effective DC resistance: 52ohm, or 0.5% of the 10kohm fixed resistor.

I think this will satisfy my design goal of a couple of percent of error in resistance value.

I'll test the one-wire temperature scenario and post my test results.

You are assuming your device is representative of all devices - the datasheet max/min values are the ones that apply to all instance of the device across the relevant temperature range, should that matter.

For two inputs, I did something similar using two H11F2 opto fets a few years back.

MarkT: You are assuming your device is representative of all devices - the datasheet max/min values are the ones that apply to all instance of the device across the relevant temperature range, should that matter.

I'm kind of disappointed with Microchips. The data sheet doesn't even have graphs of output voltage vs current so we only know the worst case scenario of VDD-0.7V at 3mA and 0.4mA. My current is 0.25mA so in principle the spec sheet doesn't even apply. I like the atmel graphs that tell me everything, such as output voltage vs current at various logic voltages 5V, 3.3V etc. so I know if I am doing 40mA then the output voltage is XXX. No need to measure everything (single sample vs. stats.)

I will do some more testing with the other pins, another PDIP IC, a couple of 23017 (16-port) and get some SOIC18 and hire a student!