Using Arduino to change resistors in a circuit

I am trying to use an Arduino to automatically measure temperatures. My circuit is just a voltage divider with the bottom resistor (R2) being a thermistor. I am using the 3.3V supply for power because it is more stable than the 5V and I get better data. I have the basic circuit working, but I am trying to measure temperatures from 20C to 80C with one circuit, so my resistance varies from 2800 to 280 ohm. This means if I pick a R1 value in the middle then the ends of my range are not super accurate.

My solution is, in theory, to swap between different R1s. My first thought was to use transistors (or something similar) to switch to a different resistor. Without testing anything, I assumed the transistor would affect the resistance value and cause inaccuracies in the measurement. After doing some research I found out about digital potentiometers, and I thought they would be perfect, but then I saw they have an accuracy of 20% (unacceptable).

So here I am, not sure how to proceed. How can I accurately change the value of R1 using the Arduino? If anyone can help me figure this problem out, I would greatly appreciate it. Thank you so much!

You could use relays. Relay contacts are very low resistance.

  • You could use a miniature relay.

Old school, but very reliable:
Use a relay to switch between resistors.
You can't drive a relay directly by your Arduino' s output pin so you'd have to use a transistor and an accompanying resistor to do that.
And a flyback diode antiparallel to the relay to protect the transistor from the relay's back-EMF.

Edit:
I guess that must be the right thing to do, got the same reply 2 times more while i was typing this message.

I would suggest using a reed relay because of the low current requirement for the contacts.

Does your Arduino have more than one A/D converter pin? if yes, use one for each measuring range. Separate thermistor/resistor pairs. Use software to decide when to use each.

The rational ADC works best with Vcc as the ADC reference and voltage divider supply voltage.

You can do so by connecting each resistor to a GPIO pin and set that pin to input (high Z) or to HIGH or LOW output.

Use a low Rds(on) MOSFET

Maybe you could use analog switches (i.e. TS5A23159) to switch between the individual resistors.

You’d be better using something like a DS18B20 accurate out the box and no lead resistance or linearity type issues

Connect where?

Isn't a GPIO output MOSFET low enough?

Tell me what it is and I'll make a guess.

Don't guess, simply subtract it from the resistor value.

The data sheet says worst case 0.8V @ 20mA

That would imply 40 ohms and represents a 14% error at 280 ohms

I would guess it is not low enough.

Why are you telling me how to do it. You should be explaining your solution to @dsengineer

So the resistor should be reduced to 240 Ohms.

The rest is done in the always required sensor calibration. Without calibration all more elaborated circuits are not really better.

The digital output pins give 5V, do they not? This should be plenty to trigger most SSRs. Am I missing something?

Depends on the Arduino.

This should be plenty to trigger most SSRs

Depends on the SSR.