Eight analog voltages as simple (fewest parts) as possible?

Status
Not open for further replies.

blueroomelectronics

Well-Known Member
I'm looking at the datasheet for an I2C expander IC MCP23009 and it uses a single pin with a voltage divider (two resistors ~5% tolerance) to determine the I2C address.

For 3 address a three post jumper with a resistor divider would work. Shorting out a resistor would give 0 or VCC and no jumpers would be the voltage from the divider.

Any ideas on how to get all 8 addresses? A simple trimpot seems a little inaccurate IMHO.
 
I am thinking bill is looking for some min combination of resistors that will give him the 8 voltages in even steps from VSS toi VDD. The obvious one and upper limit is 7 resistors and 8 jumpers.

we need taps at these % which are steps of 1/7th

0
14 1/3
28 2/3
43
57 1/3
71 2/3
86
100

With 7 equal resistor it is easy.

We can do it with 6 resistors but it is not worth the pain and maybe someone else can improve on it.

But given that I did the work here it is. Imagine our 7 resistor solution

*R1*R2*R3*R4*R5*R6*R7*

Construct the left side and the right side of the divider with 3 resistors of 1 2 and 4R and jumper so we can include or exclude each resistor. I used 2 way solder pads in the example.
One can get any node * by setting the left and right chains to have the sum of the resistors on its side. For example to get the node between R2 and R3 we jumper the left to be 2R and the right to be 5R.

View attachment 67800

I neglected to put the sense point in the very center of the bottom schematic but it is not hard to figure.
 
Last edited:
A ladder of 5 resistors (in the ratio 1:2:4:2:1) and 3 jumpers will do it.
 
I know its a little more, but the pic12f1840 (8 pin) has a 32 level DAC output...
 
We are counting jumpers differently. Using your method of counting the original 7 resistor 8 jumper solution is 7 resistors and 1 jumper.

I can not speak for Bill but having 1 shorting block with possible positions 1 2 3 4 5 6 7 8 is worth the extra resistor.
 
Some really neat ideas here, the complexity of the 5 resistor solution vs the 7 resistor 1 jumper block solution is better from most end users pov.

Can't use the PIC DAC as the project also supports the ATmega328 & Raspberry Pi. It's also possible to have as an extender from another board sans MPU.
 
How about putting a little PIC on your board and let people talk to it by SPI or the UART depending on what they are comfortable with. It could help out in other areas as well.
 
I've put some thought into it and will probably go with the old school PCF8574A I/O expander. The open collector output or 5V tolerant input made the MCP23009 desirable.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…