Resurrect Your Old Code With a DIY Punch Card Reader 100
First time accepted submitter mchnz writes "Need to read in some old punch cards? Have a hankering to return to yesteryear? I've combined an Arduino, the CHDK enhanced firmware for Canon cameras, and the Python Image Library to build a reader for standard IBM 80 column punch cards. You can see it in action in "Punch Card Reader — The Movie" or read more about it." This is an inspiring, intimidating project.
I'm lazy (Score:3, Interesting)
I'm too lazy for all that lego building. If I needed to read punch cards I'd just find a scanner that would accept media that narrow and feed em through the ADF, feed that PDF into a script to pop apart the pages and then process the images.
Re: (Score:2)
Call around. There are still places with punch card readers installed, even if they don't turn them on very often. Lots of universities etc. ;-)
State of Florida.
They will probably read them in and email you the file for less than the cost of that crank shaft thingie.
Re: (Score:2)
Re: (Score:3)
I was kind of hoping for some pin-based contraption. I mean image based is obviously the better way to do it, but still..
Pin-based contraption? Easy there Hollerith, it's not 1890 any more! Put down that abacus, we're not dropping pins through holes in to cups of mercury these days.
Check out the IBM 2501 -- it's optical, sweet-cheeks -- You can't do >500 cards/minute with one of your antique mechanical reader! Get with the times!
Make a Phone App (Score:3)
That's cheating! (Score:5, Interesting)
Re:That's cheating! (Score:5, Insightful)
Digital electronic overtook mechanical decades ago--that's why punch cards aren't used any more in the first place. It therefore follows the smartest way to deal with any problem of this sort is to get it converted to electronic ones and zeros as quickly and simply as possible, no matter how dirty, and then process the digital data to get what you need. In this case, that's getting a digital photo of the punchcard, and then doing your work on that.
Indeed they can (don't forget to use your wooden table!). Then doing OCR on that photo to extract the data the punch card contained is a little more involved, however.
Re: (Score:2)
Could still make a homebrew optical punch card reader pretty easily.
Re: (Score:2)
Re: (Score:2)
Only in rare circumstances. I recently heard a program about a guy who was trying to solve the Pioneer Anomaly, and he had to go find old boxes of punch cards and convert that data, in order to determine the spacecraft's exact positions when it was still in the Solar System. But yeah, pretty rare.
Re: (Score:2)
Agreed, though he would have maxed his geek points if he'd implemented his machine emulator with Minecraft Redstones.
Re:That's cheating! (Score:4, Insightful)
Re: (Score:2)
Came in here to post this. Maybe I have a new project to make... electromechanical punch and punchcard reader. :)
OK, show of hands ... (Score:4, Interesting)
OK, this is really cool ... but how many people still have decks of punch cards?
The closest I've been to them is a box we had of them we used for notes.
Though, given the level of technology pack-rats we likely have on Slashdot, I expect several people to say they still have some cool program or another tied up neatly waiting for just such a thing. :-P
Re: (Score:2)
Probably a few; I'll bet I could even find them. I've also got a few programs that I dumped to paper tape through an ASR33 when I was getting ready to graduate high school. I've thought about fishing those out, building a rig to pull them past my EX-FC100 while it's in 1000FPS mode, and seeing whether a paper-tape reader can outrun a 9-track tape drive...
Re:OK, show of hands ... (Score:4, Interesting)
I service a CNC machine at a machine shop that STILL uses paper tape. I am the only guy that will touch the old hardware so I get paid $150 an hour to tinker with the stuff. Hell they cant find a IT company that can handle DOS so I also pick up the other old machines.
I love it, 1 long afternoon/evening there and I go home with $1000 in my pocket.
Re: (Score:3)
I service a CNC machine at a machine shop that STILL uses paper tape. I am the only guy that will touch the old hardware so I get paid $150 an hour to tinker with the stuff. Hell they cant find a IT company that can handle DOS so I also pick up the other old machines.
I love it, 1 long afternoon/evening there and I go home with $1000 in my pocket.
This bothers me. You could easily replace the paper tape reader with a computer based solution - all the paper tape readers we had on our CNC machines 25+ years ago were interfaced with ordinary DB-25 RS-232 connections. Back then I just stuck a BlackBox short-haul modem on them to run the wires back to the foreman's office, where the other modem was plugged into an original IBM PC. A simple GW-BASIC serial program allowed them to load and store their programs to a hard disk, which was backed up nightly.
Re: (Score:2)
The owner of the shop understands the old system. so he keeps it working.
The Owner outranks a cobbled together solution, and I prefer the monthly $1000 bonus to my income.
Re:OK, show of hands ... (Score:5, Interesting)
I have punch cards on my desk at work so I can remember back to a time when computers and software worked reliably. Why read the holes if the keypunch machine printed the characters above the columns?
I also have the heads and voice coil from a 185MB CDC removable disk drive (approx 15" long) in case I have to smack some young whippersnapper upside the head!
Re: (Score:3)
Re: (Score:3)
Re: (Score:3)
Re: (Score:2)
Water? You had Water?
We had to float there in the solar system dust disc putting negative or positive charges on dust particles bu bending light rays from the sun with our thoughts.
Re: (Score:1)
I know, it was rising to a crescendo and then YOU showed up and brought it all down.
Way to go
Re: (Score:3)
Luxury. We had to create the entire universe ourselves just to make an apple pie from scratch!
Re: (Score:3)
I have punch cards on my desk at work so I can remember back to a time when computers and software worked reliably.
Reliably? I have very unfond memories of my student years, the night before a project was due, standing in a queue in front of a bank of card readers waiting to run my Fortran or Cobol program. Then when the reader chewed up a card, going back to make a new card and waiting another 20 minutes to try to read it again. All the time the card readers were heating up and one by one stopping dead, so the queues got ever longer.
In second year we were granted the privilege of using a keyboard with attached line p
Re: (Score:1)
/rolls eyes
You know, dude, my abacus has NEVER crashed, not once EVER*. Therefore, all modern computers are unreliable.
* except that time I dropped it
Re: (Score:3)
Re: (Score:1)
I solved Tic-Tac-Toe once. I found if you don't make mistakes, whoever goes first either wins, or the game is a draw. :)
It's not that hard a game though.
Re: (Score:1)
That's only true of certain special cases of Tic Tac Toe.
In N-dimensional tic tac toe. it's not possible to foce a tie unless the size of each dimension is 1 more than the number of dimensions.
Re: (Score:2)
Re: (Score:2)
Number of players: zero.
Re: (Score:1)
I've got some punch cards from about 25 years ago....(sunglasses on)....but they'll only work with an old Wang. yyyyYYYEEAAAAHHHHHH!!
Re: (Score:1)
I keep a pack of unpunched cards, just in case. I also have a very old Radio Shack desktop punchcard reader.
Been waiting for an excuse to break it out and save the day for the last 30 years. Any day now...
Re: (Score:2)
In Grade 11 (1982) we were forced to use he punch-card machines in com-sci class for the first week. The deck would be sent over to the Board of Ed office and run on their machine overnight, then your printout would be sent back to your school the next day. It was a lesson in being accurate and checking your work, which was sadly lost on the bunch of us.
Then came the day where I found this drawer where all the "holes" went. This resulted in a big confetti fight in the teacher's parking lot.
Next week we move
Re: (Score:2)
One cool thing about modern equipment is it makes Test Driven Development possible. Crank in a tiny change, and check it instantly. Your turnaround is a few seconds, and refactoring makes you improve as you go. Not that you shouldnt be smart, but you're leveraging the compiler to do syntax checking instead of an overnight drop-n-pray process.
Re: (Score:2)
Re: (Score:1, Interesting)
My former employers signed a contract with the US EPA that included a promise to archive the data from the project. After a while they realized that the idiots who wrote the contract hadn't specified a retention period. So we called the EPA, who laughed and said "keep them forever, suckers!"
So I took the IBM punch cards that held the information and triple wrapped them in plastic and aluminum foil under an inert atmosphere, then took the resulting bricks and stacked them in a dank basement, with signs tha
Uh (Score:2)
Horribly inefficient (Score:3)
Why not use a desktop scanner with a feed tray and process that? Eliminate the need for the fancy camera rig, arduino, legos, etc.
You could still do all the python processing, but it would be far mor efficient and less prone to bugs.
Re:Horribly inefficient (Score:5, Funny)
I'm confused.
Why would you want to use fewer legos?
Re: (Score:2)
Back when Hollerith cards were used, computers had little memory, and you had to write the tightest code possible. Fewer legos is like fewer commands. Back then, if you could write the same program I could write with a hundred bytes but use only fifty, you were twice as good as me (or more, because compuers were slower and sparce code runs faster).
Re: (Score:2)
Why not use a desktop scanner with a feed tray and process that? Eliminate the need for the fancy camera rig, arduino, legos, etc.
You could still do all the python processing, but it would be far mor efficient and less prone to bugs.
Camera rig? Actually, since I do have quite a few boxes of old punched cards, I've been fighting the impulse to build a Lego+arduino reader myself. Ironically, one of the biggest obstacles is that a standard Hollerith card isn't quite an even number of Legos in height.
On the other hand, my Arduino has 12 input channels, so I could hook up a discrete optical sensor to each one!
Re: (Score:2)
this build uses a camera rig. essentially the arduino is there just to instruct the camera to take a picture and to release the card.
would be far more cooler arduino ad if the arduino did all the punch-card decoding and scanning.
with chdk and flash as card release(for the card release servo activation) I suppose you could do this whole thing without the arduino at all (card comes down, closes circuit which snaps the picture, flash activates and releases the card).
I don't get it (Score:3)
Re:I don't get it (Score:4, Interesting)
Because, like anything, if you were there for it, you might have some nostalgia for it. It's something you did that most people can't even imagine having to do -- like programming in assembly, or walking to school (uphill, both ways).
I had a prof in university who used to wistfully tell me about toggling in the boot sequence with the buttons on the front of the machine. Hell, he once gave me the manual for the Winchester ST-506 hard-drive controller, and had me write the metal-up code to handle the HD -- about as bare metal as you can get as you shoved a byte into a register and wait for an interrupt to happen to respond to it. I still think that was kind of cool, but it's not something everybody wants to do. But, I gotta say, writing my own cat, ls, rm, mv etc in DOS going straight into the FAT filesystem, and knowing there wasn't a single line of code between me and the hardware I didn't write was fun and rewarding.
I bet most people using computers never had to deal with IRQ assignments for hardware to make them all work together. It was a pain in the ass, but we all fought through it.
And, finally, like so many of these technology projects "because I can" is sometimes all the reasoning you need. People do all sorts of stuff in their spare time, and one person's "shiny fun toy" is another person's "WTF would you do that for?".
Re: (Score:2)
It's something you did that most people can't even imagine having to do -- like programming in assembly, or walking to school
Why, thank you, young fellow! To tell the truth, I rather enjoyed learning assembly (but I've always enjoyed learning anyway). Assembling the machine code by hand since I had no assembler was a bit of a pain, though... I had to walk to school, but there were no hills. And no computers (I had a slide rule to cheat in math class with).
I bet most people using computers never had to dea
Re: (Score:2)
Plug and pray added lots of fun...
I remember having to use debug to step into ROM code on an ESDI controller to setup sector sparing (62|63|64) sectors per track indicating (2|1|0) spare sectors... Trade space now for reliability later? How much space?
Then you had to "format" the drive with it's sector map, only then was it ready for FDISK and a DOS format.
good times...
Still have that machine around somewhere for two old games... Need to port them to DosBox and toss the machine.
-nB
Re: (Score:2)
Re: (Score:2)
Let's see...
When I was handed down the 286 with the Wren III 160 meg ESDI drives I was in 7th or 8th grade, so I was still learning some of the math involved... To me I remember hex numbers being magic strings that did things and loosely related to something called binary, also magic strings, that the computer understood. I knew they were number systems, but they were still disjointed from decimal. now after 12 years in the industry preceded by 10 to 15 years of a computer at home, all this and octal are
Re: (Score:1)
That must be the same reason that Jews get together for Hollocaust parties.
Re: (Score:3)
I'm pretty sure the average veteran of punch-card computing was more tactilely aware than a young adult of today like you or me. Missing or dropping a card would've been more rare—and there actually were automated sorting machines, some of which had very clever was of mechanically implementing mergesort.
Not all nostalgia is exactly about the same kind of fun, though. Once you got past the nittiness and the grittiness of how the code was written (i.e. generally in a very limited compiled language, or a
Re: (Score:2)
and there actually were automated sorting machines, some of which had very clever was of mechanically implementing mergesort.
That's radix sort [wikipedia.org], not merge srot, BTW. For a while "order N sort" questions were all the rage in job interviews, and radix sort was my favorite piece of trivia, as it can be implemented mechanically with very strict memory limits.
Re: (Score:2)
He didn't create a punch, he created a reader. Maybe someone does have a box of old cards laying around - it would be pretty cool to be able to read them, wouldn't it? Sure, most of the cards are probably worthless, but I bet there are still a few gems of early examples of programming on them.
Something Positive (Score:2)
Had a work study job in the computer Lab at the University of Wisconsin. Went on more than one date with a pretty coed after helping her pick up and arrange the box of punch cards she dropped.
Now that is a positive you don't get with today's mass storage.
IBM Interpreter (Score:3)
Takes me back to my old Air Force days as a computer operator. Had to run decks through the 558 twice, replacing the wiring panel, to interpret all 80 columns.
http://www.columbia.edu/cu/computinghistory/interpreter.html [columbia.edu]
All my best code is on paper tape (Score:3)
You insensitive clod!
Re: (Score:3)
Just like the British Colossus [wikipedia.org]. Interesting note: The CPU clock was taken from the input paper tape sprocket. So you could 'overclock' the system right up to the point at which the tape would break.
Re: (Score:2)
This thing is glacial, whereas the original card readers read these things as fast as you could push them through.
Actually the early electronic ones (the ones with relays hooked to the computers with tubes), ran the card about one per second. Still faster than this, of course. (The sorters ran a lot faster.)
Go all the way back to Hollerith and even a sorter was about the same speed:
- Worker puts the card in the "press" and closes it (pushing pins through the holes and into the (pool of mercury?) b
Quit screwin' around! (Score:1)
I loved the confetti (Score:1)
Re: (Score:3)
The earliest drives (RAMAC and the like) also had integral disks (with the spin motor integral inside the hub - with spare windings so you didn't lose your data if one burned out). But soon after that they went to removable packs, which was the way it worked for a while, with "washing machine" drives and "single platter in slot" drives.
But they had a lot of problems with contamination. And as the bits got closer together and the heads flew lower they were running into a serious issue.
The breakthrough came
My favorite part about this video. (Score:5, Insightful)
When I hit that video the first time, the first couple of comments on that video aren't "cool!" "nice job!" or anything resembling constructive criticism. It's all "this is the wrong tech for the job" "seems like a hell of a lot of effort just to read what's already on the top of the card," etc.
Haters gonna hate, I guess. But what ever happened to just enjoying a hack for a hack's sake?
I think it's clever. Who cares how much time the guy spent, what technology he chose, as long as he enjoyed doing it.
What's the point (Score:2)
Re: (Score:2)
It's hardware that he already had though. If a card reader could be had at a local garage sale and refurbished in a weekend, he probably would have done exactly that -- but it can't, for most people. The code was probably fun, as was building it from Lego pieces.
Kinda Slow (Score:4, Funny)
Quick way to win friends, jam the reader with about 15 people behind you.
Now get off my lawn!
Re: (Score:2)
Oh God, I'm old.
The correct term is PUNCHED card (Score:1)
Look at the title of books and documentation from the period when they were in use. They
ALWAYS refer to them as PUNCHED cards.
Does it read hanging chads? (Score:3)
One terabyte in boxcar-fulls of punched cards... (Score:3)
A now-common one-terabyte disk drive, represented on punched cards, would occupy a cube approximately 15.3 metres (50 feet) on a side... similar to a decently sized five-story building, and would have a mass of over 34,000,000 kilograms.
If loaded into standard U.S. railroad boxcars, that one terabyte would physically fit inside 17 boxcars but because of weight would have to be divided amongst 631 boxcars (each boxcar being rated at 60 tons, or about 1.5 terabytes' worth of punched cards). That works out to a freight train over seven miles long.
Slowest punched-card reader ever (Score:2)
I don't want to pick on this too much. There are plenty of cool things that this developer did that are intesting in their own right. For instance, the image processing. But it looks like this machine is mostly manual. Doesn't it seem obvious to make it crank out the cards automatically? And couldn't the pictures be taken more quickly? And aren't there more efficient ways of detecting the holes in the cards? It's an interesting machine, but it's definitely not an efficient solution for this specific