Home Creators Posts Import Register Favorites Logout

Content

This post contains additional Patreon-only resources and information to accompany the Rotary Phone v2.0 prop described at https://www.patreon.com/posts/41892314

First, a few notes on implementation:

The DFPlayer Mini MP3 module (like many mass-produced electronic components available from AliExpress/BangGood etc.) can vary slightly between different suppliers, and comes with very little documentation. On previous occasions when I've used this component, I've found that theoutput can be quite noisy if you provide it with 5V on the VCC - instead you can get better quality signal by adding a diode to the power supply line to drop the voltage slightly to around 4.2V instead. However, on this occasion, I didn't need to, and actually thought it sounded better directly connected to 5V. Also, again though it wasn't required for this project, for best practice I would normally encourage you to add a smoothing capacitor across the power lines close the DFPlayer. The image below shows these two modifications should you choose to implement them (Rx, Tx, and speaker out connections not shown):

In terms of behaviour, it's also worth nothing that the DFPlayer does not have a "Power" LED at all. There is an LED, but that only becomes lit when a track is playing from the SD card. Also, the device will fail to initialise correctly unless there is an SD card inserted into the slot!

I also realise that I didn't actually show a picture of the inside of the phone after I'd installed the Arduino/DFPlayer/Motor Driver components. So, if you're interested, here it is - you should hopefully find plenty of room to accommodate these parts even if, like me, your wiring is a bit clumsy!

In addition to the behaviour demonstrated in the video, I've also created another version of the code that demonstrates how you can also use a serial connection to trigger different phone calls, rather than by pressing a manual button. To use it, you can fire up the Arduino serial monitor and type the command RING followed by the index number of the audio file you want to play when the call is answered. So, let's say you want to make the phone ring to deliver the audio hint that is saved on the sd card as the files "mp3/0003_hint.mp3" (i.e. file "3"). Then here's what you'd do:

I'm just using the Arduino serial monitor as a convenient way to send serial messages to the phone - but that command could have been generated by any other control system, or triggered by another Arduino etc. The same technique can be used for triggers delivered by other means - e.g. MQTT.

Download

And here is the link to a Google Drive folder containing the downloads: https://drive.google.com/drive/folders/1k_sjo_gjRMJgz-WBFpMRpDV7I-noXoZu?usp=sharing

 Inside you should find:

RotaryPulseTelephone - the Arduino project demonstrated in the video

RotaryPulseTelephoneWithSerial - Arduino project with additional serial code described above

mp3 - folder containing audio samples (ringing, dialling tone etc.) used and illustrating naming convention for adding your own audio samples

RotaryPulseTelephone.fzz - Fritzing wiring project

Telephone State Machine.svg - diagram of the state machine behaviour of the telephone

Resources Used

Rotary Pulse Dial telephone, ~$10  https://www.ebay.co.uk/sch/i.html?_from=R40&_trksid=p2499334.m570.l1313&_nkw=gpo+746&_sacat=985

DFPlayer Mini MP3 Module, ~$3  https://www.banggood.com/custlink/Kv3yCUiv3A

Mini Motor Shield, ~$3 https://www.banggood.com/custlink/v3KdCwGCLA

Arduino Nano, ~$2 https://www.banggood.com/custlink/mGGmwdTDmU

Additional Images

Files

Comments

Rune Nielsen

Hello all maby som1 can help me, when i try to upload the scrip to my nano, it give me a Compilation error: src/DFRobotDFPlayerMini/DFRobotDFPlayerMini.h: No such file or directory. but i have install the DFRobotDFPlayerMini by DFRrobot. what can i do so it work :D

Trond Åge Langtind

Hi! Nice project! I've got a rotary installed, but it's counting one to many, so 1 get to be 2 and 0 gets 11. I could solve it be adding a -1, but what could be the reason for this?

Paul Calladine

Great project, really informative! Random question, how has anyone secured the nano/df/motor driver in the phone housing? I’m concerned with them being loose in there is players pickup the phone to inspect etc. Thanks in advance

Ian Campbell

Great project. (Actually the third one of yours I've built) I've been having fun making it work with a very old Western Electric 503 from the 1950s. I have everything figured out as far as the phone goes, as I can see everything works when I monitor the serial connection. What I am having a problem with is that I am unable to produce any sound from the dfplayer. The serial line connects correctly, The SD card is installed. to troubleshoot, I up loaded the sample program from DFRobot to my Arduino nano and it works fine with the SD card I made for the phone. Switch back to to the rotary phone program, everything initializes fine, I see the Nano respond to lifting the receiver, but nothing form the DFplayer, as in no led to indicate .mp3 is being played. (same behavior on two DF players). Any ideas?

Patricia

Hi Alastair.. I have a 4-way 5v remote-controlled relay module that I would like to use instead of a push button trigger or serial command and am having trouble getting it wired properly to work. I am wanting to use 3 of the 4 relays that trigger 3 separate calls when the button on the remote is pressed for the corresponding relay. I believe the coding is all correct for three calls; it’s just the wiring I don’t think I’m doing correctly. Do you happen to know how this could be done?? Thanks in advance!

MindTrap Escape Room

Hi, I checked my wiring multiple times but I am getting this message in the serial monitor. Initialising software serial interface to DFPlayer.............Failed :( Do you have any suggestions?

Ben Gadsby-Williams

Hi Alastair, I'm having issues with my dfplayer. The audio quality is poor on initial boot, but it then improves when I disconnect then reconnect power to the dfplayer. Any ideas how I can ensure the audio quality is good from initial power up? Thanks

Timothy Canipe

Hello, I've been trying to get this to work, but I am having an issue. So far I have managed to get everything wired and when run It recognizes when the phone is picked up, but nothing is being played on the phone. At first I thought it might be that the phone just doesn't work, but I noticed that the light on the DFPlayer isn't lighting up when picking up the phone. I have the files in a folder on the SD card called mp3. Am I missing something? when everything starts up it says that it connects to the DFPlayer fine.

Minter Arnaud

Got rotary phone project working with esp32. i modified a bit the code, it runs with mqtt now and is able to read a dial number and interact with home assistant (for example).

John Dovey

I'm really looking forward to doing this. I've never used an Arduino, but I've made a few things with a Raspberry Pi Pico and micropython so I'm going to try to translate your code over to that. Should be a fun project!

Olga Saltovsky

Are you have better picture of wiring? I understand how to wire arduino with player and mini motor shield, but wanted to see how to wire the phone original wires to the electronics. Also, in the original old project you used mini sd card player and I try to understand what is the difference between mini sd card player and dfplayer from this project.

Gareth

Thank you so much for doing this Alastair, parts ordered through Banggood, and when they arrive will give this a go! Is there an ability to add the maglock drawer opener as a final element of the puzzle as in version 1 at all?

Richard Maritzer

Perhaps include a quick primer on the DFPlayer file hierarchy? I seem to remember horrors in using them, if you delete files, or change their names, it doesn't play them based on name, but order they were burned to the SD or something REALLY weird. I'd have to re-initialize the card, and do a single copy of the files, in order to get it to work right. OR I was really doing something wrong, and I don't know what I'm talking about.

Olga Saltovsky

In the code there are this rows: // This switch closes when dialling starts (BROWN) const byte dialPin = A2; // This switch opens and closes again the number of times equal to the number dialled (ORANGE) const byte numberPin = A1; But in the video the colours are opposite - brown for count of number and orange for start and end dialling.

Victor Hernandez

Hi Alastair! I've never use bounce before and am having trouble in the update section. Am I supposed to change anything here? If not, do you have/mind sharing the completed sketch that you have used?

chuchu

Hi Alastair, great project thanks! I've built the project but whenever an mp3 is playing there is a very annoying clicking sound (not when hook switch closed). I've added diode and capacitor but no change. Any advice appreciated! Ta

Chris Adamson

Hi Alastair! Thanks so much for putting all of this information together. I'm about to start work on my own phone, but I want to use it as a recording device. Can the DF Player record directly to the SD card?

TheM2Mom

I can’t tell you how excited I am to build this project. I found a similar product on sale for only $600 US, which as about $550 US beyond my budget

Suzanne Heeg

I bought a phone and used the links to buy the DFPayer Mini MP3 Module and the Arduino Nano. But the link to the Mini Motor Shield is broken. Do you mind sending a new link for a workable Mini Motor Shield?

Alastair Aitchison

@Suzanne - Oh, that's annoying. Do you a link to the phone you bought? I'd avoid anything described as "new", as those are going to be modern replicas. GPO phones were produced in huge numbers in the 1970s/80s and there are lots of second-hand ones available, but they haven't been made new for a long time.

Bryan Haven

Hi Alastair, Thanks for putting this together. I work with David Hernly at M3 and am configuring a phone for use in a local room. I've updated the code for MQTT and am more than willing to share what I've done once it's working properly. I'm using an Adafruit Feather Huzzah breakout as the brains, I'm running into an issue with driving the ringer at the moment. I have 12vdc wired into the mini motor controller and see the lights flickering during a ring cycle but the ringer isn't moving the striker. Any thoughts on what may be causing this? I also need to update the sequence for the US ring cycle, 20Hz, 2 seconds on, 4 seconds off.

Suzanne Heeg

I've got the parts and I'm ready to start building. Where does the power cord for the arduino enter the phone housing? Same for a 12V dc for the mini motor controller?

Sc0ps

hi Alastair used this setup today on an old ericsson type 1951 it works. only when I turn a 1 it gives a 2 as a turned number at 2 it gives 3 and so on. how can I fix this it counts one more pulse on this type of phone

Eugenia De Marco

Hi Alistair. Thank you so much for doing these videos! They are extremely helpful and fun to learn with. I did this project using a 1930's (or 50s?) rotary payphone (Western Electric), bypassing anything coin collector related hardware. After wiring everything up, I just get a "click" when the hook switch engages, rather than hearing the audio recording. Have you (or anyone else here) had this issue before?

Eugenia De Marco

Hi there...still looking for some advice/help here. It seems it's only transmitting for a hot second, and can't seem to figure out why it won't transmit for the length of the mp3 file.

Fabio Maranhao

Hi Alastair, Great project and tutorial. Clear and easy to follow. As a family project, we managed to get everything working except the ringing. As we are using a 1970/1980's Canadian Rotary Phone (Model 500) things seems to be wired quite differently. But the ringing mechanism seems different than the UK phone. While the UK phone you used has two solenoids where you alternate the current, I believe the Model 500 we are working on works with a magnet that turns on/off making the ringing sound. What we are struggling is how to adapt the code (or maybe the wiring as well) to the different ringing hardware. In theory sounds simple, but maybe my lacking of good knowledge on coding is setting me back. Any suggestions and/or directions on how to solve this point? Best,

Suzanne Heeg

I am VERY slowly working my way through this project! With each step, I learn more about what I don’t know. In the picture, the Arduino and the MP3 player are connected to a green board. What is the technical name for that board? Also, there are 4 wires (yellow, green, blue and pink) that extend between the mini motor shield and what looks like a connector on the green board. Is this correct? And what is the name of that grouping of wires? Are they a standard connection piece that I can purchase to link between the green board and the mini motor shield? As always - I apologize for pestering you with really basic questions, and I thank you for all of your help.

Suzanne Heeg

With a bunch of digging, I answered my own questions. Thank you!

Suzanne Heeg

I apologize for this long and detailed question! I've made substantial progress in my build, but encountered a strange problem. My DFPlayer does not respond to the following instructions and I get a “Get Wrong Stack” Error: dfPlayer.playMp3Folder(1); dfPlayer.playMp3Folder(audioFileToPlay); dfplayer.play(1); To test the DFPlayer, I modified the Get Started sketch to connect to the DFPlayer with the same code as the Rotary Telephone code, and I used the same wiring (because I did not want to rearrange my breadboard. I successfully played files through the telephone speaker using the following instruction: dfplayer.next(); There was a small problem in that I got a “Get Wrong Stack” error instead of playing the first file, but then the Arduino played files 2-9 and from then onward played files 1-9. So good news! – I know the DFPlayer can play files…. My problem is that the DFPlayer does not play when instructed to play a particular file as noted above. I created a sketch (below) to test this function outside of the big sketch. The results when I ran my shorter sketch are first shown below. Basically – I am getting a “Get Wrong Stack” error message, but I have no idea why. Any ideas on how to get rid of the Get Wrong Stack error would be deeply appreciated. I have scoured the Internet for hours, but could not find an answer! * * Sketch Results in Serial Monitor * * * C:\Users\suzan\Documents\Arduino\Basic_DFPlayer_Functions_Sketch\Basic_DFPlayer_Functions_Sketch.ino Compiled: Oct 4 2021, 17:58:00 Initialising software serial interface to DFPlayer...OK! DFPlayer Mini online. Start of dfplayer.play(1); End of dfplayer.play(1); 5 second delay DFPlayerError: Get Wrong Stack Start of dfplayer.play(1); End of dfplayer.play(1); 5 second delay DFPlayerError: Get Wrong Stack (cycles through last four lines) * * * * * Shorter Test Sketch * * * #include "Arduino.h" #include #include // CONSTANTS // Connections to dfPlayer module const byte TxToDFPlayer = 4; const byte RxFromDFPlayer = 5; // Initialise a soft serial interface SoftwareSerial softwareSerial(RxFromDFPlayer, TxToDFPlayer); // RX, TX // Create an object to access the dfPlayer DFRobotDFPlayerMini dfPlayer; // void printDetail(uint8_t type, int value); void setup() { // Start the serial connection Serial.begin (9600); // Print some useful debug output - the filename and compilation time Serial.println(__FILE__); Serial.println("Compiled: " __DATE__ ", " __TIME__); Serial.print(F("Initialising software serial interface to DFPlayer...")); for (int i = 0; i < 10; i++) { softwareSerial.begin(9600); // Next line not in telephone code // Serial.begin(115200); delay(500); if (dfPlayer.begin(softwareSerial)) { Serial.println(F("OK!")); break; } else { Serial.print("."); } if (i == 9) { Serial.println(F("Failed :(")); return; } } if (!dfPlayer.begin(softwareSerial)) { //Use softwareSerial to communicate with mp3. Serial.println(F("Unable to begin:")); Serial.println(F("1.Please recheck the connection!")); Serial.println(F("2.Please insert the SD card!")); while (true) { delay(0); // Code to compatible with ESP8266 watch dog. } } Serial.println(F("DFPlayer Mini online.")); dfPlayer.volume(6); //Set volume value. From 0 to 30 dfPlayer.play(1); //Play the first mp3 } void loop() { // HEEG TEST OF PLAY FUNCTION Serial.println(F("Start of dfplayer(play(1);")); dfPlayer.play(1); //Play the first mp3 Serial.println(F("End of dfplayer(play(1);")); delay(5000); Serial.println(F("5 second delay")); // END OF HEEG TEST if (dfPlayer.available()) { printDetail(dfPlayer.readType(), dfPlayer.read()); //Print the detail message from DFPlayer to handle different errors and states. } } void printDetail(uint8_t type, int value) { switch (type) { case TimeOut: Serial.println(F("Switch Type - Case TimeOut - Time Out!")); break; case WrongStack: Serial.println(F("Stack Wrong!")); break; case DFPlayerCardInserted: Serial.println(F("Card Inserted!")); break; case DFPlayerCardRemoved: Serial.println(F("Card Removed!")); break; case DFPlayerCardOnline: Serial.println(F("Card Online!")); break; case DFPlayerUSBInserted: Serial.println("USB Inserted!"); break; case DFPlayerUSBRemoved: Serial.println("USB Removed!"); break; case DFPlayerPlayFinished: Serial.print(F("Number:")); Serial.print(value); Serial.println(F(" Play Finished!")); break; case DFPlayerError: Serial.print(F("DFPlayerError: ")); switch (value) { case Busy: Serial.println(F("Card not found")); break; case Sleeping: Serial.println(F("Sleeping")); break; case SerialWrongStack: Serial.println(F("Get Wrong Stack")); break; case CheckSumNotMatch: Serial.println(F("Check Sum Not Match")); break; case FileIndexOut: Serial.println(F("File Index Out of Bound")); break; case FileMismatch: Serial.println(F("Cannot Find File")); break; case Advertise: Serial.println(F("In Advertise")); break; default: break; } break; default: break; } }

QuixoticPirateCptn

I'm having trouble with the dialing. It seems to read the first pulse of whatever digit I dial, stores it in the number array as one pulse then moves onto the next digit and logs the second pulse as one pulse for the second digit etc. So if I dial 5, it stores it as 11111 and plays the "can you hear me now" wav file. Any idea what I have wrong here?

Type in Mind

I'm having a lot of trouble finding a good 746 that I know for sure isn't a new one. Does anyone have advice on how to know for sure or know of a phone that will work similarly that may be cheaper in the US?

Peter Murphy

Hi. I got as far as doing the wiring. I just signed up to Patreon for the code. I've put it in the Arduino software and clicked upload and it says it can't find the bounce folder/file. I've googled about that and it said to add it via Sketch / Manage Libraries but now it says 'src/Bounce2/Bounce2.h: No such file or directory'. Grateful if someone could let me know how to get past this.

Peter Murphy

Still on this, it looks like Arduino can find the 'Bounce' file inside 'Manage Libraries' but when I click install, it still doesn't appear on the list. I tried uploading the entire SRC folder which contains Bounce2.h via the 'add zip folder' option in Arduino, but it says it does not contain a valid library.

Peter Murphy

Ah, not sure if I did it the right way or not, but I found the bounce file and got some advice on a Facebook Arduino group to drop it into the same folder as the .ino file and change the directory for it in the code. Same for the Audio Player file. That has worked and the software uploaded. I've got it all wired together. Now when I hit press the physical button, I hear 'brrr-brrr' through the ear piece, so it's sending ringing signals which is cool. Bell won't ring though even with 12v power supply. Oddly, I can get it to 'ping' doing what you did with the 9V battery in the video, switching back and forth. Anyhow, I don't have any specific questions and will keep going back through it to see if any faulty connections etc. Will likely pop up again with more questions after a break from it. Cheers

Gareth Darby

I’m having issues with the 746 ringer, its only just about managing to ring and sounds like it’s dying. Wondering if a dc booster into the motor driver would help?!

Peter Murphy

Hi again. Here's what my phone looks like at the moment. https://photos.app.goo.gl/2tAduhmJApTsiu277 Does everyone else crimp jump wires into the hoop or forked connectors like I have? I'm also not sure how to do the white A0 wire with the two resistors but think this breadboard improvisation does the same job, if I understand right. So far, can't get any bell ringing but everything seems to be working, and I hear brr-brr when I push the button. Once I picked up and heard a dial tone but never again since! I can now hear pulses as the dialler winds back each time which is also cool. Plus the DFF LED lights up at times you would expect audio to play, but nothing comes through. But at least the systems are in place. Just got to figure out what's not working. Checked all the crimped wire contacts with multimeter. Any suggests anyone, do shout!

Jérémie Forget

Hello, I just build the project but I am wondering how easy would it be to add a new condition like this : If currentDigit is less than maxNumDigitsInPhoneNumber but there was no input in the last 5 seconds, to play the Invalid Number message like if I call 311... Nothing is happening, even if I wait 10 seconds. Does someone know how I can code this, I am fairly new on Arduino. Thanks !

Remco Dresen

Hi, im trying to use the serial version after i tried the normal version. seems like the serial one doesnt work when trying RING 3 ?