Go Down

### Topic: Even voltage output steps with parallel resistors (Read 8931 times)previous topic - next topic

#### jtpek

#30
##### Feb 04, 2015, 03:10 pmLast Edit: Feb 04, 2015, 03:11 pm by jtpek
Of course the values of the resistors don't have to be the same. I have experimented with different kinds of resistors (resistors of different values), but haven't figured out the right combination yet..and I can't calculate it either

My main goal is to measure which blocks are present and which have been removed. I don't know how to explain it better

#### dlloyd

#31
##### Feb 04, 2015, 03:26 pmLast Edit: Feb 04, 2015, 05:49 pm by dlloyd
Just measure current. Current will increase in equal steps as each additional block is added. This example shows a setup that is limited to 50 blocks, could easily increase this limit. For example, with current sensor at 20mV per mA, there would be approx 4 count increase in the ADC value for each additional block, allowing for about 250 blocks stacked maximum.

#32
##### Feb 04, 2015, 04:11 pm
Can measure voltage.
Here is example with 1K and 10K resistor in the block.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### dlloyd

#33
##### Feb 04, 2015, 05:47 pmLast Edit: Feb 04, 2015, 06:16 pm by dlloyd
Not equal steps in voltage, but the example has >2 count change per block (up to 100 blocks).

Use 0.1% tolerance for R1 and R2. Depending on max stacked blocks, could adjust values to get >3 counts ADC per block. Easy to determine number of stacked blocks in code by using a look-up table or conditional statements.

Trade 5V and GND connections for increasing voltage, or reverse the reading value in the sketch (preferred).

#### polymorph

#34
##### Feb 04, 2015, 06:37 pm
I like the capacitor idea.

I'm also liking the method whereby you measure the current. Equal steps per resistor.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8

#### raschemmel

#35
##### Feb 04, 2015, 07:30 pm
Quote
If only we can get the OP to reveal his real problem
Why do you want to do this ?
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

#36
##### Feb 04, 2015, 07:48 pm
Quote
My main goal is to measure which blocks are present and which have been removed.
If the blocks have different resistor values, then the analogRead values will be quite varied and not merely dependent on the number of blocks attached.

5 blocks with 5 values will yield:
00000 no blocks
00001 a
00010 b
00011  ba
00100 c
00101 ca
00110  cb
00111  cba
01000  d
01001  da
01010 db
01011 dba
01100  dc
01101  dca
01110 dcb
01111 dcba
10000 e
10001 ea
10010 eb
10011 eba
10100 ec
10101 eca
10110 ecb
10111 ecba
11000 ed
11010 eda
11011 edba
11100 edc
11101  edca
11110 edcb
11111 edcba

You could read the voltage and then look up what combination results in that voltage.
Resistors will have to be carefully selected to ensure there are no duplicate voltages created.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### raschemmel

#37
##### Feb 04, 2015, 10:21 pm
Quote
My main goal is to measure which blocks are present and which have been removed.
Yes, I know that. My question was WHY ?
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

#38
##### Feb 04, 2015, 10:22 pm
Does it matter why?  I think not.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### dlloyd

#39
##### Feb 04, 2015, 10:35 pmLast Edit: Feb 04, 2015, 10:46 pm by dlloyd
Another suggestion for the OP (to combine with current sensor suggestion) ...

Use translucent blocks:

Use super bright white led (i.e. C512A-WNS/WNN) (or similar) in series with R1=1K (for 1.8mA).
When block is attached, led illuminates (approx 10%, 1585mcd).

After Arduino read/calculated the number of blocks, it could blink the LEDs in a sequence of pulses totaling the block count. LEDs all on during next measurement cycle.

#### Paul__B

#40
##### Feb 04, 2015, 10:37 pm
The uncertainty here is still whether the OP wants to know how many blocks are stacked - in which case, equal resistors - or which blocks are stacked, in which case it becomes far (exponentially) more difficult.

And if he wanted to know the exact order, then you need a processor (effectively an ASIC) in each chip with separate "in" and "out" connections.

#### jtpek

#41
##### Feb 04, 2015, 11:54 pm
Thank you all for great advice and goos ideas!

I have to clarify: the blocks are ALWAYS in the same order. Block no. 1 is on the bottom, then comes block no. 2, no. 3 and so on. I just want to measure how many blocks are stacked.

#### raschemmel

#42
##### Feb 05, 2015, 12:47 am
Quote
Does it matter why?  I think not.
Quote
And if he wanted to know the exact order, then you need a processor (effectively an ASIC) in each chip with separate "in" and "out" connections.
That's why I asked why. I was thinking of an I2C register in each block , similar to how
ONEWIRE reads the 64-bit ROM  code in the DS18B20s when they are all connected to the same onewire bus.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

#### Paul__B

#43
##### Feb 05, 2015, 03:32 amLast Edit: Feb 05, 2015, 05:46 am by Paul__B Reason: Hit wrong key previosuly, ran out of time!
That's why I asked why. I was thinking of an I2C register in each block, similar to how ONEWIRE reads the 64-bit ROM  code in the DS18B20s when they are all connected to the same onewire bus.
And in fact, that is an excellent idea - the "One Wire" chips are made for exactly that purpose, you can and in fact do use them on a (two wire   ) parallel bus and you will know exactly which are connected and which are not.

They make key fob versions and door-post sockets so that these can be used as a difficult-to-spoof ID key.  Prox-cards (RFID) have now superseded these but I have seen them on door-posts from time to time.

They do not however identify in which order they are connected but of course jtpek has indicated this is not his concern.

In fact, parallel resistors will do him just fine with a pull-up resistor.  If he really wants this to be "linearised", then a "virtual ground" with an op-amp will do the job.}

#### raschemmel

#44
##### Feb 05, 2015, 06:20 am
I'm thinking this is a product R&D and the resistors keep the cost down. An op amp is cheap so I guess that
answers my question about WHY ? If the answer had been, " I'm doing R&D for a product, I would have said "there's a better way but it probably costs more ..."

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Go Up