Dialup Modem Nostalgia

dsc00820I was tidying up some boxes when I found an old dial-up modem.
It brought me back to the sound that it used to make, along with the pay by hour, slow speeds, drop-outs, the constant redialing when the ISP was busy and fighting for the phone line. All the terrible things that went with it, and yet, somehow nostalgic.

When my family started using the Internet we had a 14k modem and had to run a phone line extension cord up the hallway. We would dial into a bank of modems at my dad’s work, which would then connect us out to the Internet. After that, we upgraded to 33k and went with a service provider charging around $2 per hour!

But anyway, back to the modem in the box. I was looking at it thinking about how I could get it to simulate a working modem.
The first step was the teardown. On opening the case, it revealed a single board with not much of use on it.
I salvaged a few caps and de-soldered all the back ports.
These back ports were then all glued in, none are used apart from the on/off switch. They are just there to give it a “complete” look.

The next step was new lights. I was able to stick some LED’s behind the plastic front, using a glue gun. I then went through soldering each of the ground legs together.

dsc00821 dsc00823  dsc00822

For the electronics, I was after something compact which would run on 9v.

Hardware Used

  • Arduino Nano
  • Arduino SD Card reader
  • SD Card ( must be formatted as FAT16. Note the SD card size limitation with FAT16 of 2GB, potentially 4GB depending on the system. )
  • Project Speaker
  • 9v Battery clip
  • LM386 Low Voltage Audio Amplifier

For building the Amplifier I recommend following the examples on this page http://www.circuitbasics.com/build-a-great-sounding-audio-amplifier-with-bass-boost-from-the-lm386/
There are a number of different options you can go with when using the LM386.
Make sure you use an IC socket as the LM386 is easily damaged by heat.

Alternatively, you can get premade boards like the Adafruit mono amp ( note this is 5v, don’t connect up to your 9v line ), or a kit LM386 amp ( you will get a lot more power from this one )

Or an even cheaper method is a single transistor amplifier.

In terms of building the hardware, there is nothing too special. It’s really a process of building the amplifier, connecting the input to the selected audio pin on the Arduino ( in my case Pin 9 ).
Solder up the connections of the SD card reader to the Arduino, and solder the LED wires to the Arduino.

Two points to note is that the ground of the amp and the Arduino need to be tied together.
The second is, when the Arduino starts up, the Audio pin will float. This causes some terrible noise to come out the speaker. To get around this put a pull-down or pull-up resistor on the audio output pin.

The battery terminal runs through the on/off switch to the main supply rails for the Arduino and amp.

 

modem_bb

Arduino Code

The code was very simple. Basically use a library to play a WAV, and turn some LED’s on.

One thing to note about the WAV is that it needs to be 8bit, 16,000hz, mono and Unsigned 8bit PCM. If your audio is coming out as garbled data, then you most likely have the wrong format. This site is good for converting existing WAV and MP3 files http://audio.online-convert.com/convert-to-wav

To use this code you need the TMRpcm library installed.

/*
 * Written by John Croucher www.jcroucher.com
 */
 
#include "SD.h"
#define SD_ChipSelectPin 4
#include "TMRpcm.h"
#include "SPI.h"

TMRpcm tmrpcm;

// LED Pins
//int ledCS = ; // Clear to send
//int ledRS = ; // Request to send
int ledCD = 8;    // Carrier detected
int ledOH = 7;    // Off Hook
int ledRD = 6;   // Rec Data
int ledSD = 5;   // Send Data
//int ledTR = ; // Terminal ready
int ledMR = 4;   // Modem ready

int speakerPin = 9;

// SD Card reader uses Pins 13, 12, 10, 11

// Used for flashing the data lights
long randOn   = 0;
long randOff  = 0;


void setup()
{
  randomSeed(analogRead (0)); // randomize

  // Set our outputs
  pinMode(ledRD, OUTPUT);
  pinMode(ledSD, OUTPUT);
  pinMode(ledMR, OUTPUT);
  pinMode(ledOH, OUTPUT);

  tmrpcm.speakerPin = speakerPin;
  Serial.begin(9600);

  // Make sure we can access the SD card
  if (!SD.begin(SD_ChipSelectPin)) {
    Serial.println("SD fail");
    return;
  }

  tmrpcm.setVolume(5); // It struggles if we go past 5

  // Our "start up" sequence
  digitalWrite(ledMR, HIGH);  // Modem ready light
  delay(1000);                // Wait
  digitalWrite(ledOH, HIGH);  // Modem is off hook

  tmrpcm.play("1.wav");       // Modem dials and connects
  
}

void loop()
{
  // Once the wav finishes playing, flash the data lights.
  // On a real connection they would be flashing sooner but this is just easier
  if( tmrpcm.isPlaying() == false )
  {
    digitalWrite(ledCD, HIGH); // Carrier is detected
    dataFlash(ledRD);
    dataFlash(ledSD);
  }
}


void dataFlash(int pin)
{
  // Flash the data light randomly
  randOn = random (10, 100);
  randOff = random (20, 200);
  digitalWrite(pin, HIGH);
  delay(randOn);
  digitalWrite(pin, LOW);
  delay(randOff);
}

 

The last step is to greet your wife when she gets home, handing her your new toy, stand there with a cheesy grin while you watch in amazement as she shakes her head at you.


Leave a Reply