DMX control from Arduino Nano IoT

For the assignment of DMX control I was initially thinking of having a DMX spot follow the presence of a human, so if the human moves left, the spot moves left. Same for up, down, right. But it doesn’t appear that any of the spots at ITP currently are gobos, so instead I played around with color control.

I thought it would be neat if I could create a party on the floor by moving back and forth at home in front of my sensor, so I both get some exercise, but also feel some connection to the floor. Also, I rarely make silly assignments, so I think it was long overdue.

Though an actual use case could be placing this sensor with the DJ, so his hand movements across the panels affect the lighting.

It would be easy to scale to scale this to incorporate all of the lights on the other addresses and create an actual party. But since I only have up-down, left-right to work with, I decided to stick with one light, because I’m sure the mapping of the movements would appear completely random if more were added.

I worked with the ADJ Dotz PAR on channel 81-83.

The configuration of the sensor I am working with is four IR sensors (1,2,3,4) looking for shifts between them. More info here, where I have done several tests of how well the sensor works. The code is simple, I am increasing a variable (red, r) for up movements, and decreasing for down movements.

Note that I flipped the sensor after taking this picture, so “Sparkfun” is right side up.
    //plot a pulse 1-3 - red spikes
    if (m & MOVEMENT_FROM_1_TO_3) {             // to down
      Serial.print("20 ");
      r += 10;
    } else if (m & MOVEMENT_FROM_3_TO_1) {      // to up
      Serial.print("-20 ");
      r -= 10;
    } else {
      Serial.print("0 ");
    }

Then I mapped the red (81) and blue (83) channel on the ADJ Dotz Par to up-down and left-right respectively.

  /* DMX commands */
  if (now - last_time_DMX > intervalDMX) {
    r = constrain(r, 0, 255);
    g = constrain(g, 0, 255);
    b = constrain(b, 0, 255);
    Serial.println(r);
    
    myController.setChannel(81, r);              // set channel on ADJ Dotz Par at ITP floor
    //myController.setChannel(82, g);              // set channel 
    myController.setChannel(83, b);              // set channel 
    myController.sendPacket(SECRET_SACN_RECV);       // send the data
    
    delay(100);                                    // wait .1 second

    last_time_DMX = now;
  }

Full code is here on Github: https://github.com/louiselessel/Lightandinteractivity/tree/master/DMX/Human_presenceDMX

To run this code you’ll need to set up your own DMX on ethernet and add a tab to this sketch called arduino_secrets.h
for the SSID and password of the network to which you plan to connect, as follows:
#define SECRET_SSID “ssid” // fill in your value
#define SECRET_PASS “password” // fill in your value
#define SECRET_SACN_RECV “XX.XX.XX.XX” // your sACM receiver’s IP address
// Unique ID of your SACN source. You can generate one from https://uuidgenerator.net
// or on the command line by typing uuidgen
#define SECRET_SACN_UUID “XxxxxxxxxxxxxXxxxxxxxXXXxxxxxxX”

The code is based on the sACN library by Tom Igoe: https://github.com/tigoe/sACNSource


Documentation

This video explains the system
This video (starts in the middle of the first video) and shows the sensor.

ITP’s ressource on DMX https://itp.nyu.edu/classes/light/resources/dmx-resources/