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!
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.
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.