Home‎ > ‎

Video Production TouchBox



What is a TouchBox?

We built thisTouchBox to enable us to quickly document and publish the projects we are working on and to share with our colleagues or  on YouTube. We tend to make video as this is the quickest way to record video blogs and is as a form of a 'Lazy' documentation of what we are doing or have done. If we don't do this,  then we normally don't make enough notes and we then forget how what we actually did after a few weeks.  




The idea came from an Arduino 'maker';  Ralph S Bacon,  who created an excellent YouTube video of his design and construction. 

We basically just took his idea and  rather than using the 30 Cap1188 Touch Sensor  module for the capacitive touch switching, we merely used the available Analogue ports directly on the Arduino. The main reasons being that we didn't have one handy  and it works good enough for what we want to use it for. It's not as sensitive as the design from Ralph S Bacon;  but it does the job for now. We may make another version with the  30 Cap1188 Touch Sensor  module if this proves to be useful. 

Here are some details of how we made our Proof of Concept. We then went on to make a PCB and the details will follows shortly.:

Controller

We used the Arduino / Genunio Micro, as that has 12 Analogue ports available. The main purpose is that the Micro is the smallest board of the family, easy to fit in a small box. The Micro is based on the ATmega32U4 microcontroller featuring a built-in USB which makes the Micro recognizable as a mouse or keyboard

Arduino / Genuino Micro



Enclosure Design

We simply covered the plastic box with masking tape and marked the position of the holes to drill. We wanted to use the full 12 analogue ports provided by the Genuino Micro so we drilled 12 holes for small M3 bolts.

We drilled out all the holes and an extra one in the top for an LED. We off-set the holes so we had some room for a legend. 



Marking out the lid



 We soldered wires on to M3 washers and fixed these with M3 nuts. 

Soldering touch sensor washers

Here are the 12 touch sensor wires and LED fixed to the lid
 
Touch Sensors


For the PoC we just used a small prototyping board and connected all the wires directly onto that.



the prototyping board was fixed to the box with double sided tape onto the back and ran the USB cable through the side of the case. That was basically all to it ! 




Arduino Sketch

The Arduino sketch is available on our GitHub and below. You'll need to install the keyboard.h and capactiveSensor.h libraries.

We merely configured  each touch switch as CTL-SHIFT+1 to CTL+SHIFT+9 and also CTL+Shift + Q & W, but you can change the sketch to how you like. We also triggered keyboard sequences based on switch combinations; for example by holding down touch switch 11 and 12 -  it sent the keyboard characters CTL+Shift+E to the PC. The OSB application (see below) was then configured to switch scenes when this key combination was received. 

Connection to Video Production Application

We used the Open Broadcaster Software  OBS recommended by Ralph S Bacon. We just  downloaded the software, connected various USB cameras into the PC. Then mapped the video inputs to the softkey codes sent from the Arduino as a keyboard sequence.   This was almost plug & Play after figuring out the concept of building Scenes and then creating "banks" of switches.

For now we've just used 3 main  "Scenes" and mapped the input sources accordingly to switches. This way you can re-use the same switches many time - but to to trigger different functionality. A card of each "scene-map" was created as an memory jogger which helped to remind us what the commands and which switch does what. We'll probably add that to a legend. 

There are Android apps that does this too, which I check-out one day.

Here is a video (Sorry -  the sound quality is really bad!)

Video Changer Touch Box


Next Steps

  • Use a microphone!
  • Keep playing to figure out what works best
  • Make a PCB for the electronics instead of the prototyping breadboard
  • We may make a PCB the fits in the lid as the "touch" sensors rather than using bolts. 

Sketch

#include <Keyboard.h>
#include <CapacitiveSensor.h>

/*
 * CapitiveSense Library Demo Sketch
 * Paul Badger 2008
 * Uses a high value resistor e.g. 10M between send pin and receive pin
 * Resistor effects sensitivity, experiment with values, 50K - 50M. Larger resistor values yield larger sensor values.
 * Receive pin is the sensor pin - try different amounts of foil/metal on this pin
 */

// use this option for OSX:
char ctrlKey = KEY_LEFT_CTRL;
char shift = KEY_RIGHT_SHIFT;
// use this option for Windows and Linux:
//  char ctrlKey = KEY_LEFT_CTRL;  




   

//CapacitiveSensor   cs_2_0 = CapacitiveSensor(2,0);        // 10M resistor between pins 4 & 8, pin 8 is sensor pin, add a wire and or foil
//CapacitiveSensor   cs_2_1 = CapacitiveSensor(2,1);        // 10M resistor between pins 4 & 8, pin 8 is sensor pin, add a wire and or foil
//CapacitiveSensor   cs_2_2 = CapacitiveSensor(2,2);        // 10M resistor between pins 4 & 8, pin 8 is sensor pin, add a wire and or foil
//CapacitiveSensor   cs_2_3 = CapacitiveSensor(2,3);        // 10M resistor between pins 4 & 8, pin 8 is sensor pin, add a wire and or foil
//CapacitiveSensor   cs_2_4 = CapacitiveSensor(2,4);        // 10M resistor between pins 4 & 8, pin 8 is sensor pin, add a wire and or foil
//CapacitiveSensor   cs_2_5= CapacitiveSensor(2,5);        // 10M resistor between pins 4 & 2, pin 2 is sensor pin, add a wire and or foil if desired

// make sure the actual pin number is used rather than the analogue port number
CapacitiveSensor   cs_2_4 = CapacitiveSensor(2,4);        // 10M resistor between pins 4 & 6, pin 6 is sensor pin, add a wire and or foil
CapacitiveSensor   cs_2_6 = CapacitiveSensor(2,6);        // 10M resistor between pins 4 & 8, pin 8 is sensor pin, add a wire and or foil
CapacitiveSensor   cs_2_8 = CapacitiveSensor(2,8);        // 10M resistor between pins 4 & 8, pin 8 is sensor pin, add a wire and or foil
CapacitiveSensor   cs_2_9 = CapacitiveSensor(2,9);        // 10M resistor between pins 4 & 8, pin 8 is sensor pin, add a wire and or foil
CapacitiveSensor   cs_2_10 = CapacitiveSensor(2,10);        // 10M resistor between pins 4 & 8, pin 8 is sensor pin, add a wire and or foil
CapacitiveSensor   cs_2_12 = CapacitiveSensor(2,12);        // 10M resistor between pins 4 & 8, pin 8 is sensor pin, add a wire and or foil
int switchID;


void setup()                    
{
   // initialize digital pin 13 as an output.
  
   pinMode(13, OUTPUT); //LED
   Keyboard.begin();
   cs_2_4.set_CS_AutocaL_Millis(0xFFFFFFFF);     // turn off autocalibrate on channel 4 - just as an examplectrlKey = KEY_LEFT_GUI;
   //cs_2_7.set_CS_AutocaL_Millis(0xFFFFFFFF);     // turn off autocalibrate on channel 1 - just as an examplectrlKey = KEY_LEFT_GUI;
   //cs_2_8.set_CS_AutocaL_Millis(0xFFFFFFFF);     // turn off autocalibrate on channel 1 - just as an examplectrlKey = KEY_LEFT_GUI;
   Serial.begin(9600);
}

void loop()                    
{
 digitalWrite(13, LOW); 
    long start = millis();
    
  //long total0 =   cs_2_0.capacitiveSensor(30); //A0
  // long total1 =   cs_2_1.capacitiveSensor(30); //A1
  // long total2 =   cs_2_2.capacitiveSensor(30); //A2
  // long total3 =  cs_2_3.capacitiveSensor(30); //A3
  // long total4 =  cs_2_4.capacitiveSensor(30); //A4
  // long total5 =  cs_2_5.capacitiveSensor(30); //A5
  
   
  long total6 =  cs_2_4.capacitiveSensor(30); //A6 is on pin 4
  long total7 =  cs_2_6.capacitiveSensor(30); //A7 is on pin 6 
  long total8 =  cs_2_8.capacitiveSensor(30); //A8 is on pin 8
  long total9 =  cs_2_9.capacitiveSensor(30); //A9 is on pin 9
  long total10 =  cs_2_10.capacitiveSensor(30); //A10
  long total11=  cs_2_12.capacitiveSensor(30); //A11
 
            

//if (total0 > 200) switchID = 100;
//if (total1 > 200) switchID = 1;
//if (total2 > 200) switchID = 2;
//if (total4 > 200) switchID = 3;
//if (total5 > 200) switchID = 4;
//if (total6 > 200) switchID = 5;


if (total6 > 90) switchID = 6;
if (total7 > 90) switchID = 7;
if (total8 > 90) switchID = 8;
if (total9 > 90) switchID = 9;
if (total10 > 90) switchID = 10;
if (total11 > 90) switchID = 11;

if (total10 > 90 && total11 > 90) switchID = 20; //if both buttons 10 and 11 are pressed



//Based on the switch touched send the corresponding ctrl code
switch (switchID) {
case 100:
      digitalWrite(13, HIGH);
      Keyboard.press(ctrlKey);
      // delay(100);
      Keyboard.press(shift); //Capture
      // delay(100);
      Keyboard.press('0'); //Capture
      //delay(100);
      Keyboard.releaseAll();
      // wait for new window to open:
      delay(500);    
      digitalWrite(13,LOW);   
  break;
  case 6:
      digitalWrite(13, HIGH);
      Keyboard.press(ctrlKey);
      // delay(100);
      Keyboard.press(shift); //Capture
      // delay(100);
      Keyboard.press('6'); //Capture
      //delay(100);
      Keyboard.releaseAll();
      // wait for new window to open:
      delay(500);    
      digitalWrite(13,LOW);   
  break;


 case 7:
      digitalWrite(13, HIGH);
      Keyboard.press(ctrlKey);
       //delay(100);
      Keyboard.press(shift); //Capture
      // delay(100);
      Keyboard.press('7'); //Close capture
      //delay(100);
      Keyboard.releaseAll();
       // wait for new window to open:
      delay(500);
      digitalWrite(13,LOW);   
 break;

case 8:
      digitalWrite(13, HIGH);
      Keyboard.press(ctrlKey);
       //delay(100);
      Keyboard.press(shift); //Capture
      // delay(100);
      Keyboard.press('8'); //Close capture
      //delay(100);
      Keyboard.releaseAll();
       // wait for new window to open:
      delay(500);
      digitalWrite(13,LOW);   
break;
 case 9:
      digitalWrite(13, HIGH);
      Keyboard.press(ctrlKey);
       //delay(100);
      Keyboard.press(shift); //Capture
      // delay(100);
      Keyboard.press('9'); //Close capture
      //delay(100);
      Keyboard.releaseAll();
       // wait for new window to open:
      delay(500);
      digitalWrite(13,LOW);    
  break;
         
 case 10:
      digitalWrite(13, HIGH);
      Keyboard.press(ctrlKey);
       //delay(100);
      Keyboard.press(shift); //Capture
      // delay(100);
      Keyboard.press('Q'); //Close capture
      //delay(100);
      Keyboard.releaseAll();
       // wait for new window to open:
      delay(500);
      digitalWrite(13,LOW);    
  break;

     case 11:
      digitalWrite(13, HIGH);
      Keyboard.press(ctrlKey);
       //delay(100);
      Keyboard.press(shift); //Capture
      // delay(100);
      Keyboard.press('W'); //Close capture
      //delay(100);
      Keyboard.releaseAll();
       // wait for new window to open:
      delay(500);
      digitalWrite(13,LOW);    
  break;


 case 20:
      digitalWrite(13, HIGH);
      Keyboard.press(ctrlKey);
       //delay(100);
      Keyboard.press(shift); //Capture
      // delay(100);
      Keyboard.press('E'); //Close capture
      //delay(100);
      Keyboard.releaseAll();
       // wait for new window to open:
      delay(500);
      digitalWrite(13,LOW);    
  break;

default:
      digitalWrite(13, LOW); 
      delay (2);
break;

}

switchID = 0; //reset the ID


 //if the button is pressed
  
   
    //Serial.print(millis() - start);        // check on performance in milliseconds
    //Serial.print("\t");                    // tab character for debug windown spacing
   //Serial.print(total0);                  // print sensor output 1
    Serial.print("\t");
    Serial.print(total6);                  // print sensor output 1
    Serial.print("\t");
    Serial.print(total7);                  // print sensor output 2
    Serial.print("\t");
     Serial.print(total8);                  // print sensor output 2
    Serial.print("\t");
    Serial.print(total9);                  // print sensor output 2
    Serial.print("\t");
    Serial.print(total10);                  // print sensor output 2
   Serial.print("\t");
   Serial.println(total11);                  // print sensor output 2
   

    delay(10);                             // arbitrary delay to limit data to serial port 
}

  




Comments