Sjoerd’s Glove

Sjoerd van der Sanden has built himself his own ArduIMU Glove! Instead of using Glover to receive the ArduIMU stream of sensor data the data is now sent as ASCII and directly read into Max/MSP via the serial port.

Arduino Sketch

The ArduIMU glove firmware code was modified to enable ASCII packets (comment out line “#define BINARY_PACKETS”). Source code available here:
https://github.com/SebMadgwick/ArduIMU-Gloves

ASCII packet protocol:
F,1,2,3,4,5,6\r = flex sensor data for 6 sensors
S,gx,gy,gz,ax,ay,az,mx,my,mz\r = IMU sensor data (gyroscope, accelerometer, magnetometer)
Q,w,x,y,z\r = quaternion

Max Patch

Version 1 >> Sjoerd’s Serial Glover Max/MSP Patch V 1
Version 1.2 >> Sjoerd’s Serial Glover Max/MSP Patch V 1.2

First Glove Impression from Sjoerd van der Sanden on Vimeo.

Coding session to get ArduIMU receive working

Getting the ArduIMU to receive values to control LED light and vibration motor.
Arduino code >> https://github.com/plusea/CODE/tree/master/PROJECT%20CODE/Gloves/ArduIMU%20Gloves/Sjoerds%20Gloves

Our solution for interpreting received bytes and mapping them to control the RGB LED and vibration motor strength is very inelegant, but simple. In the Receive.cpp tab of the Arduino code you’ll see following lines of code. To keep it simple we restricted the receive interpreter to only having to work with a single byte, so values from 0-255.

Read incoming serial value:
int incomingValues = Serial.read();

If the incoming value is between 0-50 then scale this value to full range of 0-255 and control vibration motor:
if(incomingValues >=0 && incomingValues <= 50) analogWrite(10, incomingValues*5);

If the incoming value is between 50-100 then scale it and control red of LED:
if(incomingValues >=51 && incomingValues <= 100) red=incomingValues-50;

If the incoming value is between 100-150 then scale it and control green of LED:
if(incomingValues >=101 && incomingValues <= 150) grn=incomingValues-100;

If the incoming value is between 150-200 then scale it and control blue of LED:
if(incomingValues >=151 && incomingValues <= 200) blu=incomingValues-150;

Set LED colour:
LEDs::setled(red*5,grn*5,blu*5);

Sjoerd’s work:

Jozak Sander Live (Sencity Tresor Berlin 2011):

Links:

Artist Page >> http://keller-label.de/jozak-sander-2/
Bio >> https://www.ableton.com/en/education/certified-training/germany/sjoerd-van-der-sanden-berlin/
Music >> https://soundcloud.com/jozaksander
Movie >> http://www.youtube.com/watch?v=WbIzV_5K9mw

5 Comments so far

  1. Alex Quartermain on November 29th, 2013

    Hi, how would i go about sending data to the gloves from Max to mess with the LED colour etc? And what data will it accept? I can’t quite make it out in the video. Great patch and code by the way, great work =]

  2. Hannah Perner-Wilson on November 30th, 2013

    good question! have added answer to post above. let us know if anything is still unclear.

    🙂

  3. Alex Quartermain on November 30th, 2013

    Thanks, works great for me!
    For anyone wondering, just create three sliders each with a range of 50, producing values of 51-100, 101-150 and 151-200, pack them using a ‘pak’ object (not @pack@, that’s important in my experience) and send that to the top input of the ‘serial’ object at the top of the patch.

    Example patch:
    ———-begin_max5_patcher———-
    602.3oc2W10aaBCEF9ZpT Of70YQ1lORxtaSKZ2LsKpztZZpxD7RcGXPFmtr
    Us 6y9XHMTTxHePVUUjLxGe3vKO9kCjGu9JOTRwZdEx s9e02y6QSDOHlMhW
    S.OTNa8hLVEjHZQQdNWpQipWTyWqgEtY9G1DrjoWbmPt7VEeg1U 3IimDMxO
    LXL1LFaGo3wX u0bNeuPpqD laSmPMqWGWtJWHy3Z3xS1jsZYhM.tUhEqzMY
    h2ttRVNTWz6TBV1FYJRgfEI2 lf3oHH5et9J6QygQmNS93Mym 48QEZ.E3AP
    kXBfnWVXYx.fk2 ouLeeTIjPdhJuD8JjiGJR9OM0nKSJY vWX sOvDAbgDLC
    .yziDLAMQcHP qRtq7HzSUpMgHGHgBhNABsJOgq1GFBBbOoDY2QqGaygRlxH
    RMWcKWxRx3c1k6u6oCjDVKsOJgIWtSdQOTdEd77pJSj1SdAtmPv8DzhWM3HZ
    qmQ1KCMjBnD3HOL98uMYsHSvP5jHSpIC8UiShNjNoM7576jvCtShLjNI3sTu
    hrQ3gzF4fE3ghwmOOzf2LhN67 h JtcSvO0mPhnXbOd8 D3vL5o9cQ6xHc1L
    Qc9H.WgQYBYm 1Ab6ZW3YLrpXkZQi.a91hQ9acSmxqzBISKJjam1yx5NQZJW
    1x0jJprNIPv3cuud.JKrWJCjF8BKMZ kF4BKMb k1kdCMneRK7 fzH8SZzKu
    zLcI6kzvmjzp6kvJKefqppqsSUlFu2WnryiG4lKjt4tdeHE AQyoD4BwTlts
    ZSq1UJWas0SissufKnY3uroj.OC
    ———–end_max5_patcher———–

  4. Sjoerd on February 13th, 2014

    Thanks for your post. With the Motor included, it would look like this:


    ----------begin_max5_patcher----------
    561.3ocyW0saaBCF8Z3ovxWmE4eHTn20miopJGvY0cfAYLoYqpu6yXiSSZCC
    RVDKJQ1w1e53y43O9L4sv.35pc7FH3dv2AAAuEFDXmpahf9wAvR1trBViMLX
    UqtfqgKbKIaKERyX6Z39IqY5rmExe7jhmocXGktZIZAfFY6H6aAO9APNjsHg
    5mUj61y0u7MreKypJK4RKtPX2TuGF10rXhBPxe0fmGMMemCplLVAGf.Xxcl1
    UHe.apj5Fwu4VARVhNkviGV3qtCY0ZbTWWZpc.ZPgi pvoQGREIqzRE3CJAq
    vuhCA8up4tcEBAOdAVS9APN0SVu.wVAFg7siHvZlxnDMW8DWxVWvG3TmRGTh
    aJpX5KSm 8Tfk.r46Jr4b5ZkEDgclThMwGaQ3bSCHyVZvTrGD1XQWK6glzWP
    3evdv2R1iI4Ae0RdnwtjGhsCiVc9tCI8 s6zJqYY Dro6y43K3Q8EbhsKdrR
    qzSXKIWfs3p6r3K 3hbqlW6zkeu1xT6IwwqbjmPG0SbsTb ySCeQK47JGSHC
    msbZivtuvBg7yukgk7cyer6zT0px7X5ScAeP bdiVHYZQk7ffvGEyyh7bt7P
    IjKZ5TkUHnSdLMU5Pw2VzgbaQmnaJ5Plh6zUDXt3SxT3S57xG7H7ghmW9PFi
    Oj4KclNgyqOkyOc93JMxpq2xUM8XZoh4JhWpT6eq.nozuan8xPnhuU3i2E.S
    YtGPatDnU4t7XWRr4uFY1m2C CfRtkxH
    -----------end_max5_patcher-----------

  5. The Gloves Project on September 27th, 2014

    […] Documentation of Sjoerd’s gloves that use this code to send data directly to his Max/MSP patch >> http://mimugloves.com/dev-blog/sjoerds-glove/ […]

Leave a Reply