djsfantasi
- Joined Apr 11, 2010
- 9,237
@TeeKay6 just pointed out to me that the actual number of switches is 5, giving only 32 possible values. So each step is 3% from its neighbor. Quite an improvement over 0.4% and possibly doableWhat djsfantasi is talking about is a very specific configuration of resistors known as an R/2R ladder. It is a very old means of implementing D-to-A converters. Google it.
The problem you will have with a discrete R/2R network is accuracy. Since there are 256 possible values, each step is less than 0.4% of the range from it's neighbor and that means that the absolute accuracy of your network has to be better than about 0.1% in order to decode the correct values. Not only does that means that you have to have high precision resistors, but also a VERY stable voltage source for your switches (it must also be within 0.1% otherwise you are screwed right from the start) and it must be sufficiently low output impedance that it will stay within 0.1% whether none of the switches are pressed or all of them are.
The problem here is that, unlike most D/A applications where if you are off by a couple of steps nothing happens other than your measurement has a small amount of error, for this application you MUST decode it absolutely correctly every time and being off by just a single step means you will not determine the switch settings correctly and may well get most or all of them incorrect.
The Arduino ADC has a 4mV resolution. The steps are 150mV wide. So it should definitely be doable.
Thanks for your advice on Googling R2R. I’ve mentioned that 2-3 times.
Last edited:
