Vintage kids toy phone

kids push-button phone, learning toy, listen to voice messages

Project description

Let your kids listen to voice messages on a vintage phone

I bought a vintage telephone from the German “Bundespost” and transformed it into a mp3 player for voice messages.

So my daughter can make “phone calls” with her grandparents, family and friends.

If a button is pressed, first the number is advertised. So she can learn the numbers playfully.

Afterwards a voice messages plays. The numbers are assigned to different family members.

Dad is number 1, mom 2, grandparents 3, uncles 4, friends 5 and so on.

Everyone delivered me several voice messages. I converted them to mp3. With a button press a random message is played.

So it doesn’t get boring to fast.

You have to regard the folder structure for the df player. Otherwise the player won’t work.

9 folders are used, one for each push button.

$ https://wiki.dfrobot.com/DFPlayer_Mini_SKU_DFR0299#target_6 $ 

I use the DFPlayerMini_Fast.h library

$ https://github.com/PowerBroker2/DFPlayerMini_Fast $ 

My phone model has a key which was used at offices, to lock the phone for unauthorized users.

Now it’s used to trigger a random incoming call and play a little ringtone to get some telephone vibes 😉

Kids love to play with the keys, it’s a super cool feature.

My daughter chose the Indiana Jones melody as ringtone. Of course you can choose whatever you our your kids like.

The voice messages are only played if the reveicer is not hung op. Therefore I monitor the phone mechanic switch like a button on a analog pin.

if (buttonState2 == 0){

The toy is powered by a magnetic USB Cable so children can use it easily. I drilled holes in the housing and added a blue status LED.

The keypad was a bit complicated. I dissasembled it to see how the matrix looked like. The good thing is that these old phones are very easy to disassemble. You can reach every part and the housing gives enough space for the additional components.

The keypad library is easy to use. It worked right away.

#include <Keypad.h>

byte rowPins[ROWS] = { 8,7,6,5 }; //connect to the row pinouts of the keypad

byte colPins[COLS] = { 2,3,4, }; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

The wires are only plugged into the ribbon cable jack. But it works so far.

The original passive Buzzer was removed to free up some space. I replaced it by a standard passive buzzer.

Lots of space for components. The DF Player is glued in with hot glue to the right side. The Uno has enough room. Everything is hard wired to it’s pins. The SD Card can easily be reached from the outside.

My code is kind of crappy. It works but there is room for improvement 😉 Feel free.

My daughter was super happy. It was a birthday gift. She plays a lot with this phone. I plan to update with new Voice Messages from time to time.

For the messages I found it useful to make some pauses during talking. So the kids have time to respond in there “imaginary call”

A voice message can sound like this.

Hey XY, pause, how are you, pause, what are your plans for today?, pause, do you remember when we went to…,pause, looking forward to see you soon

Of course you can use the phone as a standard MP3 Player for kids music, audio books etc.

Have fun and make your kids happy

CODE

#include "pitches.h"
#include <DFPlayerMini_Fast.h>
#include <SoftwareSerial.h>
#include <Keypad.h>

const int buttonPin1 = A2;
const int buttonPin2 = A4;
int randomInt1;
int randomInt2;
int randomInt3;
int randomInt4;
int randomInt5;
int randomInt6;
int randomInt7;
int randomInt8;
int randomInt9;
int randomIntFolder;
int randomIntTrack;
const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
  {'4','5','6'},
  {'1','2','3'},
  {'*','0','#'},
  {'7','8','9'}
};

byte rowPins[ROWS] = { 8,7,6,5 }; //connect to the row pinouts of the keypad
byte colPins[COLS] = { 2,3,4, }; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

#define RX_PIN 11  // RX-Pin des DFPlayer Mini
#define TX_PIN 10  // TX-Pin des DFPlayer Mini

SoftwareSerial mySerial(RX_PIN, TX_PIN); // SoftwareSerial-Objekt erstellen
DFPlayerMini_Fast player;


// notes in the melody:
int melody[] = {
  NOTE_E5, 0, NOTE_F5, NOTE_G5, 0, NOTE_C6,0, 
  NOTE_D5, 0, NOTE_E5, NOTE_F5, 0, 
  NOTE_G5, 0, NOTE_A5, NOTE_B5, 0, NOTE_F6,0,
  NOTE_A5, 0, NOTE_B5, NOTE_C6, 0, NOTE_D6, 0,  NOTE_E6, 0, 
  NOTE_E5, 0, NOTE_F5, NOTE_G5, 0, NOTE_C6,0, 
  NOTE_D6, 0, NOTE_E6, NOTE_F6, 0, 
  NOTE_G5, 0, NOTE_G5, NOTE_E6, 0, NOTE_D6, 0,
  NOTE_G5, NOTE_E6, 0, NOTE_D6, 0,
  NOTE_G5, NOTE_F6, 0, NOTE_E6, 0,
  NOTE_D6, NOTE_C6, 0,
};

// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {
  8, 8, 8, 8, 8, 2, 4, 
  8, 8, 8, 2, 4, 
  8, 8, 8, 8, 8, 2, 4,
  8, 8, 8, 4, 8, 4, 8, 4, 8, 
  8, 8, 8, 8, 8, 2, 4, 
  8, 8, 8, 2, 4, 
  8, 8, 8, 4, 8, 8, 8,
  8, 4, 8, 8, 8,
  8, 4, 8, 8, 8,
  8, 2, 2, 
};


void setup() {
  pinMode(buttonPin1, INPUT_PULLUP);
  pinMode(buttonPin2, INPUT_PULLUP);
  randomSeed(analogRead(0));
  Serial.begin(9600);
  mySerial.begin(9600); // Starte die Kommunikation mit dem DFPlayer Mini


if (!player.begin(mySerial)) {  // Überprüfe, ob die Kommunikation erfolgreich ist
    Serial.println(F("Fehler beim Initialisieren des DFPlayer Mini!"));
    while (true);
  }
  Serial.println(F("DFPlayer Mini erfolgreich initialisiert."));
  player.volume(10); 
}

void loop() {
int buttonState1 = digitalRead(buttonPin1);
int buttonState2 = digitalRead(buttonPin2);

if (buttonState2 == 0){
delay(50);
// spiele Indy
  for (int thisNote = 0; thisNote <60; thisNote++) {
    int noteDuration = 1000 / noteDurations[thisNote];
    tone(12, melody[thisNote], noteDuration);
    int pauseBetweenNotes = noteDuration * 1.30;
    delay(pauseBetweenNotes);
    noTone(12);
  }
  delay(50);
  if (buttonState1 == 0) {
delay(50);
randomIntFolder = random(1,9);
randomIntTrack = random(1,5);
Serial.println(randomIntFolder);
Serial.println(randomIntTrack);
delay(600);
player.playFolder(randomIntFolder, randomIntTrack);
delay(20000);
if (buttonState1 == 1) {
  player.stop();
}
Serial.println(buttonState2);
player.stop();
  }
}

 char key = keypad.getKey();
  
    switch(key) {
      case '1':
        Serial.println("Taste 1 wurde gedrückt.");
        delay(50);
        Serial.println(buttonState1);
        if (buttonState1 == 0) {
        randomInt1 = random(1, 5);
        Serial.println("Random 1"); 
        Serial.println(randomInt1);
        player.playFromMP3Folder(1);
        delay(2000);
        player.playFolder(1,randomInt1);
        delay(2000);
        }
        break;
      case '2':
        Serial.println("Taste 2 wurde gedrückt.");
        delay(50);
        if (buttonState1 == 0) {
        randomInt2 = random(1, 7);
        Serial.println("Random 2"); 
        Serial.println(randomInt2);
        player.playFromMP3Folder(2);
        delay(2000);
        player.playFolder(2,randomInt2);
        delay(2000);
        }
        break;
      case '3':
        Serial.println("Taste 3 wurde gedrückt.");
        delay(50);
        if (buttonState1 == 0) {
        randomInt3 = random(1, 8);
        Serial.println("Random 3"); 
        Serial.println(randomInt3);
        player.playFromMP3Folder(3);
        delay(2000);
        player.playFolder(3,randomInt3);
        delay(2000);
        }
        break;
      case '4':
        Serial.println("Taste 4 wurde gedrückt.");
        delay(50);
        if (buttonState1 == 0) {
        randomInt4 = random(1, 5);
        Serial.println("Random 4"); 
        Serial.println(randomInt4);
        player.playFromMP3Folder(4);
        delay(2000);
        player.playFolder(4,randomInt4);
        delay(2000);
        }
        break;
      case '5':
        Serial.println("Taste 5 wurde gedrückt.");
        delay(50);
        if (buttonState1 == 0) {
        randomInt5 = random(1, 3);
        Serial.println("Random 5"); 
        Serial.println(randomInt5);
        player.playFromMP3Folder(5);
        delay(2000);
        player.playFolder(5,randomInt5);
        delay(2000);
        }
        break;
      case '6':
        Serial.println("Taste 6 wurde gedrückt.");
        delay(50);
        if (buttonState1 == 0) {
        randomInt6 = random(1, 5);
        Serial.println("Random 6"); 
        Serial.println(randomInt6);
        player.playFromMP3Folder(6);
        delay(2000);
        player.playFolder(6,randomInt6);
        delay(2000);
        }
        break;
      case '7':
        Serial.println("Taste 7 wurde gedrückt.");
        delay(50);
        if (buttonState1 == 0) {
        randomInt7 = random(1, 6);
        Serial.println("Random 7"); 
        Serial.println(randomInt7);
        player.playFromMP3Folder(7);
        delay(2000);
        player.playFolder(7,randomInt7);
        delay(2000);
        }
        break;
      case '8':
        Serial.println("Taste 8 wurde gedrückt.");
        delay(50);
        if (buttonState1 == 0) {
        randomInt8 = random(1, 3);
        Serial.println("Random 8"); 
        Serial.println(randomInt8);
        player.playFromMP3Folder(8);
        delay(2000);
        player.playFolder(8,randomInt8);
        delay(2000);
        }
        break;
      case '9':
       Serial.println("Taste 9 wurde gedrückt.");
        delay(50);
        if (buttonState1 == 0) {
        randomInt1 = random(1, 6);
        Serial.println("Random 9"); 
        Serial.println(randomInt9);
        player.playFromMP3Folder(9);
        delay(2000);
        player.playFolder(9,randomInt9);
        delay(2000);
        }
        break;
    }
  }

Similar Posts

Leave a Reply