I am trying to make a puzzle where I have 5 terminals on the left, and 5 terminals on the right, and I have 5 wires connecting them, each with a different resistor value.
To solve the puzzle, the correct 2 terminals must be connected with the correct wire. I'm trying to figure out a way to accomplish this and am struggling to do so.
My thought was to use 5 digital pins as the Vin for a voltage divider and then cycle through, turning each on and then off, but my thought processes so far have not worked out (downloading fritzing now to show what I've been attempting). How do I verify both that the correct two pins are connected AND that they are connected by the correct wire?
As an added complication, I'd like the correct solution to have two of the left terminals connect to a single terminal on the right, leaving one terminal disconnected.
The 5 "jumper cables" are on the left, and the 10 terminals are on the right. Each terminal on the left needs to connect to a specific terminal on the right, using a specific jumper wire.
edit: Photo was too large, and the 5 minute rule is very unhelpful. It'd be nice if they'd let Newbies at least edit posts within the first 5 minutes.
I'm just dumb. I posted the link to the Imgur page, not the picture itself. If this doesn't work and no picture is visible and I don't respond, assume I've jumped out the window.
You don't really even need the resistors. Connect all the pins on the left to digital pins set as output and driven high. Connect all the pins on the right to digital pins set as inputs with the internal pull-up resistors enabled. Go through the output pins connected to the terminals on the left one at a time pulling them low. Each time you pull one low, go read all the inputs on the right and whichever one is reading low is the one connected to the pin on the left that you just drove to low.
OK, that's easy then. Same basic concept but analog inputs instead of digital. Instead of digital inputs on the right you have analog inputs that are connected to the terminals and to 5V through some common value of resistor. Now an unconnected pin will read 1023 as will a pin that is connected to one of the terminals on the left that is still driven high. Just as above, you drive the pins on the left low one at a time. All the analog inputs are going to read 1023 except the one that is connected to that terminal on the left that is driven low. Same as before. Only now, instead of reading low it will read some number that is characteristic of the particular resistor between the two terminals as that resistor and the one connected from the analog input to ground form a divider.
Delta_G:
Instead of digital inputs on the right you have analog inputs that are connected to the terminals and to 5V through some common value of resistor.
So each analog pin is connected to 5V through a common value resistor, but separately from the other analog pins, right? As in, I don't connect each analog pin directly to the others?
And thank you, this is what I couldn't wrap my head around. It didn't occur to me to use the 5V.
Larry that won't work because that makes all the left side terminals equivalent. As long as you hook the right resistor to the right terminal on the right side then it doesn't matter what terminal it is connected to on the left side.
I do like that solution, Danny. Though I ended up going with what Delta suggested, since it only required I change one solder connection in order to work.
allanhurst:
There are 5 x 5! possibilities - 600 .
It might take a little while to play this game....
Allan
Ha. Fortunately it's not a matter of simply guessing the correct answer. They are given more to go on. This is a small puzzle in an escape room.