Touchdesigner X Biometric Arduino Sensor
by wl3512 in Circuits > Arduino
15 Views, 0 Favorites, 0 Comments
Touchdesigner X Biometric Arduino Sensor
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
- Arduino Nano 33 IoT
- Pulse sensor
- NeoPixel LEDs or LED thread
- Vibration motor / vibration disk
- Conductive thread or hookup wire
- USB cable
- Switches (optional)
- Breadboard for testing
Downloads
Build the Glove Layout
Attach components onto the glove:
- Place pulse sensor where finger can comfortably rest on it
- Sew LEDs across back of glove or fingers
- Place vibration motor in palm area
- Mount Arduino near wrist for balance
- 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
- Signal → A0
- Power → 3.3V or 5V depending on model
- Ground → GND
LEDs
- Data pin → Digital pin (example D2)
- Power → 5V
- Ground → GND
Vibration Motor
- Control pin → D6
- Ground → GND
- Use transistor + diode if needed for safer motor driving
Upload Arduino Code
Your Arduino should:
- Read analog pulse sensor values on A0
- Detect heartbeat spikes
- Pulse LEDs with sensor values
- Trigger vibration on beats
- 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:
- 0–99 = no finger detected
- 100–399 = resting signal
- 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:
- LEDs brighten or flash
- Vibration motor pulses briefly
This makes the glove feel alive and synchronized with your body.
Connect to TouchDesigner
In TouchDesigner:
- Add a Serial DAT or serial input node
- Select Arduino COM port
- Set baud rate to 115200
- Convert incoming values to channels
- Use data to drive animation parameters
Build the Visual System
The original project used:
- CHOPS that created a Jellyfish that move with each heartbeat
- 3D animated heart
- Background that fades from black into an ocean scene
Ideas for mapping heartbeat:
- Scale objects on beat
- Increase particle motion
- Change brightness
- Distort geometry with BPM speed
Test the Full Experience
Wear glove and test:
- Does pulse sensor read consistently?
- Do LEDs react instantly?
- Does motor pulse on beats?
- Does TouchDesigner receive stable data?
- Are visuals smooth and synced?
Problems and Fixes
No Heartbeat Reading
- Adjust finger placement
- Tighten sensor contact
- Reduce movement noise
Broken Wearable Connections
- Reinforce conductive thread joints
- Add strain relief near wrist
Lag in Visuals
- Reduce serial spam
- Smooth incoming values in TouchDesigner