Carl Burks is a software developer for a global financial institution. With over ten years experience in technology and software development for financial organizations and over twenty years of software experience, Carl Burks provides articles, musings and insight into technology issues, software development, and other selected topics.

Arduino Project

2017-08-19T22:12:08.000-07:00

Authors:
Carl Burks
Punch Card Read with Nano For Scale

Punch Card Read with Nano For Scale

Well I've been playing with electronics again. I made a rookie mistake and started soldering before breadboarding. So I had to do some rework, but here is what I ended up with:

Resistors are 10kOhm RX.

Photoresistors are those little round things LDRX.

Analog input on Arduino AX.

Punch Card Diagram

Punch Card Diagram

I soldered up a Nano and hooked this thing up, I cut some 3x5 cards and tested it out:


// pin assignments
#define SENSOR_COUNT 8
#define THRESHOLD 300
#define CONNECTION_SPEED 9600
#define LOOP_DELAY = 1000
 // binary values
 int VALUES[8] = {1,2,4,8,16,32,64,128};
 void setup() {
    for(int i=0; i < SENSOR_COUNT; i++){
     pinMode(i, INPUT);
    }
   Serial.begin(CONNECTION_SPEED);
 }
 void loop() {
  int result = 0;
  for(int i=0; iTHRESHOLD){
      result += VALUES[i];
     } 
  }
 Serial.println(result);
 delay(LOOP_DELAY);
 }

That's about it. I read each resistor and total up the values and send it along. Next steps? Perhaps add a wheel that feeds the cards. Redo the reader a tension connection and a clock.

A more elegant solution