Home Creators Posts Import Register Favorites Logout

Content

In this video, I'll show you how to create a puzzle in which players must use cables to connect the correct pairs of sockets together. When all connections have been made, the Arduino can release a maglock, play a sound, or activate any other sort of electronic device. 

It uses an Arduino, some LEDs, some 6.4mm headphone jacks and leads,  a 5v relay, a 12v maglock, and a handful of resistors. The code listing, documentation, and wiring diagram can be accessed by Patreons at https://www.patreon.com/posts/15900839

Files

Connect The Wires Escape Room Puzzle

Learn how to create a "Connect the Wires" puzzle commonly found in escape rooms, using an Arduino UNO and some 6.4mm audio connector cables/sockets. Documentation, including parts list, wiring diagram, and full code listing is available on my patreon page: https://www.patreon.com/playfultech

Comments

Keith DiBuono

Are you limited to 6 ports due to the availability of 6 pins on the arduino? or is there a way to increase the number of ports?

Djair Guilherme

First of all, I wanted to thank you for your work. I'm starting to build some props for Escape The Room and your site gave me a good kick start. I have now assembled a version of "Connect the Wire" and realized that when you plug the wire into pin 13 and pin 9, the LEDs on pins 3 and 4 light up. Also when I connect pin 13 to pin 8, the leds on pins 5 and 2 also light up, denouncing correct connections. This only happens with pin 13. I'll try to track the error, and if I find out anything, put it here.

Djair Guilherme

Done. I am using an Arduino Nano and pin 13 is onboard led. Just swap the contents of the arrays signalPins[numSockets] and ledPins[numSockets] and rewire everything. The new code will be: // The array of pins to which each socket is connected const byte signalPins[numSockets] = { 7, 6, 5, 4, 3, 2 }; // The pins of the LEDs corresponding to each of those connectors const byte ledPins[numSockets] = { 13, 12, 11, 10, 9, 8 };

Ashley Davis

I am trying to get the relay to reset ever time can that be done?

James Sheahan

Hi. What do you suggest using as a cheap power source for the 12 volt mag lock? Thanks.

R Vance

I am using a uno. I have pin 2-7 hooked to a 7 row led array. That changes when the puzzle wins what it says. It doesn't leave me enough pins 8 through 13 to put five connections so I need 10 pins. I do not need the LEDs cuz I'm using my display. how do I use A0 through A5 as digital pins to make up the difference so I can have my 5 connections. I heard you can change A0 through A5 to digital but I don't know how

Nikita Moiseev

Hey I tried making this puzzle with an Arduino Nano and the following differences -No LEDs -10 total Sockets (pins 12-3) -Using sparkfuns RFP30N06LE N-Channel MOSFET kit instead of the 5v relay <a href="https://www.sparkfun.com/products/12959" rel="nofollow noopener" target="_blank">https://www.sparkfun.com/products/12959</a> Now the puzzle works fine, I connect the MOSFET to the 12volt power supply with a common ground, use analog 1 to switch mosfet on and off. Now I wanted to run the arduino off of the same 12 volt power source, so I added another line from the positive end of the power jack to the VIN pin in arduino. This is when I started having issues, ranging from the arduino not executing the code when the puzzle is complete, or just straight out frying. Went through two nanos. Any recommendations? I've been able to run an UNO of a 12 volt power supply, but not sure why the nano is having issues.

Graham Lumley

Hi Alastair I'm also struggling with the code to switch a relay like the one in your using to work a mag lock, is it possible for you to send me the code. I have managed to modify a number of your great projects but struggling here with this.

Maria Garcia

Hello Alastair, I'm using an arduino UNO as you in your video. At the begging it worked great but now I'm having problems with the conections. When solving the puzzle, if you got 2 of the wires connected and first pin of the last one in the correct socket, it automatics solves the puzzle without connecting the last pin. I'm not sure what I'm doing wrong. Maglock is connected to a 9V power and the Arduino ONE is powered using it's USB conector with an adaptor to the AC. I've tried also to change the pins for if it was a conection problem but still the same. Could you pleas help me? I love all of your projects <3

Griffin Trenbeath

Here's a fun one. Everything works perfectly until I run it on an inverter. Pin#11 - Pin#10 : CONNECTED (should read not connected) Pin#9 - Pin#8 : NOT CONNECTED

Rares

hy alastair

Rares

my relay does not take of after puzzle done

Rares

hy again the same problem as maria

Rares

tryed to change pin 13 but still sa same until solve the puzzle everything good after the problems start

derek hampton

Hi Alastair I'm also struggling with the code to switch a relay like the one in your using to work a mag lock, I am using a 3v relay for now waiting on my 5v to get here to see if that could be the issue. But for the time is there anything in the code I am missing, I am using the one you have provided?

leomail

Hi Alastair, I made a combination on this puzzle, but now I only want to light 1 LED with a correct connection. Because I am short on ports on an Arduino (Uno, Nano, Mini) to make everything work. I almost have to buy a Mega, but maybe you can help me. Where in the code can I change this?

leomail

// The pins of the LEDs corresponding to each of those connectors // number of Leds only 4 // witch code should i change const byte ledPins[numSockets] = { 10, 11, 12, 13, A0, A1, A2, A3 };

leomail

I have found the solution. Enter the same port twice and it works. So simple afterwards. :-) const byte ledPins[numSockets] = { 10, 10,11,11,12, 12,13,13}

leomail

Look for the result in community, thanks Alastair.

Lori Alden

I, too, wasn't able to get the relay to release a lock once the puzzle was solved. The problem, I discovered, was that the Arduino code supplied only lights up the LEDs, as Alistair's model did in the demo. I'm a novice Arduino user, so to get it to work, I borrowed code from the Symbol Wheels puzzle.

Lori Alden

After this line: const byte ledPins[numSockets] = { }; I added this: const byte relayPin = A0; After this line: pinMode(ledPins[i], OUTPUT); I added this: // Initialise the output pins pinMode(relayPin, OUTPUT); digitalWrite(relayPin, LOW); After this line: puzzleState = Solved; I added this: // Activate the relay based on whether all wires are correct digitalWrite(relayPin, HIGH); It worked!