I have a device that can have different things plugged into it. I'm trying to use a resistor on these things to uniquely identify the thing. That is, if I plug in Thing A, I can read the resistance as 100Ohms and know that it's a Thing A. If I plug in Thing B, I can read the resistance as 200Ohms and know that it's a Thing B. I know resistance varies with temperature, and tolerance, so I want to have some wiggle room on each unique code.
I'm using a voltage divider and an ADC to measure the resistance. Assuming I have a constant 3V input, a 12 bit ADC reference of 2.5V, I will use resistors with a 1% tolerance, and I want as many unique codes as possible, with a small gap in between each, how do I calculate how many unique codes I can get?
I was first thinking that I could use a 2k resistor, and then the second resistor could be anything from 0 to 10k. With 4095 steps in 12 bits that means .6mV per step. At 1% tolerance, that means the top bin could be anything from 9900 to 10100, so 200 ohms wide. That's only 80 bins, though. However, a 100 ohm resistor would only vary from 99-101, or 2 ohms wide, so a linear formula is clearly not appropriate.
How can I figure out the correct number of unique bins that I can reliably detect?