Resistor detection with an Arduino and three relays switch between four known resistances for better accuracy.