I'd like to know how to work out what rating each of the resistors in series would need to be in order to have 30 switches in the circuit. Through simply dividing 1024 by 30 I have worked out that each band would need to be 34 bits wide. SO how do I work out what resistor would give me that?
Thanks
P.S. I can't use more than one Analogue Pin by the way
Here is a way to "read" lots of switches all on one Arduino pin. I've used this to effectively identify 32 states using a single analog pin. (I was trying to insert a schematic from my computer, but I don't see a means to do that, so please try to visualize.)
Wire up a three resistors in series say, 4K, 2K, and 1K, in that order. Attach VRef above the 4K resistor, and put a 500 ohm resistor to ground below the 1 K. Attach the point between 1K and 500 ohm to an analog pin.
Now wire a bypass switch around each resistor. When you close the switch, that resistor exits the series arrangement. With three resistors as exemplified here, all eight states of open and closed switches provide 7K through 0 K resistance, in even steps, above the current limiting 500 ohm one. ( Each resistor added to the chain doubles the number of states.)
The analog pin can now read eight evenly spaced voltages, based on the positions of the three switches. This is effectively a binary counting scheme, but you may have to play a bit to get resistors which are multiples of a common lowest value.
To get reasonably close resistor values, I had to shave some carbon types to increase their resistance. Of course, exact values aren't necessary, and you can always use a lookup table associated with the various voltages read on the analog pin.
jrdoner:
Now wire a bypass switch around each resistor. When you close the switch, that resistor exits the series arrangement. With three resistors as exemplified here, all eight states of open and closed switches provide 7K through 0 K resistance, in even steps, above the current limiting 500 ohm one. ( Each resistor added to the chain doubles the number of states.)
The analog pin can now read eight evenly spaced voltages, based on the positions of the three switches.