Any tips for building a punch tape reader?

I’ve been working on a project to teach turning complete electronics and wondering if anyone has any advice for a neophyte.

I’ve dug around and it looks like I could make this using an ir beam sensor, a 130 Size DC motor, and maybe a Adafruit FT232H Breakout for serial data but the parts in between I’m sketchy on.

Like what would I need to convert the high/low values from the IR sensor array to something the ftdi chip can output as ascii? How about a sort of internal buffer? and what would I need to drive the DC motor?

Adafruit usually has good tutorials. And it looks like they have some for that device…

The 5V / GND pins can provide up to 400 mA from the USB bus so that can be used to power the IR sensor.

According to the tutorial pins C0 through C9 are general purpose I/O with a caveat about C8 and C9 so C0 through C7 are good choices for the IR sensor readings.

In how many directions will the motor travel: One or two?

I’m following ECMA-10 standards (poc is double sized in dimentions but pins are the same though) so Pins C0:C7 is more than enough, The motor though it would be nice to be able to back out in a jam but that’s an “advance” feature so just one direction is fine in this version.

5 hole or 8 hole?

I’d recommend using an Arduino with a stepper controller. Use the stepper to turn and feed the tape then use additional pins to read the phototransistors that will shine LED light through the holes in the paper. Use the sync holes to determine when a valid value is being read then output that character to the RS-232 port to the computer.

You’ll need some block the paper passes through that shields the phototransistors from ambient light and light from adjacent holes.

That’s the general idea but I’m going with IR sensors so timing is as fast as the holes pass by and its more closer to the modern equivalent (dvds). And ecma-10 defines eight holes for 7-bit ascii plus parity bit.

In which case a single transistor (plus current limiting resistor) should suffice for controlling the motor. I suspect the folks in Electronics can provide you with something appropriate.

You will need a way to power the motor. Powered directly from the USB port is generally a bad idea.

Do you need to control the motor speed?

Do you need to control the motor speed?

Well since the end results is going to be turned into a single board portable device which via adapters talks to vintage systems or modern systems with native usb. That’s another part which is fuzzy to me since I’m thinking the end computing device should not send an ack signal and just read the stream as needed but that gets one to ponder;

  • Should there be an internal buffer to this reader and have the tape continuously read as fast as it can which dumps to the buffer and the ftdi reads from that
  • Have the reader pause to let the end system catch up
  • Limit the timing on the motor to the speed of the serial bus

any thoughts or comments on those options or even better ideas?

I used a number of commercial tape readers with minicomputers in the late 60s. Here are tips from a few memories imprinted in my brain by painful experiences.

  • Optical readers were an awesome step up from the Teletype ASR 33 and 35 mechanical readers.
  • But differences in the opacity of the tape could case problems with optical readers. Be sure you can compensate.
  • The timing hole is smaller than the data holes. In theory, data was read when the light through the timing hole was at its max. Worked well on good days.
  • When something goes bad at 300 or whatever cps, it goes bad really fast. (Characters per second was popular before we started talking bytes. After all, many of the early computers were based on six bits instead of the now standard eight.)
  • The reader should be able to read one frame at full speed and stop half way to the next frame. It should be able to be back up to speed to read the next frame when needed. The solenoid sounded like it could cause spikes in the power bus. This is not critical since you will be clocking based on position of timing holes.
  • Pulling tape from a large roll is sometimes a problem.
  • Keep clumsy people away if you do not use a take up reel.
  • Hanging chad was a problem long before the Florida election made the news.
  • Moore’s law rate of improvement over five decades gives us 2TB $25 flash drives!!!

On a more recent topic, if you interface TTL and RS232, just buy a module. I tried to build one for a high altitude balloon/ham radio project with a MAX232 chip and the required five capacitors. It did not go well.

Good luck on your project!

2 Likes

Were I in your shoes I would replace the Adafruit FT232H Breakout with a Teensy. They are both presented to the host computer as a serial device. Using a Teensy (or something similar) would allow you to move some / most / all of reading the tape closer to the hardware that is actually reading the tape. This would allow you to much more easily manage motor speed, perform buffering, whatever else you may need to do to reliably read the tape.

With the FT232H Breakout all of the code would reside in the host computer. Anything that is time critical (e.g. checking the “sync hole” sensor before the “sync hole” has moved past the sensor) is trivial with a device like a Teensy but can become challenging from a host computer through a USB / serial port.

So, for your three bullets…

If the buffer needs to be bigger, buy a bigger Teensy.

The breakout (boards that use a serial converter) has a maximum baud rate; probably about 2 Mbps. The Teensy communicates with the host at 12 Mbps. The higher rate makes it easier to manage buffering.

Buffering will make the system more efficient. But, given the speed at which a strip of paper can be reliably moved, I suspect buffering will not make much difference.

Flow control is important. Were I in your shoes I would…

  • Data is read from the tape into a circular buffer. When the buffer is full, reading stops.

  • Data is read from the circular buffer to the host computer. When the buffer is not full, reading resumes.

With one wrinkle…

  • Include a mechanism for passing error codes in the same stream as data.

At 12 Mbps I doubt the paper tape can be moved at anything close to that speed.

1 Like

That mandates the tape drive mechanism be able to back up and resync with what is already in the buffer.

1 Like

These are all wonderful ideas guys. thanks for helping point me in the right direction.

I’d like to get a few things out of the way;

  1. if I’m lucky to get 9600 buad then I’d be ecstatic. if its 300 baud then there’s room for improvement.
  2. After talking with a few guys in the Electronics room I got an idea to either use i2c/spi or (which I prefer) a series of shift registers with the clock latching based on the parity bit of the tape and a 555 timer.

Now with that in mind would there be any extra chips needed to drive the motor and what kind of capcitor’s and resistors would I need to acquire for the build?

2 Likes

This should be a fascinating project and I encourage you to keep updating this post with questions, plans, trial, errors and successes. Programming will be a non-issue with you but the electro-mechanical aspects will be a educational experience for us all.

1 Like

updating this post with questions, plans, trail, errors, and successes.

Gladly! There’s a github up with the fritzing project files and a bit of notes already.

If either I can get some volunteers or the extended time to sort out the studio then I can do a few youtube videos of the build and development.

1 Like

New round of questions with system control. I was thinking instead of say a latch or push button wired to the 555’s reset maybe just use the rs232 xon/xoff instead. Would there be any extra chips needed or how would that look?

And how about flow control?

Been digging around and working with the bread boarding in fritzing.

It looks like I might need to use a few 610-2N5963 to build an and gate to the clock, dtr rail (ir sensor for tape and max232 dtr pin) for flow control of the dc motor.

I can for see a little issue though, even though I’m using hardware control for clocking the motor’s rotation in time with the io. There may be a few instances where the end device is not able to read quick enough so I might have to add some sort of cmos hex buffer before the SN74HC165NHC.

Which gets me to ponder, instead of using two CD4049UB is there a 8 channel cmos buffer?

If you use a stepper motor, you have precise control over position and speed.

1 Like

All the parts have came in so far now its just time to build out the controller. I’ll have to start with the motor and see if I can get it to rotate at lease around 96k otherwise I’ll need to work out the gearing ratios.

While we wait; check out this turning machine tape reader: