Intro: The ULTIMATE Rotary Phone Puzzle / Controller for Escape Rooms, Info Kiosks, or Just Fooling Around.
During my daily scour of Craigslist searching for deals on odd things I accidently clicked on the 'Gigs" section.
On the first page I saw an ad that must have just been posted asking for the assistance of an experienced Arduino Programmer.
Now while I have been playing with them for several years I didn't consider myself experienced because I never coded anything for professional use but I thought , "what the heck" and I replied to the ad.
It turned out that the poster was a business owner that had hand crafted an amazing 4 theme multi room Escape room complex in a location on mainstreet in my town. Now I thought that the place was unoccupied for almost a year but behind the brown paper he was converting the space into 4 unique high quality experiences.
He told me that he's searched the Internet and attended several trade shows throughout the country only to find props and game components being either shoddily constructed, or straight out of China.
While he was able to build an extremely high quality establishment, he was still not able to bring all of his ideas for the props to life.
I set to work to build him a rotary phone controlled puzzle as a component of one of his themes.
I searched the internet, github, and even instructables to try to find others doing this sort of thing.
I soon realized that while several have dabbled, they all seemingly fell short to what I wanted to achieve.
Of course I wanted to decode the rotary dial and check the number against a predetermined number.
That would be the "password" or "correct" number that would of course cause one of the digital pins to change state, triggering either a mag switch, relay, or LED.
Thats was all fine and dandy, But I wanted more...some kind of feedback to make the phone seem more realistic?
Until I figured this all out the only thing a user heard when they picked up the handset was a poor representation of a dial tone and crappy beeps and boops.. Which you can see in this video
I came to the conclusion that I would need real sounds, but how to do that with an UNO?
Well, there are several wav "shields" available but at the time I didn't have the ability to order one and have it home in time to get the project done So I set out to do without.
Fortunately for me I found the TMRPCM library which not only can play wav files directly through the ATMega328 itself without any additional hardware, it also worked with the SD card library! Meaning, I didn't need a shield to do it!
So now I had rotary decoding, audio playback, and file storage figured out.
I eagerly went to work and built the first puzzle phone.. hardcoded the pin states, and the good number based on the needs of the game it was to be installed in. The phone has now been running flawlessly.
Time has passed and I’ve built many other arduino based game components some small scale and a few pieces that are actually quite large.
I thought that since I have learned new methods to code It was time to revisit this project and see what I could do to update and otherwise improve it.
I found that there was so much more I could do!
Introducing the RotaryLockSD3
This new Iteration not only does the basic duty of validating a correct number with a pin state change,
It can now change any of 9 pins, with any 7 digit phone number, and play custom .wav files without ever recompiling the source once it's loaded! You can even change the default pin states on startup from High/Low without ever opening the arduino IDE!
The secret sauce is the new way I load variables from the SD card.
Step 1: Get Your Stuff Together.
You will need an Arduino UNO,
You will need a shield with an SD card slot (sd shield?)
A better option would be a blank prototype shield and a MicroSD card adaptor which you can wire directly to SPI pins of the arduino.
Oh, and of course, a Rotary Phone.
Step 2: Prerequisites
You should also already be familiar with using the RotaryDialer library or at least know how to wire the rotary dial into your project. Because it's super easy, and you can find 'ibles all over on how to do it I'm not going to cover it.
If you are planning on soldering wires from the SPI port directly to your SD card adaptor, Bravo! That's what I did and it works fantastic.
I see no need to purchase an SD shield nor waste valuable space inside the phone..
Again, you can find several examples explaining how to do it.
Assuming you have the ability to build a crappy rotary puzzle already I'm going to skip the wiring and give you more specifics about the software itself.
Step 3: Pin Useage
Users may now use custom sound files which can be triggered by any 7 digit number dialed.
The same dialed numbers may also be used to control any one of the 9 available digital pins states.
Step 4: Sound Files
When the correct number or any number for that matter is dialed, the system will search the SD card to see if there is a corresponding .wav file of the same name. If you want a number to be "answered", this is the file you need to create.
To create a "good" number convert your custom .wav file to 8bit 8-16khz mono and copy it to the root of the SD card.
Be sure to rename your sound file to the 7 digit number you'd like to use to activate it. ( i.e. 5555555.wav )
Make sure to include the .wav extension.
When the number is dialed, your custom file will be selected and played to the user.
This could be handy for an information kiosk, puzzle clue, or whatever...
oh and as a side note, if the number dialed cannot be matched to a custom .wav file the user is presented with a "bad destination" sound file, this could be a busy signal, a number out of service message, a school office, or a secretry.. there are several included in the /stdsnds folder and are required for the phone to properly function.
Step 5: .Loc Pin Control Files
The system now has the ability to trigger a digital pin to change its state in coordination with the custom sound file.
If you would like to trigger a pin on the arduino with a phone number dialed you must first create the custom .wav file and place it in the root of the SD card.
The next thing you will need to do is create a custom .loc file.
This file can be created in notepad and the name must reflect the same number as the associated .wav file (i.e. 5555555.loc)
The way that the system triggers the pin is by parsing the contents of the .loc file that it located in association with your dialed number.
You must populate the three variables in the .loc file for it to work.
Please see the attached chart as reference.
The parser is only interested in the information between the [ & ]. The comments after them will be ignored.
Step 6: Startup Config File
When the system is first started up the digital pins need to be configured to reflect your needs.
Normally this is done in the code prior to compiling and should something change with the installation you'd need to recompile, each, and, every, time.
In this iteration I have built in the ability to set the pins up via config.txt which should reside in the root of the SD card
The idle default state of these pins are configured as shown in the attached chart.
Step 7: Come and Get It.
If you're interested in using this in your project you can obtain the latest version from my github repo.
I have other projects on there as well that I welcome you to explore..
Sorry if this Instructable stinks..
I had no idea what I needed to put it together so I may need to revisit this and spruce it up.
I wanted to go over hardware as well but if you have any questions feel free to ask.