Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Data Storage Hardware Hacking IBM Robotics Build

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.
This discussion has been archived. No new comments can be posted.

Resurrect Your Old Code With a DIY Punch Card Reader

Comments Filter:
  • I'm lazy (Score:3, Interesting)

    by jmorris42 ( 1458 ) * <jmorris@[ ]u.org ['bea' in gap]> on Thursday July 26, 2012 @01:01PM (#40780583)

    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.

  • by na1led ( 1030470 ) on Thursday July 26, 2012 @01:07PM (#40780693)
    I bet most Android / iPhone cameras could scan those cards easily enough.
  • That's cheating! (Score:5, Interesting)

    by gallondr00nk ( 868673 ) on Thursday July 26, 2012 @01:11PM (#40780773)
    I was expecting something that mimicked the original way these cards were read. Anyone can take a photo of a punchcard :)
    • by Chris Mattern ( 191822 ) on Thursday July 26, 2012 @01:47PM (#40781419)

      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.

      Anyone can take a photo of a punchcard

      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.

      • Could still make a homebrew optical punch card reader pretty easily.

      • by na1led ( 1030470 )
        I can't imagine converting Punchcards would be a problem to anyone today. Sounds more like a fetish, or nostalgia to me.
        • 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.

      • Digital electronic overtook mechanical decades ago--that's why punch cards aren't used any more in the first place.

        Agreed, though he would have maxed his geek points if he'd implemented his machine emulator with Minecraft Redstones.

    • by adisakp ( 705706 ) on Thursday July 26, 2012 @02:25PM (#40782081) Journal
      It's a cool project but it'd be more cool if it didn't require manual intervention (turning a crank per card). How hard would it be to add a servo controlled motor to turn that crank so the entire process could be automated?
    • by mirix ( 1649853 )

      Came in here to post this. Maybe I have a new project to make... electromechanical punch and punchcard reader. :)

  • by gstoddart ( 321705 ) on Thursday July 26, 2012 @01:14PM (#40780835) Homepage

    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

    • 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...

      • by Lumpy ( 12016 ) on Thursday July 26, 2012 @02:06PM (#40781745) Homepage

        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.

        • by plover ( 150551 ) *

          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.

          • by Lumpy ( 12016 )

            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.

    • by rasper99 ( 247555 ) on Thursday July 26, 2012 @01:24PM (#40781017)

      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!

      • You kids don't know how good you got it with your newfangled "punch cards". Why, back in my day we had to use cuniform, on clay tablets. The BC2AD abacus bug made your "Y2K" problem look like a glitch.
        • Comment removed based on user account deletion
          • Walls? You had walls? Why, in my day, when we hadn't crawled out of the ocean yet, we had to position ourselves under the computer, blow an air bubble for 0 and make a little vortex for 1, and watch them rise into the reader. A large fish passing by could cause a transmission error that would make us start over from scratch.
            • by Lumpy ( 12016 )

              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.

      • by 1u3hr ( 530656 )

        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

      • /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

    • My doctoral thesis was a punch card program that could beat the world's best players at Tic-Tac-Toe. I still keep it around, next to my degree from Springfield Heights Institute of Technology.
      • by Anonymous Coward

        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. :)

        • by Anonymous Coward

          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.

      • Dr Falken?
    • by Anonymous Coward

      I've got some punch cards from about 25 years ago....(sunglasses on)....but they'll only work with an old Wang. yyyyYYYEEAAAAHHHHHH!!

    • by TBedsaul ( 95979 )

      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...

    • by diodeus ( 96408 )

      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

      • by plover ( 150551 ) *

        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.

    • Guilty.
    • Re: (Score:1, Interesting)

      by Anonymous Coward

      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

  • Why?
  • 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.

    • by Antipater ( 2053064 ) on Thursday July 26, 2012 @01:34PM (#40781187)

      I'm confused.

      Why would you want to use fewer legos?

      • by mcgrew ( 92797 ) *

        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).

    • 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!

      • by gl4ss ( 559668 )

        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).

  • by slashmydots ( 2189826 ) on Thursday July 26, 2012 @01:19PM (#40780931)
    I'm 25 and I play a Sega Genesis emulator sometimes because those old games bring back fond memories and had such a different play style and difficulty. That's sort of the difference here. Who the hell had anything positive to say about punch cards back in the day that would make them want to experience it again? Fires, drops, manual collating, 1 missing card...everyone hated them! Nobody is going to say "oh wow, this is so fun just like back in the day" because it wasn't; it sucked.
    • Re:I don't get it (Score:4, Interesting)

      by gstoddart ( 321705 ) on Thursday July 26, 2012 @01:31PM (#40781137) Homepage

      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?".

      • by mcgrew ( 92797 ) *

        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

        • 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

          • Comment removed based on user account deletion
            • 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

      • That must be the same reason that Jews get together for Hollocaust parties.

    • 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

      • by lgw ( 121541 )

        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.

    • by bws111 ( 1216812 )

      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.

    • 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.

  • by Sporkinum ( 655143 ) on Thursday July 26, 2012 @01:29PM (#40781113)

    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]

  • by ackthpt ( 218170 ) on Thursday July 26, 2012 @01:36PM (#40781227) Homepage Journal

    You insensitive clod!

    • by PPH ( 736903 )

      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.

  • Get back to work on my 8" floppy reader!
  • I loved the confetti I would takes bags of the punched chads to the local football games and let the kids go wild throwing the stuff. They loved it.
  • by Guano_Jim ( 157555 ) on Thursday July 26, 2012 @02:37PM (#40782365)

    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.

  • If you're doing this to learn something, do it the old fashion way. This method requires new technology, and thousands of lines of program code, to extract a few dozen lines of old code.
    • by Mal-2 ( 675116 )

      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)

    by twmcneil ( 942300 ) on Thursday July 26, 2012 @04:04PM (#40783655)
    Compared to the real thing, this is a wee bit slow. But of course I threw out all my punch cards years ago. They warped so bad in about 12 months time that they would jam the reader.

    Quick way to win friends, jam the reader with about 15 people behind you.

    Now get off my lawn!
  • Look at the title of books and documentation from the period when they were in use. They
    ALWAYS refer to them as PUNCHED cards.

  • by tomhath ( 637240 ) on Thursday July 26, 2012 @04:55PM (#40784159)
    Just wondering, in case it's ever an issue.
  • 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.

  • 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

Life is a game. Money is how we keep score. -- Ted Turner

Working...