Social Things_07 ↓ Fourth Prototype

Here is the 4th prototype, where things are finally starting to come together ↓↓↓

Wiring: I wired up both MPR121 and the RGB LED to a prototype shield + a small breadboard to minimize the size of the circuit. I wired up the RGB LED as usual, look up my previous post and/or directly this tutorial. I wired up the MPR121 as instructed there on Sparkfun, to 6 copper tapes.

(Note: the MPR121 from Sparkfun has been discontinued, but you can find the same on Adafruit)

Code: I first used the original library but I wasn’t able to change the threshold so the tapes would still work with a plastic sheet as you can see on top. I asked Gareth and he advised me to use Bare Conductive’s library – indeed it was pretty easy to change the values there. Here is the code with my values + the RGB LED implemented part ↓↓↓

const int redPin = 5;
const int greenPin = 6;
const int bluePin = 7;
boolean ledState = LOW;

#include <MPR121.h>
#include <Wire.h>

#define numElectrodes 12

void setup()
{
 Serial.begin(9600);
 while (!Serial); // only needed if you want serial feedback with the
 // Arduino Leonardo or Bare Touch Board

 Wire.begin();

 // 0x5C is the MPR121 I2C address on the Bare Touch Board
 if (!MPR121.begin(0x5A)) {
 Serial.println("error setting up MPR121");
 switch (MPR121.getError()) {
 case NO_ERROR:
 Serial.println("no error");
 break;
 case ADDRESS_UNKNOWN:
 Serial.println("incorrect address");
 break;
 case READBACK_FAIL:
 Serial.println("readback failure");
 break;
 case OVERCURRENT_FLAG:
 Serial.println("overcurrent on REXT pin");
 break;
 case OUT_OF_RANGE:
 Serial.println("electrode out of range");
 break;
 case NOT_INITED:
 Serial.println("not initialised");
 break;
 default:
 Serial.println("unknown error");
 break;
 }
 while (1);
 }

 // pin 4 is the MPR121 interrupt on the Bare Touch Board
 MPR121.setInterruptPin(2);

 // this is the touch threshold - setting it low makes it more like a proximity trigger
 // default value is 40 for touch
 MPR121.setTouchThreshold(12);

 // this is the release threshold - must ALWAYS be smaller than the touch threshold
 // default value is 20 for touch
 MPR121.setReleaseThreshold(5);

 // initial data update
 MPR121.updateTouchData();

 pinMode(redPin, OUTPUT);
 pinMode(greenPin, OUTPUT);
 pinMode(bluePin, OUTPUT);
}

void setColor (int red, int green, int blue) {
 analogWrite(redPin, 255 - red);
 analogWrite(greenPin, 255 - green);
 analogWrite(bluePin, 255 - blue);
}

void loop()
{
 if (MPR121.touchStatusChanged()) {
 MPR121.updateTouchData();
 for (int i = 0; i < numElectrodes; i++) {
 if (MPR121.isNewTouch(i)) {
 // Serial.print("electrode ");
 Serial.println(i, DEC);
 setColor(255, 0, 0);
 delay(500);
 //Serial.println(" was just touched");
 } else if (MPR121.isNewRelease(i)) {
 //Serial.print("electrode ");
 Serial.println(i, DEC);
 //Serial.println(" was just released");
 }
 }
 }
 digitalWrite(redPin, ledState);
 digitalWrite(greenPin, ledState);
 digitalWrite(bluePin, ledState);
}

Time to re-create the scrolling gesture: the thumb has to hold on the first tape while the others fingers scroll down through the rest of the tapes. This one-hand gesture is pretty similar to what you’re doing on your trackpad or on your smartphone.

I spent quite some time on MAX/MSP to figure out how I could make sure that the fingers have to pass through all the tapes – you might cheat by hold on to one tape only and it’ll still work. After trying out select, clocker and such, I used counter and it does count after the full action from the moment I hit the first tape to the last one! Still, I need to figure out how to measure the speed of that action.

I asked Nicolas for advice and we tried some stuff such as thresh or select added to timer. It didn’t quite work the way I wanted – aka no cheating allowed, but it gave me insight about how I can make it work for the next prototype. Indice: I’m thinking to use counter with timer.

For now, the only thing working is using select down the first tape to activate the sound (I chose an ambient style of music made by my friend Sima Kim in his debut days) through a comb function I intend to fully make use of for its effects.

It’s a bit messy but here the actual MAX/MSP patch ↓↓↓

Also, this is the MAX30100 which is the heart rate sensor I intended to use for the other hand to rest down ↓↓↓

I decided to not use it anymore – not that it didn’t work for some reasons… After discussing it with Nicolas and saying my aim was to parody the tracking technology, he said that my point wouldn’t come across as it’ll only be perceived as technologically intrusive – in fact, exactly why I wanted to get out from tracking datas at the beginning. Well I tried, out for good now!

The light also doesn’t have any real use for now. I’m still struggling to sketch an object’s design that’ll make the most of it while hiding all the wires. I’m thinking of a wavy kind of shape though. I ordered this plastic ball to use its half to cover up the LED, in order to envision the wavy part since I can make up the flat part – next prototype if I got it safely delivered.

Leave a Reply

Your email address will not be published. Required fields are marked *

Archives