Generic Tactile Interface

I find when I’m first playing with a physical computing idea, I often need to hook up a couple buttons, a couple knobs, and just get some basic input happening on the Arduino. This has come up enough that I decided to make a generic IO board that I could reuse.

The schematic is basically this:

IMG_5768

Ground was common to all components, and +5V went to the three potentiometers. Once those were soldered, everything that remained was an I/O line, so I soldered those to ribbon cables and headers that would be easy to connect to the Arduino. It would have been even better to use two rows of headers in the shield format, so an Arduino could just plug right in, but I couldn’t figure out a quick and easy way to do that in wood.

The final build came out like this:

gti-build

The test code is:

/*
Generic Tactile Interface
3 potentiometers on A0, A1, A2
6 switches on D2-D7
2 LEDs on D8 and D9
*/

byte blueLED = 8, yellowLED = 9;

void setup() {
  pinMode(blueLED, OUTPUT);
  pinMode(yellowLED, OUTPUT);
  pinMode(A0, INPUT);
  pinMode(A1, INPUT);
  pinMode(A2, INPUT);

  for (int i=2; i<8; i++) {
    pinMode(i, INPUT);
    digitalWrite(i, HIGH); 
  }

  Serial.begin(9600);
}

void loop() {
  Serial.println("#############");
  Serial.print("A0: ");
  Serial.println(analogRead(A0));
  Serial.print("A1: ");
  Serial.println(analogRead(A1));
  Serial.print("A2: ");
  Serial.println(analogRead(A2));
  Serial.println();
  for (int i=2; i<8; i++) {
    //Serial.print(i + ": ");
    Serial.println(digitalRead(i)); 
  }
  Serial.println();
  digitalWrite(blueLED, HIGH);
  digitalWrite(yellowLED, LOW);
  delay(200);
  digitalWrite(blueLED, LOW);
  digitalWrite(yellowLED, HIGH);  
  delay(200);
}

The output to the serial window is along these lines:

#############
A0: 285
A1: 114
A2: 136

1
1
1
1
0
0