PulseTank_osc
Teensy 3.2 reads pulse/hand sensors, drives solenoid timing, and sends OSC over UDP via WIZ850io or WiFi (ESP8266). Static IP 188.0.1.x. UDP
PulseTank — Heartbeat-Driven Actuator Controller
This project implements a heartbeat-driven actuator controller using Teensy 3.2, pulse sensors, and a solenoid actuator. Sensor data is processed in real time and transmitted as OSC messages over UDP via WIZnet WIZ850io Ethernet or ESP8266 Wi-Fi. The system combines interrupt-based pulse detection, BPM smoothing, and deterministic actuator timing.
What This Project Actually Does
This system reads biometric input from a finger pulse sensor (analog), a hand pulse sensor (digital pulse), and a capacitive touch sensor.
The Teensy microcontroller processes the signals to estimate heart rate (BPM) and then drives a solenoid actuator in rhythm with the detected heartbeat. At the same time, the device sends measurement data and control state via OSC messages over UDP to a remote system such as Max/MSP, TouchDesigner, Processing, or other interactive media software.
Network connectivity can be configured in two modes: Ethernet Mode via WIZ850io (W5500), or Wi-Fi Mode via ESP8266.
System Architecture
The project follows a clear real-time pipeline.
Pulse and touch sensors feed into the Teensy 3.2 MCU, which handles heartbeat detection and filtering. From there, the system splits into two parallel outputs: a solenoid actuator output, and an OSC message generator that transmits over WIZ850io Ethernet (UDP) to a remote media system.
Core data flow: Sensor Read → BPM Calculation → Signal Filtering → OSC Transmission → Actuator Timing Update
Networking Architecture (WIZnet Path)
When Ethernet mode is enabled, the Teensy communicates through a WIZ850io module, which integrates the W5500 hardware TCP/IP Ethernet controller.
Network configuration:
- Local UDP Port: 8888
- OSC Output Port: 9999
- Target IP: 188.0.1.255
- Device IP: 188.0.1.(deviceId)
UDP sockets are used to transmit OSC messages. Port 9999 handles outgoing messages, and port 8888 handles incoming control messages.
WIZ850io Integration
The Ethernet module is explicitly initialized in the OSC setup routine. The WIZ850io is reset during startup, and the system runs using static IP configuration. This shows that the project expects WIZ850io hardware, and the module handles all UDP communication while the Teensy focuses on real-time signal processing.
Sensor Processing Pipeline
Heart-rate measurement uses the PulseSensorPlayground library and interrupt-driven sampling at a 2 ms timer interrupt interval. BPM is calculated using a moving average buffer of 10 samples.
BPM Filtering and Actuator Timing
BPM values are smoothed using exponential filtering (alpha = 0.8) to avoid unstable output. This generates actuator timing intervals from BPM: beat duration is derived from BPM, and that duration drives solenoid timing. The actuator is only activated when the touch sensor is active or handsOn is set to true.
OSC Message Interface
Outgoing messages: /ticker, /sample, /combo, /bpm, /bpm2, /type, /inside, /touchRead
Incoming control messages: /thres, /touchThr, /ping, /onTimeP, /onTimeS, /forceS, /maxWait, /debug
This allows remote systems to adjust sensor thresholds and actuator timing dynamically.
Reliability and Fail-Safe Behavior
The system implements multiple safety checks. If no OSC ping is received for 60 seconds, the networking stack is automatically reinitialized. Sensor sanity checks include: BPM outside the range of 40–120 falls back to a default BPM value, and a touch value exceeding 60,000 for 30 seconds triggers a reset of the touch pin.
Why WIZnet Matters in This Design
The WIZ850io module allows the system to use deterministic Ethernet communication for OSC messaging. Key advantages include simple static IP configuration, low-latency UDP transmission, stable networking for interactive installations, and offloading of network processing from the MCU. This lets the Teensy dedicate its CPU time entirely to heartbeat detection, sensor filtering, and real-time actuator timing.
FAQ
Why use WIZ850io instead of Wi-Fi for OSC networking? Ethernet provides lower latency and more predictable communication than Wi-Fi. In interactive installations or performance systems, stable UDP transmission is critical. WIZ850io enables reliable OSC networking using the W5500 hardware TCP/IP stack.
What role does WIZ850io play in this system? WIZ850io acts as the Ethernet interface between the Teensy microcontroller and the network. It handles UDP communication while the Teensy focuses on sensor processing and actuator control.
How are OSC ports configured? Outgoing OSC messages are sent to port 9999, and incoming messages are received on port 8888. This allows remote systems to monitor heartbeat data and control actuator parameters.
How does the system identify multiple devices on the network? Device IDs are set using DIP switches, which determine the last octet of the device IP address (188.0.1.deviceId). This allows multiple controllers to run on the same network simultaneously.
What happens if the OSC connection stops? If the system does not receive an OSC ping for 60 seconds, it automatically reinitializes the networking stack to restore communication.
Tags
WIZ850io / W5500 / OSC / UDP Networking / Teensy / Interactive Installation / Heartbeat Sensor / Embedded Networking / Solenoid Actuator
PulseTank — 심박 기반 액추에이터 컨트롤러
이 프로젝트는 Teensy 3.2, 맥박 센서, 솔레노이드 액추에이터를 활용한 심박 기반 액추에이터 컨트롤러입니다. 센서 데이터를 실시간으로 처리하고, WIZnet WIZ850io 이더넷 또는 ESP8266 Wi-Fi를 통해 OSC 메시지를 UDP로 전송합니다. 인터럽트 기반 맥박 감지, BPM 스무딩, 결정론적 액추에이터 타이밍을 결합한 시스템입니다.
프로젝트 개요
이 시스템은 세 가지 바이오메트릭 입력을 읽습니다: 손가락 맥박 센서(아날로그), 손 맥박 센서(디지털 펄스), 정전식 터치 센서.
Teensy 마이크로컨트롤러는 이 신호들을 처리해 심박수(BPM)를 추정하고, 감지된 심박에 맞춰 솔레노이드 액추에이터를 구동합니다. 동시에 측정 데이터와 제어 상태를 OSC 메시지로 UDP 전송하여 Max/MSP, TouchDesigner, Processing 등의 인터랙티브 미디어 소프트웨어와 연동합니다.
네트워크 연결 방식은 두 가지로 구성할 수 있습니다: WIZ850io(W5500)를 이용한 이더넷 모드, 또는 ESP8266을 이용한 Wi-Fi 모드.
시스템 아키텍처
프로젝트는 명확한 실시간 파이프라인 구조를 따릅니다.
맥박 및 터치 센서 → Teensy 3.2 MCU(심박 감지 및 필터링) → 두 가지 병렬 출력: 솔레노이드 액추에이터 출력, 그리고 WIZ850io 이더넷(UDP)을 통해 원격 미디어 시스템으로 전송되는 OSC 메시지 생성기.
핵심 데이터 흐름: 센서 읽기 → BPM 계산 → 신호 필터링 → OSC 전송 → 액추에이터 타이밍 업데이트
네트워킹 아키텍처 (WIZnet 경로)
이더넷 모드에서 Teensy는 W5500 하드웨어 TCP/IP 이더넷 컨트롤러가 통합된 WIZ850io 모듈을 통해 통신합니다.
네트워크 구성:
- 로컬 UDP 포트: 8888
- OSC 출력 포트: 9999
- 대상 IP: 188.0.1.255
- 장치 IP: 188.0.1.(deviceId)
UDP 소켓을 통해 OSC 메시지를 전송합니다. 포트 9999는 송신, 포트 8888은 수신 제어 메시지를 담당합니다.
WIZ850io 통합
이더넷 모듈은 OSC 설정 루틴에서 명시적으로 초기화됩니다. WIZ850io는 시작 시 리셋되며, 시스템은 정적 IP 구성으로 동작합니다. 모든 UDP 통신은 WIZ850io가 처리하며, Teensy는 실시간 신호 처리에 전념합니다.
센서 처리 파이프라인
심박수 측정은 PulseSensorPlayground 라이브러리와 2ms 타이머 인터럽트 기반 샘플링을 사용합니다. BPM은 10개 샘플의 이동 평균 버퍼로 계산됩니다.
BPM 필터링 및 액추에이터 타이밍
불안정한 출력을 방지하기 위해 BPM 값에 지수 필터링(alpha = 0.8)을 적용합니다. BPM에서 박자 주기를 도출하고, 그 주기로 솔레노이드 타이밍을 구동합니다. 액추에이터는 터치 센서가 활성화되거나 handsOn이 true일 때만 작동합니다.
OSC 메시지 인터페이스
송신 메시지: /ticker, /sample, /combo, /bpm, /bpm2, /type, /inside, /touchRead
수신 제어 메시지: /thres, /touchThr, /ping, /onTimeP, /onTimeS, /forceS, /maxWait, /debug
이를 통해 원격 시스템에서 센서 임계값과 액추에이터 타이밍을 동적으로 조정할 수 있습니다.
신뢰성 및 안전 동작
시스템은 여러 안전 검사를 구현합니다. OSC 핑을 60초간 수신하지 못하면 네트워킹 스택을 자동으로 재초기화합니다. 센서 유효성 검사로는 BPM이 40~120 범위를 벗어나면 기본 BPM으로 폴백하고, 터치 값이 30초 이상 60,000을 초과하면 터치 핀을 리셋합니다.
WIZnet이 이 설계에서 중요한 이유
WIZ850io 모듈은 OSC 메시지 전송에 결정론적 이더넷 통신을 가능하게 합니다. 주요 장점으로는 간단한 정적 IP 구성, 저지연 UDP 전송, 인터랙티브 설치 환경에 적합한 안정적 네트워킹, MCU의 네트워크 처리 부담 경감이 있습니다. 덕분에 Teensy는 CPU 자원을 심박 감지, 센서 필터링, 실시간 액추에이터 타이밍에 온전히 집중할 수 있습니다.
자주 묻는 질문
OSC 네트워킹에 Wi-Fi 대신 WIZ850io를 사용하는 이유는? 이더넷은 Wi-Fi보다 낮은 지연 시간과 예측 가능한 통신을 제공합니다. 인터랙티브 설치나 퍼포먼스 시스템에서는 안정적인 UDP 전송이 매우 중요합니다. WIZ850io는 W5500 하드웨어 TCP/IP 스택을 통해 신뢰할 수 있는 OSC 네트워킹을 구현합니다.
WIZ850io는 이 시스템에서 어떤 역할을 하나요? WIZ850io는 Teensy 마이크로컨트롤러와 네트워크 사이의 이더넷 인터페이스 역할을 합니다. UDP 통신 전반을 처리하며, Teensy는 센서 처리와 액추에이터 제어에 집중할 수 있습니다.
OSC 포트는 어떻게 구성되나요? 송신 OSC 메시지는 포트 9999로, 수신 메시지는 포트 8888로 처리됩니다. 이를 통해 원격 시스템에서 심박 데이터를 모니터링하고 액추에이터 파라미터를 제어할 수 있습니다.
네트워크에서 여러 장치를 어떻게 구분하나요? DIP 스위치로 장치 ID를 설정하며, 이 값이 장치 IP 주소의 마지막 옥텟(188.0.1.deviceId)으로 사용됩니다. 동일 네트워크에서 여러 컨트롤러를 동시에 운용할 수 있습니다.
OSC 연결이 끊기면 어떻게 되나요? 60초간 OSC 핑을 수신하지 못하면 시스템이 자동으로 네트워킹 스택을 재초기화하여 통신을 복구합니다.
태그
WIZ850io / W5500 / OSC / UDP 네트워킹 / Teensy / 인터랙티브 설치 / 심박 센서 / 임베디드 네트워킹 / 솔레노이드 액추에이터

