Kind of difficult to explain what I'm thinking, but basically - what's the easiest way to detect how long a path of circuit is?
Basically, if I wanted to put wire on, say, Jenga blocks, and then be able to tell how many jenga blocks are ontop of eachother, what would be a solution? Hope that makes sense.
If the wire has a known resistance per unit length then you could measure the resistance and calculate the length from that. To be usable in practice, the resistance would need to be fairly high so you'd need to use resistive wire, not ordinary copper wire. If the wire is connected in discrete segments you could use an ordinary resistor in series with each segment to give you the known resistance.
You could send a signal through the circuit, and time how long it takes to get back to the other side.
You'd need pretty long circuits in order for the Arduino to detect the difference, though. In the neighborhood of 18 meters per clock cycle. That's some serious Jenga blocks!
what's the easiest way to detect how long a path of circuit is?
There is no easy way to do this. All the ways are hard.
Basically, if I wanted to put wire on, say, Jenga blocks, and then be able to tell how many jenga blocks are ontop of eachother, what would be a solution?
There would be no solution that you could do with an Arduino.
The best way is with time domain reflectometry:-
Nick Gammon has done some work with the input capture unit, of course. You would need to mess with it to get single clock cycle accuracy, and I don't know if that's even possible, but his tests got less than 2 clocks accuracy. Which is pretty darn good.
Riva, could you tell me more (or point me to somewhere I could read) about these dedicated chips that can do 45 ps readings? Specifically, what are they called, and how much do they cost?
TanHadron:
Riva, could you tell me more (or point me to somewhere I could read) about these dedicated chips that can do 45 ps readings? Specifically, what are they called, and how much do they cost?
The chip I am talking about is the TDC-GP22 and you can see some incomplete testing with one here.
That was some interesting reading! This interests me because I'm always looking for new ways to do distance measuring. One of my long term projects is the autonomous lawn mower, but so far accurate positioning is still too expensive. That's a subject for another thread.
But this TDC-GP22 chip: The source link you put on your other thread is outdated. I had a chat session with the only distributor in the US, and the price they quoted me was a bit more than what you posted back in February. Is the place where you got yours still available?
For the OP:
The best way would be to have each block have a little arduino in it that reports its size to the one below it along a common serial line.
For example:
The base sends a command saying "report your height!" If it hears nothing come back, the height is zero. If one block is there, when it gets the "report your height!" command it sends the command on up the chain. If it hears nothing, it reports its own height. If it gets a number back, it adds its height to it and sends it on back the chain.
You could also send back a string of numbers, one for each block, to know the number of blocks and the aggregate height.
As is often the case we need further information but the OP has disappeared.
If it's the normal random stack of blocks I think this will be very difficult, something like what KeithRB is proposing I guess but the logistics of powering all the CPUs and making reliable connections will be a drama.
TanHadron:
But this TDC-GP22 chip: The source link you put on your other thread is outdated. I had a chat session with the only distributor in the US, and the price they quoted me was a bit more than what you posted back in February. Is the place where you got yours still available?
The 2K1 site is still listed on the ACAM website as the only UK supplier but the link seems dead. I do recall getting an email from some company a few weeks ago saying they had taken over 2K1 but I just deleted it as spam.
Maybe worth trying here but I have never used Aliexpress to comment if they are any good.
If you don't mind me asking what was the US site quoting?