Apr 7, 2013

Portable TV, Raspberry-Pified

Recently I entered the era of video-capable portable music players. About time, too. My device of choice is this Action-branded Taiwanese gem from 1988 with a 5-inch CRT display (B/W), AM/FM radio, television receiver, and cassette player (mono, no rewind). It takes 9 D-sized batteries.

Action portable TV

The batteries inside were leaking quite a bit so I removed them in favor of a DC adapter. They actually occupied roughly half of the casing. After removing them the device looked very empty and was unbalanced because of the heavy CRT. So I had to come up with something to fill the space with.

Then it struck me: it's a perfect video terminal and tape drive for the Raspberry Pi!

The screen

The Action has a 5" black-and-white CRT display and a television tuner. The receiver is on an AN5151N integrated circuit. Now, the Raspberry Pi outputs composite video. Someone else has tried injecting composite video onto the AN5151N before, with results that didn't look very successful to me at first sight, so I just ended up buying a cheap RF modulator. It modulates a TV-frequency carrier with the composite signal, and that can be fed into the aerial input of the TV to be demodulated again.

The CRT as a video terminal

Aerial input to the TV is via a miniplug, so I had to improvise an adapter for coax. It works almost perfectly, except that the CRT crops out the extremes of the display.

The battery compartment before and after refurbishing:

Battery compartment

The tape

The cassette player of this device is pretty simple. It does not have stereo, rewind, auto-stop, or any of the other hi-tech functions that many modern-day Walkmen have. It doesn't even stop automatically when Eject is pressed. But it works.

Tape mechanism

I've written a little Perl program that can write data onto cassettes and read it back using a sound card. For this project I removed the sound card step. The way I've written the data onto the tape is such that when amplified with the tape player's U821B chip, the voltage can directly be used as a binary 3v3 GPIO logic level. I wouldn't recommend this though, unless you know what you're doing, because the GPIO port is essentially a direct connection to the CPU and there's no overvoltage protecti... blast, I've just fried my RasPi!

A moment of silence. And a screenshot honouring the memory of its last words over ssh. Here, a logic "1" is low voltage, and "0" is high.

~ - zsh ×
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111110110011Write failed: Broken pipe 2204 windy@pentti~ ) █

Anyway, I also modified the TV's power circuitry to supply power to both the CRT and tape player at the same time, and installed a switch to silence the speaker when reading data. If it weren't for the aforementioned overvolt accident, this would now be complete. Cassettes could be used to store e.g. Vectrex games; also reading C64 cassettes will be supported.

Moral of the story: The GPIO port is not 5V tolerant! Assuming there will a second attempt some day, I'll just use a transistor to pull the GPIO pin high when there's a high on the tape. Or use a sound card.

11 comments:

  1. Alternatively, you can use a current limiting resistor and/or a zener diode voltage clamp.

    ReplyDelete
  2. You might also look at adapting some of the ham radio digital modes for reading/writing to your cassette player. They generally work in the voice spectrum and are very robust.

    ReplyDelete
    Replies
    1. The problem with tape is that tape speed can be very unstable, which renders many high-speed modes unusable. Frequency-shifting a square wave seems to be quite robust. Also, reading the data does not require any complex circuitry, just a single transistor to decide whether the bit is high or low.

      Delete
  3. i'm sorry for your loss. may your RasPi rest in peace.

    ReplyDelete
  4. I have a similar tv, but without the cassette deck (which makes yours way cooler!). A 5 inch b&w screen and a radio and a mini plug ant in. How did you adapt the mini plug for coax? Is there an adapter I can purchase? Have been thinking of hooking my pi to it but wasn't sure it was possible until I found your blog post.

    ReplyDelete
    Replies
    1. I built an improvised adapter myself out of coax and miniplug leads. I cut the leads near the end connectors; used a continuity meter to connect the tip of the stereo miniplug to the tip of the coax, and the sleeve of the miniplug to the shield of the coax; and left the ring unconnected. A mono miniplug would probably work even better.

      Delete
  5. Frequency-shifting a square wave.. is that functionally equivalent to Manchester encoding?

    ReplyDelete
    Replies
    1. Not exactly, Manchester encoding is more akin to phase-shifting.

      Delete
  6. Excellent job! I made a very similar box from an old colour tv/clock/radio but had to use a scavenged video-uhf modulator to inject via the tv's antenna socket. It's running xbmc nicely though the smaller text is only just readable.

    I really like the tape storage idea :-)

    ReplyDelete
  7. I have a few similar TV/radio combinations. Some of them have a composite video input and some are RF only. Otherwise they are pretty much the same inside despite different brands on the front. I've been meaning to reverse engineer the composite video input.

    ReplyDelete
  8. How about using the radio for receiving data to RasPi? It would be cool to load a game via radio! Awesome blog by the way.

    ReplyDelete

To prevent spam, comments will only appear after moderation.