Automated Cassette Deck 23-Jul-2012 2:24 PM
Edit FancyEdit New New Blog Upload All Recent Home Logout

Table Of Contents

TOP

1. Overview

This project involves the conversion of a standard cassette deck (a Yamaha K-98) to something that is controllable by a computer, so that completely automated archival and capture of audio cassettes is possible.

The project consists of two parts. First is a hardware modification to the deck itself, allowing it to be controllable from a modern computer. Second is a set of tools on the host computer to control the cassette deck, capture audio, and convert the audio to specified audio formats.

TOP

2. Basic Process

The user will put a cassette in the deck, and about 90 minutes later, audio files will be complete on the host computer. This is accomplished by adding a few sensors, and hijacking buttons within the cassette deck.

A 'cassette is present' switch will notify the host software that a new tape is in place. The host will command the tape deck to rewind the tape. Once it's determined that it's done rewinding, it will start capturing audio, press play on the tape, and wait for the cassette to stop playing. At this point, it will have raw WAV/AIFF files on the host. It can then automatically process these to remove dead space at the beginning and end of the sides, and possibly splitting them based on silence within the tape itself. The software will also convert these to other target formats. For example, it will save aside the .WAV/.AIFF, and also produce an MP3 version, properly tagged, and ready to drop into an mp3 player.

TOP

3. Hardware

As far as commanding the deck, the host is connected to an Arduino microcontroller (although any micro will work), which toggles data lines. Those data lines are connected through a small relay board which "presses" the buttons on the front panel of the cassette deck. I had attempted to drive the buttons directly, but due to weirdness of the way it's multiplexed, I had to abandon that path.

The relay board is this circuit, repeated nine times, connected up to a handful of the switches for the front panel buttons (Play, Pause, Rewind, Fast-Forward, Deck A Direction, Deck B Direction, Deck Select, Record-Pause, and Mute-Search). The parts purchased from Mouser to build the relay circuit for this are:

Making each relay circuit $1.28 in parts, plus the board it's mounted on, interconnects and such.

I have pictures up online that show the implemented system.

Due to the LEDs being multiplexed in a complex fashion, the first version of the hardware will ignore the LEDs, and just do things as they're expected to work. This will make the logic a little more dumb with respect to understanding what's going on, but I hope to overcome this by adding a few switches to detect if a cassette is present, and if the cassette deck is doing something.

I'm also putting interface circuitry onto the relay board so that I can easily add in more switches/sensors later, along with a few indication LEDs. The full pinout/usage of the Arduino is as follows:

TOP

4. Software

The software on the host computer will essentially use lots of standard software, possibly a Processing program as a wrapper for it all. It will use standard command line tools to capture the audio, then tools like LAME and ID3Info for audio conversion and such.

The simple firmware in the Arduino simply listens for serial commands, and "presses buttons". (This will be expanded to include monitoring of switches eventually.)

// Cassette Deck Controller A
//  2011 Scott Lawrence
//
//  Preliminary firmware to "press the buttons" on the tape deck


void setup() {
  // set up pins as outputs
  int i;
  for( i=5 ; i<14 ; i++ ) {
    pinMode( i, OUTPUT );    
    digitalWrite( i, LOW );
  }
  Serial.begin(9600);
}

void togglePin( int pinNumber )
{
  // "press" the selected pin
  Serial.print ( "Toggle line" );
  Serial.println( pinNumber );
  digitalWrite( pinNumber, HIGH );
  delay( 200 ); // solid guess.
  digitalWrite( pinNumber, LOW);
}

void loop()
{
  int y;

  // if the selected character is pressed, press the tapedeck button...
  if( Serial.available() ) {
    y = Serial.read();
    if( y == 'd' ) togglePin( 13 ); // deck
    if( y == 'b' ) togglePin( 12 ); // b direction
    if( y == 'a' ) togglePin( 11 ); // a direction
    if( y == 'r' ) togglePin( 10 ); // <<
    if( y == 'p' ) togglePin( 9 );  // play
    if( y == 'f' ) togglePin( 8 );  // >>
    if( y == 'm' ) togglePin( 7 );  // mute search?
    if( y == 's' ) togglePin( 6 );  // stop
    if( y == 'c' ) togglePin( 5 );  // record pause?
  }
}
TOP

4.1. preliminary (not yet implemented) serial protocol:

Serial interface is 9600-8N1, with a series of single character commands. The on/off timing is handled by the host.

TOP

5. Next To Do