Close
0%
0%

Vintagephone - old rotary phone retrofitting

An open project to bring new functionalities to vintage phones with the nice old rotary, keeping their fascinating vintage style alive.

Public Chat
Similar projects worth following
In this project a vintage phone with the old rotary encoder is opened and modified. It will no longer be used as a phone, but it will be retrofitted with a Wemos and a DFplayer to bring some new functionalities in a vintage style.

There are a lot of projects out there about retrofitting old phones, but this project is quite different since it will not use it as a phone, and it's not just an MP3 player, but we'll transform it in a do-it-yourself IOT device, a vintage version of the modern smart assistants.

The aim is also to create an open project and let easily replicate this hack on any vintage phone.

This reuse-recycle project will create a modern object from an old one, so the antique is also a useful object that can be used every day for small tasks and at the same time can make your home or office more beautiful.

Final features 

The vintage phone can be used to set an alarm by calling a number that represents hours and minutes, or you can dial a specific number to get current time and date, or call another number to hear meteo forecasts, and so on... 

Answers are heard by the user throught the handset, and requests are made by using the old rotary to dial commands.

I'd like to create a project that can be spread around, once the Vintagephone is assembled, it should be easy to be used also for non tech people as it once was calling with a rotary phone.

For tech users it would be easy change mp3 files with custom messages and write code to create new services.

Phonebook

Updated list of numbers you can dial to get messages:

#1        - tell the current time
#12       - set an alert after 2 minuts
#13       - set an alert after 3 minutes
...
#1999     - set an alert after 999 minutes
#11000    - set an alert at 10:00
#1-HH-MM  - set an alert at HH:MM
#2        - delete alarm
#9        - ring bells (for test
#21       - restart Wemos
#22       - adjust the time of Wemos from internet
#22-HH-MM - adjust the time manually to HH:MM
#22-YYYY-MM-DD - adjust the date manually to YYYY/MM/DD
#23      - activate AP to set the SSID/password to connect to wifi,
           latitude, longitude and utc for weather
#24      - play heads or tails
#25      - say yes or no
#4       - meteo forecasts (thanks to https://open-meteo.com/)

Reused components and modern parts

To keep the original taste some vintage parts are reused, here are all the parts involved:

1) Rotary dialing encoder

I've used the vintage rotary composer to dial numbers, numbers dialed become commands for the microcontroller

2) Original bells for a vintage sound 

I've powered the original bells and used that vintage ring, boost up converter DC-DC is needed to transform 5V to 12V. And also an L293D motor shield is used to alternate voltage to the bells to make it ring.

3) Vintage handset and switch

The handset is used to listen the messages. The two white buttons under the handset when it is hangup are still used as a switch.

4) Wemos board

It's my preferred board to make "Arduino" projects because it provides also access to wifi, if internet access is available there will be some functionalities, such as local meteo informations, autosetting date and time, more to come (suggest your ideas!).

5) DFplayer / micro SD card
The mp3 player with micro SD card provides audio samples for all the messages speaked in the handset, this means, number samples, meteo keywords, error messages, etc (no text to speech software is used).

6) Power supply

All the stuff has been powered with a 5V, 3000 mmA adapter.

Complete schema

Schematic
(the bells and the other parts are inside the old case!)

Code project available on GitHub

The whole code of the project is published on Github here:

https://github.com/giuliopons/vintagephone

mp3.zip

mp3 audio files organized in folders for DFplayer. Download the updated version from github.

x-zip-compressed - 1.78 MB - 04/27/2022 at 20:00

Download

rotary-phone-WEMOS.zip

This file contains the Arduino IDE files and the data folder with files used in the AP mode to configure the wifi connection. Download the updated version from github.

x-zip-compressed - 10.54 kB - 04/27/2022 at 19:48

Download

  • 1 × Wemos
  • 1 × DFplayer mini
  • 1 × 10 kOhm resistor
  • 1 × 1 kOhm resistor
  • 1 × 330 Ohm resistor

View all 10 components

  • PCB tested

    Giulio Pons05/08/2023 at 06:47 0 comments

    The PCB was tested and used to make a second Vintagephone. :-)

  • PCB for vintagephone

    Giulio Pons04/14/2023 at 16:35 0 comments

    With the help of a friend I've done the PCB of the project.

    Waiting for the PCB to assembly and test it

    R1 = 1k

    R2= 330

    R3 = 10k

  • Vintagephone software

    Giulio Pons06/23/2022 at 21:56 0 comments

    Software components

    Vintagephone software is composed by different parts.

    We have some functions to control the bells, the rotary encoder and the switch.

    We have functions that handle the clock methods, for setting the time and check the timer for alarms.

    We have functions that handle the mp3 player, play and stop an mp3 track.

    We have many functions to handle the Wemos functionalities, such as the OTA (Over The Air) update process, to upload new sketches without plugging the usb cable, or the functionalities to handle the captive portal when the Vintagephone is in AP mode (Access Point). The first time you will use it you'll need the AP Captive Portal to configure the acccess to your wifi. You can use your smartphone to confgiure it.

    The AP captive portal uses the SPIFFS, the simplified file system that is used to store the HTML, css and JS for the portal. 

    Then with Wemos we have access to the WWW where we can get correct time information and other services such as the meteo service.

    All the libraries used are available in the Arduino software library.

    Phone status

    Every time Vintagephone is used the phone keeps track of its status.

    There are 5 status:

    • DIALING (0)
    • CALLING (1)
    • CALL_ENDED (2)
    • ANSWERING (3)
    • HANDSET_DOWN (4)
    • RINGING (5)  

    For example when a user call 1 to ask the correct time, the Vintagephone passes from one status to the other like this:

    This sequence is the same for all the calls dialed. Ringing status is not touched.

    When you set an alarm a time is setted and when the triggering time is reached the sequence is a bit different:

    If the user put down the handset during an answer or doesn't answer when the phone is ringing, the software detects the closing of the switch and stop the player and go back to the initial status. So the complete diagram for the phone status is this:

    You can customize services and answers in the main loop, by adding blocks of code:

    // #3456789 YOUR CUSTOM NUMBER THAT NOT MATCH PREVIOUS NUMBERS
    // ---------------------------------------------------------------
    if(phoneNumber=="3456789") {
       found = true;
       setPhoneStatus(ANSWERING);
    
       //
       // Add your code here
       // then play your tracks
       //
       // use playTrackNum(x, WAIT_END) to play mp3 number x in mp3 folder.
       // use playTrackFolderNum(x,y, WAIT_END); to play mp3 number y in x folder.
       // use WAIT_END if you want the process to wait the end of the mp3
       //
       
       setPhoneStatus(CALL_ENDED);
       playTrackNum(1);
    }
          

    Everytime you want to add a new service, if you need different phrases, you'll probably need to open the case to reach the micro sd card and add the new mp3 files.

    Github

    All the code is available on github and it's well commented!

    https://github.com/giuliopons/vintagephone

  • ​Wemos + bells + switch

    Giulio Pons05/15/2022 at 16:19 0 comments

    Ok, let's try to make those bells ring! How do they ring? Between the two bells there is a small hammer which rapidly and alternatively  move against the bells. It's moved with a magnetic field created by a coil.
    You can try to manually swap the + and - poles of a 9 volts battery to two pins of the coil, and sometimes you can hear a small "ding" when you change the poles! 
    So we need a way to feed in alternate current to two pins of the coil. The alternate current inside coils creates the magnetic field.
    Since our project runs with direct current we need a way to transform it. I've first added a boost up to raise the voltage from 5 V to 12 V. The raised voltage then goes to the controlled input of the LD293 shield. This shield is commonly used to drive motors with an external power source, but with two pins from Wemos we can turn on and off alternatively the power to the output to pins A+ A-.

    For example, we put 0 to A- and 1 to A+, then we can invert the values: A- to 1 and A+ to 0. So, if we use those A+ and A- to feed to the coil we have a signal that goes alternatively from -12 V to +12 V.

    Try some different delays to match the proper frequency that sounds nice!

    We can also connect a pin of Wemos to the switch to detect the close and open of the circuit.

    When you disconnect all the cables you can turn upside-down that old circuit board and see the stain tracks, you can also try with the tester to find the two pins that change the state when you move the lever that drive the switch on and off.

    Here is a small script that ring the bells a few times and then makes a pause. It will repeat until someone picks up the handset.
    #define PIN_HANGUP_SWITCH D1      // switch hang up
    #define PIN_BELL_1 D2
    #define PIN_BELL_2 D3
    
    void setup() {
      Serial.begin(115200);
      pinMode(PIN_HANGUP_SWITCH, INPUT_PULLUP);
      pinMode(PIN_BELL_1,OUTPUT);
      pinMode(PIN_BELL_2,OUTPUT);
    }
    
    //
    // Ring the bells!
    // Make a alternate square wave on bells coil with 2 pin and L293D driver
    void bells() {
      int maxRings = 5;
    
      byte cornettaStatus; // 0 = OPEN, PICK UP - 1 = CLOSE, HUNG UP
    
      while(maxRings>=1) {
        int i = 0;
    
        cornettaStatus = digitalRead(PIN_HANGUP_SWITCH);  
        if(cornettaStatus==1) Serial.println("Ringing...");
    
        while(cornettaStatus==1 && i<30) {
          digitalWrite(PIN_BELL_2,LOW);
          digitalWrite(PIN_BELL_1,HIGH);
          delay(20);
          digitalWrite(PIN_BELL_2,HIGH);
          digitalWrite(PIN_BELL_1,LOW);
          delay(20);
          i++;
          cornettaStatus = digitalRead(PIN_HANGUP_SWITCH);  
        }
        
        if(cornettaStatus==0) Serial.println("Picked up!");
        digitalWrite(PIN_BELL_2,LOW);
        unsigned long ti = millis() + 2000;
        while(cornettaStatus == 1 && millis()<ti){
          delay(1);
          cornettaStatus = digitalRead(PIN_HANGUP_SWITCH);  
        }
        if(cornettaStatus==0) Serial.println("Picked up!");
        maxRings--;
      }
    }
    
    void loop()
    {
      bells();
    }

    Here is also a video!

  • Meteo forecast service added

    Giulio Pons05/08/2022 at 17:26 0 comments

    Just added meteo forecast service with open-meteo.com Api.

    Dial number #4 to listen to meteo.

    Now I need to make some AP portal setting page to configure latitude and longitude.

  • Wemos + rotary dial encoder

    Giulio Pons05/06/2022 at 15:10 0 comments

    After the handset the rotary encoder disc is the most fascinating part of the old phones.

    The disc allows the user to compose a sequence of  numbers, each time you rotate the disc - which is a normally closed circuit - and release it, it will rotate back to its starting position and it will mechanically open a switch that make electric pulses. We can detect and count these pulses to determine each digit dialed.

    To count those pulses we have to connect two outcoming wires from the rotary encoder. In my Italian SIP model there are four wires, but we need just two: one wire should be connected to GND and the other one to a pin of our board to read incoming pulses. Here is the schema. The rotary dial is a normally closed circuit so the D8 pin of Wemos read 0 because it's connected to ground throught a 330 Ohm resistor.

    When a number is dialed, for example 3, the rotary open and close the switch 3 times, and the D8 pin reads three pulses of 1 because of the 5 Volts throught the series of the two resistors.

    On the Arduino forum I've found a discussion about the rotary encoder that points to this link with a function readNumber that correctly counts those pulses.

    In this video you can see pulses in the Arduino IDE plotter.


    You can try to plot the pulses with this code:

    int in = D8;
    
    void readNumber() {
      
      int needToPrint = 0;
      int count=0;
      int lastState = LOW;
      int trueState = LOW;
      long lastStateChangeTime = 0;
      int cleared = 0;
      
      // constants
      
      int dialHasFinishedRotatingAfterMs = 100;
      int debounceDelay = 10;
    
      int digits = 0;
    
      unsigned long nodialingtime = 4000 ;
      unsigned long lasttimernothing = millis() + nodialingtime;
     
    
      while( digits < 10 && millis() < lasttimernothing) {
    
        int reading = digitalRead(in);
        Serial.println(reading);
      
        if ((millis() - lastStateChangeTime) > dialHasFinishedRotatingAfterMs) {
          // the dial isn't being dialed, or has just finished being dialed.
          if (needToPrint) {
            // if it's only just finished being dialed, we need to send the number down the serial
            // line and reset the count. We mod the count by 10 because '0' will send 10 pulses.
            //Serial.println(count % 10, DEC);
            digits++;
            needToPrint = 0;
            count = 0;
            cleared = 0;
            lasttimernothing = millis() + nodialingtime;
           }
        }
      
        if (reading != lastState) {
          lastStateChangeTime = millis();
        }
        if ((millis() - lastStateChangeTime) > debounceDelay) {
            // debounce - this happens once it's stablized
            if (reading != trueState) {
             // this means that the switch has either just gone from closed->open or vice versa.
             trueState = reading;
             if (trueState == HIGH) {
              // increment the count of pulses if it's gone high.
              count++;
              needToPrint = 1; // we'll need to print this number (once the dial has finished rotating)
              
            }
          }
        }
        lastState = reading;
      }
    }
    
    void setup()
    {
      Serial.begin(9600);
      pinMode(in, INPUT);
    }
    
    void loop()
    {
     readNumber() ;
    
    }

    The script is included in the repository on Github.

    https://github.com/giuliopons/vintagephone/

  • ​Mp3 + Wemos + handset

    Giulio Pons05/04/2022 at 21:20 0 comments

    In these logs I will show how to retrofit your vintage rotary phone. I'll try to describe the main steps to modify the phone.

    The first step is to put together the DF mini player, the Wemos board and the old handset.


    The DFplayer mini is an MP3 player that can talk with your preferred microcontroller through serial communication with two wires.

    In this log we connect the player with the Wemos board. There is just a thing to pay attention to before connecting. The DFplayer has a 3V logic, and Wemos has a 5V logic. This means that a High signal is transmitted with 5V from Wemos and thus will damage your DF player. 

    So we need to put a resistor between the receiving pin of DF player and the transmitting pin of Wemos, in this kind of two pins wired communication the RX pin of a board is connected to the TX of the other device, and viceversa.

    In this case the second pin it's not necessary since the DF player is transmitting and Wemos is receiving and the 3V high signal is correctly received as an High signal also from Wemos, because it's more then half of 5V. 

    Everything above 2.5V is considered high, and everything under 2.5V is considered low. So it works.

    The DF player has two pins who bring left and right audio signals to the speaker and we connect them with cables coming out of the handset.

    To connect the handset you have to find the two proper cables out of the three cables available. 

    TIP: When you open the old phone, disconnect all the connectors from the parts you want to use, you need to access the cables of the handset and no other wiring should be linked to the rest of the old phone or this will change the behaviour of the system.

    Since I don't want to open the receiver, I've just tried two of the three cables. In my handset the cables to use are red and blue.


    Here is the schema:

    You can upload a few mp3 on your micro SD card, insert the cart in the player and test the process with the DF mini example scripts of the Arduino IDE library DFminiMp3

    I've used version 1.07.

    When you try the PlayMp3.ino example sketch you have to modify some lines, since in the Wemos board we use a Serial Software and not an Hardware software:

    So comment line 65 and uncomment 69 and 70.

    At line 69 change 10 with D6 and 11 with D5.

    If you hear your mp3 in the handset you did it!

    If not check these things:

    • check pin connections RX-TX and resistor on pin D5 as described in the above schema.
    • check folders name in your SD card, you should have only a folder named mp3 and inside a few mp3 files with names that are numbers zeropadded: 0000.mp3, 0001.mp3... and so on. Four digits numbered files.
    • if none of above, think about adding an external power source

  • Meteo service

    Giulio Pons04/29/2022 at 22:12 0 comments

    I'm looking for a meteo service which I'd like to call directly from Wemos to retrieve informations.

    I've found open-meteo.com which seems to be able to deliver, free and easy, an API endpoint to parse with Wemos.

    For example here are meteo informations for Milano (Italy).

    https://api.open-meteo.com/v1/forecast?latitude=45.51&longitude=9.16&daily=weathercode,temperature_2m_max,temperature_2m_min&timezone=Europe%2FBerlin

    Latitude and longitude should be inserted with the AP portal.

  • Code updated on github

    Giulio Pons04/29/2022 at 19:28 0 comments
  • MP3 file list

    Giulio Pons04/28/2022 at 07:56 0 comments

    I've prepared a list of all the files saved in the SD card (or needed). 

    Complete list updated here:

    https://docs.google.com/spreadsheets/d/1A5Z_0ZLCWuRMt66E694Saxo3OJwWO3L1QZXkWnyu8mk/edit?usp=sharing

    Audio files can be made with online services like this:

    https://murf.ai/

    Some thought is required on the syntax of the sentences...

    FOLDER\FILE      MESSAGE
    
    01\000.mp3 =     "00"
    01\001.mp3 =     "01"
    01\002.mp3 =     "02"
    01\003.mp3 =     "03"
    01\004.mp3 =     "04"
    01\005.mp3 =     "05"
    01\006.mp3 =     "06"
    01\007.mp3 =     "07"
    01\008.mp3 =     "08"
    01\009.mp3 =     "09"
    01\010.mp3 =     "10"
    01\011.mp3 =     "11"
    01\012.mp3 =     "12"
    01\013.mp3 =     "13"
    01\014.mp3 =     "14"
    01\015.mp3 =     "15"
    01\016.mp3 =     "16"
    01\017.mp3 =     "17"
    01\018.mp3 =     "18"
    01\019.mp3 =     "19"
    01\020.mp3 =     "20"
    01\021.mp3 =     "21"
    01\022.mp3 =     "22"
    01\023.mp3 =     "23"
    01\024.mp3 =     "24"
    01\025.mp3 =     "25"
    01\026.mp3 =     "26"
    01\027.mp3 =     "27"
    01\028.mp3 =     "28"
    01\029.mp3 =     "29"
    01\030.mp3 =     "30"
    01\031.mp3 =     "31"
    01\032.mp3 =     "32"
    01\033.mp3 =     "33"
    01\034.mp3 =     "34"
    01\035.mp3 =     "35"
    01\036.mp3 =     "36"
    01\037.mp3 =     "37"
    01\038.mp3 =     "38"
    01\039.mp3 =     "39"
    01\040.mp3 =     "40"
    01\041.mp3 =     "41"
    01\042.mp3 =     "42"
    01\043.mp3 =     "43"
    01\044.mp3 =     "44"
    01\045.mp3 =     "45"
    01\046.mp3 =     "46"
    01\047.mp3 =     "47"
    01\048.mp3 =     "48"
    01\049.mp3 =     "49"
    01\050.mp3 =     "50"
    01\051.mp3 =     "51"
    01\052.mp3 =     "52"
    01\053.mp3 =     "53"
    01\054.mp3 =     "54"
    01\055.mp3 =     "55"
    01\056.mp3 =     "56"
    01\057.mp3 =     "57"
    01\058.mp3 =     "58"
    01\059.mp3 =     "59"
    01\060.mp3 =     "minutes"
    01\061.mp3 =     "hours"
    01\062.mp3 =     "and"
    01\063.mp3 =     "alarm set in"
    01\064.mp3 =     "AP activated, check Vintagephone in wifi networks"
    01\065.mp3 =     "You had set an alarm at this time"
    01\066.mp3 =     "Hours or minutes not valid"
    01\067.mp3 =     "It is"
    01\068.mp3 =     "It's been"
    01\069.mp3 =     "alarm set at"
    mp3\0000.mp3 =     "line available"
    mp3\0001.mp3 =     "connection lost/ended"
    mp3\0002.mp3 =     "voice mail sound"
    mp3\0003.mp3 =     "busy line"
    mp3\0004.mp3 =     "line available"
    mp3\0005.mp3 =     "busy line"
    mp3\0006.mp3 =     "line available"
    mp3\0007.mp3 =     "line available"
    mp3\0008.mp3 =     "line available"
    mp3\0009.mp3 =     "line available"
    mp3\0010.mp3 =     "modem/fax"
    mp3\0011.mp3 =     "modem/fax"
    mp3\0012.mp3 =     "the dialed number is not available"
    
    TO BE RECORDED:
                         "restarting wemos"
                         "alarm deleted"
                             "Time updated from internet"
                         "Missing wifi

View all 17 project logs

  • 1
    How to build your Vintagephone

    So, you have a vintage phone and you want to hack it back! Ok, here is how to do it.

    1. Get all the parts you need to build your Vintagephone, the parts are listed here.
    2. Open the case of the vintage phone, you should easily find the screws.
    3. Disconnect the cables from the central board and find the cables that go to the handset.
    4. Using a breadboard experiment the configuration Wemos + Mp3 player + handset as described in this log.
    5. Add new parts to your breadboard project! Find the cables and connect the rotary encoder to the Wemos and try to read the dialed number as described in this log.
    6. Now connect the handset switch, you have to find the correct pins with a tester. You have to connect also the bells to the Wemos, this steps are detailed in this project log.
    7. Now that you have all the parts connected you can upload all the software:
      1. Download mp3 files from the Github projects and store them in the micro sd. If you want to use different clips you can create them with free text to speech at Murf.ai
      2. Download Vintagephone and data for the SPIFFS to your Arduino projects folder and upload both to the Wemos
    8. Test the project on the breadboard, with the vintage phone case opened and parts connected. Dial 23 to ativate access point and configure wifi access! Try to call 1. 
    9. Move the project from the breadboard to perfboards. I've uesed two small 4x6cm perfboards, maybe you can do it better. All the parts must stay inside the case! Can you design a PCB to assemby it better?
    10. Close the case.
    11. Read the log about the Arduino software. And try to make your custom services!

View all instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates