Touchdesigner X Biometric Arduino Sensor

by wl3512 in Circuits > Arduino

15 Views, 0 Favorites, 0 Comments

Touchdesigner X Biometric Arduino Sensor

Screenshot 2026-05-03 at 12.25.16 PM.png
Pulse_Midterm_Presentation.png
IMG_7141.JPG

Turn your heartbeat into light, vibration, and projected generative art. Pulse is a wearable glove that reads your pulse in real time using a sensor, then responds through LEDs, haptic vibration, and TouchDesigner visuals

Supplies

  1. Arduino Nano 33 IoT
  2. Pulse sensor
  3. NeoPixel LEDs or LED thread
  4. Vibration motor / vibration disk
  5. Conductive thread or hookup wire
  6. USB cable
  7. Switches (optional)
  8. Breadboard for testing

Build the Glove Layout

Attach components onto the glove:

  1. Place pulse sensor where finger can comfortably rest on it
  2. Sew LEDs across back of glove or fingers
  3. Place vibration motor in palm area
  4. Mount Arduino near wrist for balance
  5. Route wires cleanly so glove can flex while worn

Tip: Leave slack in wiring so hand movement doesn’t break connections.

Wire the Components

Pulse Sensor

  1. Signal → A0
  2. Power → 3.3V or 5V depending on model
  3. Ground → GND

LEDs

  1. Data pin → Digital pin (example D2)
  2. Power → 5V
  3. Ground → GND

Vibration Motor

  1. Control pin → D6
  2. Ground → GND
  3. Use transistor + diode if needed for safer motor driving


Upload Arduino Code

Your Arduino should:

  1. Read analog pulse sensor values on A0
  2. Detect heartbeat spikes
  3. Pulse LEDs with sensor values
  4. Trigger vibration on beats
  5. Send sensor data over Serial at 115200 baud to TouchDesigner

#include <Wire.h>

#include "MAX30105.h"

#include "heartRate.h"


MAX30105 particleSensor;


// Only one LED at D5

const int LED_PIN = 5;


// Beat detection

const byte RATE_SIZE = 4;

byte rates[RATE_SIZE];

byte rateSpot = 0;

long lastBeat = 0;

float beatsPerMinute = 0;

int beatAvg = 0;


// LED flash timing

bool ledsOn = false;

unsigned long ledOnTime = 0;

const int LED_FLASH_MS = 50;


// Output control

int lastOutput = -1;


// Finger detection threshold

long fingerThreshold = 30000;


void setup() {

Serial.begin(115200);

delay(1000);


pinMode(LED_PIN, OUTPUT);

digitalWrite(LED_PIN, LOW);


// Debug if sensor not connected

if (!particleSensor.begin(Wire, I2C_SPEED_STANDARD)) {

Serial.println("DEBUG: MAX30105 heartbeat sensor NOT connected!");

while (1) {

digitalWrite(LED_PIN, HIGH);

delay(200);

digitalWrite(LED_PIN, LOW);

delay(200);

}

}


Serial.println("DEBUG: MAX30105 heartbeat sensor connected.");


particleSensor.setup(

0x1F, // brightness

4, // sample average

2, // LED mode

200, // sample rate

411, // pulse width

4096 // ADC range

);

}


void loop() {

long irValue = particleSensor.getIR();


// Turn LED off after flash

if (ledsOn && millis() - ledOnTime > LED_FLASH_MS) {

digitalWrite(LED_PIN, LOW);

ledsOn = false;

}


// Finger detection

if (irValue < fingerThreshold) {

sendOutput(0);

return;

}


// Heartbeat detection

if (checkForBeat(irValue)) {

long delta = millis() - lastBeat;

lastBeat = millis();


beatsPerMinute = 60.0 / (delta / 1000.0);


if (beatsPerMinute > 30 && beatsPerMinute < 220) {

rates[rateSpot++] = (byte)beatsPerMinute;

rateSpot %= RATE_SIZE;


beatAvg = 0;

for (byte x = 0; x < RATE_SIZE; x++) {

beatAvg += rates[x];

}

beatAvg /= RATE_SIZE;

}


// Flash LED on D5

digitalWrite(LED_PIN, HIGH);

ledsOn = true;

ledOnTime = millis();


sendOutput(10);

} else {

sendOutput(0);

}


delay(5);

}


// Clean serial output

void sendOutput(int value) {

if (value != lastOutput) {

Serial.println(value);

lastOutput = value;

}

}


Calibrate the Pulse Sensor

The project used these rough thresholds:

  1. 0–99 = no finger detected
  2. 100–399 = resting signal
  3. 400+ = heartbeat spike

Every sensor varies, so open Serial Monitor and test with your finger

Program the LED + Vibration Feedback

When a beat is detected:

  1. LEDs brighten or flash
  2. Vibration motor pulses briefly

This makes the glove feel alive and synchronized with your body.

Connect to TouchDesigner

Screenshot 2026-05-03 at 12.21.08 PM.png

In TouchDesigner:

  1. Add a Serial DAT or serial input node
  2. Select Arduino COM port
  3. Set baud rate to 115200
  4. Convert incoming values to channels
  5. Use data to drive animation parameters


Build the Visual System

Screenshot 2026-05-03 at 12.21.37 PM.png

The original project used:

  1. CHOPS that created a Jellyfish that move with each heartbeat
  2. 3D animated heart
  3. Background that fades from black into an ocean scene

Ideas for mapping heartbeat:

  1. Scale objects on beat
  2. Increase particle motion
  3. Change brightness
  4. Distort geometry with BPM speed


Test the Full Experience

Wear glove and test:

  1. Does pulse sensor read consistently?
  2. Do LEDs react instantly?
  3. Does motor pulse on beats?
  4. Does TouchDesigner receive stable data?
  5. Are visuals smooth and synced?


Problems and Fixes

No Heartbeat Reading

  1. Adjust finger placement
  2. Tighten sensor contact
  3. Reduce movement noise

Broken Wearable Connections

  1. Reinforce conductive thread joints
  2. Add strain relief near wrist

Lag in Visuals

  1. Reduce serial spam
  2. Smooth incoming values in TouchDesigner