Video Projection with arduino

Hi guys. I am attempting to use capacitive sensors that trigger a video on Processing. It works wonderfully when connected to my laptop but I want to project the video onto a TV screen. When I hook up my tv to my laptop using the display port, the capacitive sensors stop working. When I do a serial print line, it shows that it’s not sensing anything at all when hooked up to the TV, but when it’s just my laptop it senses everything just fine. Do you know what I can do to fix this issue? Here is my code:

import processing.serial.*;

Serial myPort;  // Create object from Serial class
int val;      // Data received from the serial port

static final int QTY = 2; // quanty of files
final Movie[] movies = new Movie[QTY]; // makes an array  of previusly declared qty
int idx; // index for a file that you want to play
int n;

void setup() {
  size(1280, 800);
  movies[0] = new Movie(this, "ATF.mp4");
  movies[1] = new Movie(this, "LP_HD.mp4");


  // I know that the first port in the serial list on my mac
  // is always my  FTDI adaptor, so I open Serial.list()[0].
  // On Windows machines, this generally opens COM1.
  // Open whatever port is the one you're using.
  String portName = Serial.list()[1];
  //println(portName); // to check if this is your arduino usb port
  myPort = new Serial(this, portName, 28800);

void draw(){
  if ( myPort.available() > 0) {  // If data is available,
    val =;         // read it and store it in val
  set(0, 0, movies[idx]);

  if (val == 0) {              // If the serial value is 0,
    idx = val; // indx is 0 here
    n = 1;

    movies[idx = n].loop();
  } else {       // If the serial value is not 0,

    idx = val;
    n = idx - 1;

    movies[idx = n].loop();

void movieEvent(Movie m) {;
1 Like

hi Ashley,

  • you posted your Processing code
    but NOT used the code formatter


  • you not posted your Arduino code
  • you not posted the resulting print of the line

of the serial incoming

but i just think as all code works fine without ?HDMI? cable to TV/Monitor
it is not a coding question at all and so not required.

what can it be?
i see a ( actually reverted ) grounding issue.
the laptop and its USB cable to arduino give grounding and power to it ? correct?
so that ground is floating.
( means i assume laptop and arduino do not use a external power supply
both “live” from the laptop battery ??)

when you connect the HDMI cable ( what has no PIN for the ground, but the plug body is the ground )
so usually people complain about so called ground loops.
in your case it seems to be the opposite, it might be that your “body capacity charge”
is not enough to be detected ( against the combined capacity of TV + laptop )

the other question might be if the TV is grounded? 3 pin power plug?

i recommend you ignore the processing part and go into the code
of the arduino ( arduino IDE & its terminal )
and find a way to print the measured values ( if not that VAL )
and test what happens if you touch (arduino) ground ( with the other hand )
when the signal gets weaker, if the detection can be amplified…

it even goes so far that i should ask you what shoes you wear when you touch the sensor…

( i build a capacitive dimmer for the bed lamp, and it worked fine ( for me )
my GF could not operate it until we found that she has to put one leg out of the bed to the ground /
i was a big joke of a electric engineer… )

1 Like